From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: grub-devel@gnu.org
Subject: Re: [PATCH] Export functions to allow any module to perform primitive operations on serial port devices
Date: Thu, 10 Nov 2011 09:42:11 +0100 [thread overview]
Message-ID: <4EBB8E63.6000009@gmail.com> (raw)
In-Reply-To: <CAHOq+OpQd8EHJ8kFZnFsm0oT57s8Y14nQw3hggF4MM2ukCZ9cg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 6624 bytes --]
On 07.11.2011 22:13, Shea Levy wrote:
> Hello,
>
> On Thu, Oct 27, 2011 at 2:31 PM, Shea Levy <slevy@tieronedesign.com> wrote:
>> Hello all,
>>
>> These two commits make it straightforward for any module to interact
>> with serial devices. The essential change is making grub_serial_find
>> non-static and declaring it in serial.h, but I also added some inline
>> convenience functions so you can call grub_serial_port_whatever(port,
>> other-args) instead of port -> driver -> whatever(port, other-args).
>>
>> Cheers,
>> Shea Levy
>>
> I've updated the patch to include a ChangeLog and to fix problems with tabs.
ChangeLog entry wasn't following convention and indentation was all
wrong. I've fix it this time but I won't do it next one.
> Cheers,
> Shea Levy
>
>
> # Bazaar merge directive format 2 (Bazaar 0.90)
> # revision_id: slevy@tieronedesign.com-20111107210252-hpgs4r476o72t0vj
> # target_branch: http://bzr.savannah.gnu.org/r/grub/trunk/grub/
> # testament_sha1: 4ed3bc7da4813bab2e805390b044ff612e9fc869
> # timestamp: 2011-11-07 16:09:33 -0500
> # base_revision_id: phcoder@gmail.com-20111027010427-w9m1evhnf25d47bp
> #
> # Begin patch
> === modified file 'ChangeLog'
> --- ChangeLog 2011-10-27 01:04:27 +0000
> +++ ChangeLog 2011-11-07 21:02:52 +0000
> @@ -1,3 +1,12 @@
> +2011-11-07 Shea Levy <slevy@tieronedesign.com>
> +
> + Allow all modules to perform serial IO
> +
> + * grub-core/term-serial.c (grub_serial_find): Remove static qualifier
> + * include/grub/serial.h: Add grub_serial_find() prototype
> + Add inlined grub_serial_port_* functions corresponding to each of the
> + functions in struct grub_serial_driver
> +
> 2011-10-26 Vladimir Serbinenko <phcoder@gmail.com>
>
> Support NTFS reparse points.
> === modified file 'grub-core/term/serial.c'
> --- grub-core/term/serial.c 2011-10-14 17:16:37 +0000
> +++ grub-core/term/serial.c 2011-10-27 17:14:47 +0000
> @@ -125,7 +125,7 @@
>
>
>
> -static struct grub_serial_port *
> +struct grub_serial_port *
> grub_serial_find (char *name)
> {
> struct grub_serial_port *port;
> === modified file 'include/grub/serial.h'
> --- include/grub/serial.h 2011-02-19 12:18:05 +0000
> +++ include/grub/serial.h 2011-11-07 20:55:49 +0000
> @@ -96,6 +96,29 @@
>
> void EXPORT_FUNC(grub_serial_unregister) (struct grub_serial_port *port);
>
> + /* Convenience functions to perform primitive operations on a port. */
> +static inline grub_err_t grub_serial_port_configure
> + (struct grub_serial_port *port, struct grub_serial_config *config)
> +{
> + return port->driver->configure (port, config);
> +}
> +
> +static inline int grub_serial_port_fetch (struct grub_serial_port *port)
> +{
> + return port->driver->fetch (port);
> +}
> +
> +static inline void grub_serial_port_put (struct grub_serial_port *port,
> + const int c)
> +{
> + port->driver->put (port, c);
> +}
> +
> +static inline void grub_serial_port_fini (struct grub_serial_port *port)
> +{
> + port->driver->fini (port);
> +}
> +
> /* Set default settings. */
> static inline grub_err_t
> grub_serial_config_defaults (struct grub_serial_port *port)
> @@ -117,6 +140,7 @@
>
> void grub_ns8250_init (void);
> char *grub_serial_ns8250_add_port (grub_port_t port);
> +struct grub_serial_port *grub_serial_find (char *name);
> extern struct grub_serial_driver grub_ns8250_driver;
> void EXPORT_FUNC(grub_serial_unregister_driver) (struct
> grub_serial_driver *driver);
>
> # Begin bundle
> IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWdwP64gABSXfgGAwUHf//3ok
> ngC////6YAkLvq7Y+jzoADO7N3uMiuEJKolDKmI1GQaGgaeiAAAAGjQAJKATCDQmmkp7Kh6g0GgB
> kADQc0xMBGmBGEYAAAAm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IHoEJJoEGJsJ
> D8AZgSKgCIEkSQoDt2pQdA5+XMb9JG0z2gJMxo+guVeDNK1jCK7CHIpUYifJZF4LRDTUkZzPcsm/
> sYCBPtNer41iCJRIyFrD1jcO7T3FeY/TidCCCiUHXymZGCgb7KLxWtZmV2EIdY98hnoU0tRkKilW
> JAqXmL7GS2IJjoPaORowuU7ZqtapxCq0hFhjAALEJIblr0ITGet4zch0HDhDBBDiiamkRBEEgqq8
> kZBkTVDEEWlzBakEiJBBIiXvC5M8OwMCxT8pEzkFN24geu/ozgdE9lAOwICbHwHVczSgR4AWoaCy
> bsaUOUDndayLXZA+CrjaDoayDXamZTOhcRJDFISbnImbQ8CwANEIZnAGqAOTOaDadVUIQwpgYqTH
> FAxHOSUCzilQYQs8ZqS4Idocr6lgZKvQFAcp5sSXPOB/xdyRThQkNwP64gA=
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
prev parent reply other threads:[~2011-11-10 8:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-27 18:31 [PATCH] Export functions to allow any module to perform primitive operations on serial port devices Shea Levy
2011-11-07 21:13 ` Shea Levy
2011-11-10 8:42 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EBB8E63.6000009@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.