All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: grub2 ChangeLog term/i386/pc/serial.c
       [not found] <E1IpVtw-0001l3-2T@cvs.savannah.gnu.org>
@ 2007-11-06 21:33 ` Vesa Jääskeläinen
  2007-11-07 20:19   ` Robert Millan
  0 siblings, 1 reply; 6+ messages in thread
From: Vesa Jääskeläinen @ 2007-11-06 21:33 UTC (permalink / raw)
  To: The development of GRUB 2

Robert Millan wrote:
> CVSROOT:	/sources/grub
> Module name:	grub2
> Changes by:	Robert Millan <robertmh>	07/11/06 21:23:59
> 
> Modified files:
> 	.              : ChangeLog 
> 	term/i386/pc   : serial.c 
> 
> Log message:
> 	2007-11-06  Robert Millan  <rmh@aybabtu.com>
> 	
> 		* term/i386/pc/serial.c (serial_hw_put): Switch order of arguments
> 		in grub_outb() calls.
> 		(serial_hw_init): Likewise.
> 
> CVSWeb URLs:
> http://cvs.savannah.gnu.org/viewcvs/grub2/ChangeLog?cvsroot=grub&r1=1.437&r2=1.438
> http://cvs.savannah.gnu.org/viewcvs/grub2/term/i386/pc/serial.c?cvsroot=grub&r1=1.4&r2=1.5

Why on earth those parameters are reversed anyway :) ?

On all systems that I can remember arguments for lots of things go like
this:

func(destination, source)

examples are:
memcpy, strcpy

On most of the other systems outp is also outp(port, value)
("destination, source"). Eg. following the same convention.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: grub2 ChangeLog term/i386/pc/serial.c
  2007-11-06 21:33 ` grub2 ChangeLog term/i386/pc/serial.c Vesa Jääskeläinen
@ 2007-11-07 20:19   ` Robert Millan
  2007-11-07 20:35     ` Vesa Jääskeläinen
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Millan @ 2007-11-07 20:19 UTC (permalink / raw)
  To: The development of GRUB 2

On Tue, Nov 06, 2007 at 11:33:44PM +0200, Vesa Jääskeläinen wrote:
> > 	2007-11-06  Robert Millan  <rmh@aybabtu.com>
> > 	
> > 		* term/i386/pc/serial.c (serial_hw_put): Switch order of arguments
> > 		in grub_outb() calls.
> > 		(serial_hw_init): Likewise.
> > 
> > CVSWeb URLs:
> > http://cvs.savannah.gnu.org/viewcvs/grub2/ChangeLog?cvsroot=grub&r1=1.437&r2=1.438
> > http://cvs.savannah.gnu.org/viewcvs/grub2/term/i386/pc/serial.c?cvsroot=grub&r1=1.4&r2=1.5
> 
> Why on earth those parameters are reversed anyway :) ?

My fault :-)

When I replaced inb() and outb() in that file, I assumed they would have
the same semantics as grub_inb() and grub_outb().

> On all systems that I can remember arguments for lots of things go like
> this:
> 
> func(destination, source)
> 
> examples are:
> memcpy, strcpy
> 
> On most of the other systems outp is also outp(port, value)
> ("destination, source"). Eg. following the same convention.

grub_inb() and grub_outb() are based on the inb()/outb() implementation
from glibc headers, so I kept the same arguments for consistency.

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: grub2 ChangeLog term/i386/pc/serial.c
  2007-11-07 20:19   ` Robert Millan
@ 2007-11-07 20:35     ` Vesa Jääskeläinen
  2007-11-07 21:28       ` Robert Millan
  0 siblings, 1 reply; 6+ messages in thread
From: Vesa Jääskeläinen @ 2007-11-07 20:35 UTC (permalink / raw)
  To: The development of GRUB 2

Robert Millan wrote:
> On Tue, Nov 06, 2007 at 11:33:44PM +0200, Vesa Jääskeläinen wrote:
>>> 		* term/i386/pc/serial.c (serial_hw_put): Switch order of arguments
>>> 		in grub_outb() calls.
>> Why on earth those parameters are reversed anyway :) ?
> 
> My fault :-)
> 
> When I replaced inb() and outb() in that file, I assumed they would have
> the same semantics as grub_inb() and grub_outb().

Just to be clear, I would have understood your rational ordering better
than current version ;)

> grub_inb() and grub_outb() are based on the inb()/outb() implementation
> from glibc headers, so I kept the same arguments for consistency.

I see... Once again inconsistency introduced by Unix folks... as AT&T
assembler wouldn't be enough, they then poisons C libs too... oh well...
another thing to try to keep in mind...




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: grub2 ChangeLog term/i386/pc/serial.c
  2007-11-07 20:35     ` Vesa Jääskeläinen
@ 2007-11-07 21:28       ` Robert Millan
  2007-11-09 15:26         ` Marco Gerards
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Millan @ 2007-11-07 21:28 UTC (permalink / raw)
  To: The development of GRUB 2

On Wed, Nov 07, 2007 at 10:35:17PM +0200, Vesa Jääskeläinen wrote:
> > grub_inb() and grub_outb() are based on the inb()/outb() implementation
> > from glibc headers, so I kept the same arguments for consistency.
> 
> I see... Once again inconsistency introduced by Unix folks... as AT&T
> assembler wouldn't be enough, they then poisons C libs too... oh well...
> another thing to try to keep in mind...

I always thought the Right Way to do this would be implement it in GCC,
so that you can do things like:

  __some_magic__(PORT_ADDR) |= 0x80;

which is much more beatufil than either of:

  outb (PORT_ADDR, inb (PORT_ADDR) | 0x80);

  outb (inb (PORT_ADDR) | 0x80, PORT_ADDR);

don't you think?

(now if someone is bored and takes my suggestion to gcc-patches, that'd make
my day...)

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: grub2 ChangeLog term/i386/pc/serial.c
  2007-11-07 21:28       ` Robert Millan
@ 2007-11-09 15:26         ` Marco Gerards
  2007-11-09 21:37           ` Robert Millan
  0 siblings, 1 reply; 6+ messages in thread
From: Marco Gerards @ 2007-11-09 15:26 UTC (permalink / raw)
  To: The development of GRUB 2

Robert Millan <rmh@aybabtu.com> writes:

> On Wed, Nov 07, 2007 at 10:35:17PM +0200, Vesa Jääskeläinen wrote:
>> > grub_inb() and grub_outb() are based on the inb()/outb() implementation
>> > from glibc headers, so I kept the same arguments for consistency.
>> 
>> I see... Once again inconsistency introduced by Unix folks... as AT&T
>> assembler wouldn't be enough, they then poisons C libs too... oh well...
>> another thing to try to keep in mind...
>
> I always thought the Right Way to do this would be implement it in GCC,
> so that you can do things like:
>
>   __some_magic__(PORT_ADDR) |= 0x80;
>
> which is much more beatufil than either of:
>
>   outb (PORT_ADDR, inb (PORT_ADDR) | 0x80);
>
>   outb (inb (PORT_ADDR) | 0x80, PORT_ADDR);
>
> don't you think?
>
> (now if someone is bored and takes my suggestion to gcc-patches, that'd make
> my day...)

That's possible in C++ using operator overloading AFAIK.

Did this commit fix serial support for LB?

--
Marco





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: grub2 ChangeLog term/i386/pc/serial.c
  2007-11-09 15:26         ` Marco Gerards
@ 2007-11-09 21:37           ` Robert Millan
  0 siblings, 0 replies; 6+ messages in thread
From: Robert Millan @ 2007-11-09 21:37 UTC (permalink / raw)
  To: The development of GRUB 2

On Fri, Nov 09, 2007 at 04:26:02PM +0100, Marco Gerards wrote:
> >
> > I always thought the Right Way to do this would be implement it in GCC,
> > so that you can do things like:
> >
> >   __some_magic__(PORT_ADDR) |= 0x80;
> >
> > which is much more beatufil than either of:
> >
> >   outb (PORT_ADDR, inb (PORT_ADDR) | 0x80);
> >
> >   outb (inb (PORT_ADDR) | 0x80, PORT_ADDR);
> >
> > don't you think?
> >
> > (now if someone is bored and takes my suggestion to gcc-patches, that'd make
> > my day...)
> 
> That's possible in C++ using operator overloading AFAIK.

Ah, right.  Maybe we could switch to building with g++ just to get this
feature ;-)

> Did this commit fix serial support for LB?

No, it fixed a bug affecting all platforms (i.e. both of them ;-)).

For serial.mod to work on LB, we need the other patch (the machine.h one).

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-11-09 21:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1IpVtw-0001l3-2T@cvs.savannah.gnu.org>
2007-11-06 21:33 ` grub2 ChangeLog term/i386/pc/serial.c Vesa Jääskeläinen
2007-11-07 20:19   ` Robert Millan
2007-11-07 20:35     ` Vesa Jääskeläinen
2007-11-07 21:28       ` Robert Millan
2007-11-09 15:26         ` Marco Gerards
2007-11-09 21:37           ` Robert Millan

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.