On Sun, Mar 12, 2000 at 03:04:17PM -0500, Roland McGrath wrote:
> As a general rule, the same feature selections appropriate for Linux/glibc
> are probably the right choices for the Hurd.  As always, using #ifdef __linux__
> or #ifdef __GNU__ is the worst way to choose these things, but if that's
> the norm in X then I suppose that is the thing to do.  Many of these things
> are just assuming real POSIX.1 conformance anyway.

I know, but at least for X 3.3 and earlier this seems to be the usual way.
The X sources in general are platform and not feature based. Also, the Linux
support is quite complex because it deals with libc5 and various glibc based
systems, and I better not touch it at all. It should be straightforward for
someone who knows the linux configure of X better than me to replace the
occurences of if defined(linux) || defined(__GNU__) with if
defined(__GLIBC__) or whatever.
 
> > xdm/dm.h:
> > setgroups arg type is gid_t, not int.
> 
> gid_t and int are the same size on the Hurd, so this is not a crucial issue
> one way or the other in practice.  

Not a problem anyway, as the change is already done, I only need to add the
"|| defined(__GNU__)" (also, this is a glibc issue of course).
 
> > xdm/policy.c:
> > How to get load average.                       TODO!!!
> 
> As of glibc-2.2, getloadavg will be included in libc, so that will be the
> best thing to use on any glibc system.

Yep, there is already some code that uses it, I only need to check its
validity on the Hurd.
 
> > xdm/sessreg.c:
> > Slot allocation.                               TODO!!!
> 
> I'm not sure what you mean exactly, but if this is utmp stuff then it
> should use the glibc <utmp.h> or <utmpx.h> interfaces as on Linux.

Yes, it seems to be utmp although I didn't understand the code at first
glance, there is already something for sysv based/linux systems. The default
code that is currently used counts the number of lines in /etc/ttys, so this
should be definitely fixed :)

> > For __GNU__, define HAVE_MMAP_ANON and include some stuff, including
> > mach/vm_param.h for PAGE_SIZE.
> 
> Don't do that.  Use `getpagesize ()' or `sysconf (_SC_PAGE_SIZE)'.
> Never include any <mach/*> header without a very, very, very good reason.
> Never include any <hurd/*> header without at least a pretty good reason.

Ah, _SC_PAGE_SIZE  is used if it is available anyway, so I can just remove
the #include.

> > Xserver/hw/xfree86/common/xf86Beta.c:
> > Activate SYSV and linux code section?         TODO!!!
> > Xserver/hw/xfree86/common/xf86Config.c:
> > Here too (done).
> > Xserver/hw/xfree86/accel/glint/vgaHW.c:
> > Xserver/hw/xfree86/vga256/drivers/tdfx/vb_vgahw.c
> > Define NEED_SAVED_CMAP as done fro MACH386 and linux?
> >  (Yes, as in Xserver/hw/xfree86/vga256/vga/vgaHW.c)
> > Define bigger text amount as for Linux?                 TODO!!!
> >  (No? as in Xserver/hw/xfree86/vga256/vga/vgaHW.c)
> > Xserver/hw/xfree86/accel/s3/s3ELSA.c:
> > Xserver/hw/xfree86/accel/s3_virge/s3ELSA.c:
> > Xserver/hw/xfree86/vga256/vga/vga.c:
> > Xserver/hw/xfree86/vga256/drivers/s3_svga/s3ELSA.c:
> > Do the same things as on linux??                        TODO!!!
> 
> I'll have to look at the details, but I wouldn't worry about this part of
> the code much until we really get other things in place for how we're going
> to make the device access for the server work.

Ok. I don't worry much about the servers anyway. Some of the changes above
add some asm statements, and I definitely can't say anything about it.
 
> > .../AsmMacro.c: Prolly follow linux on cli sti?
> 
> I need the context.

That's the whole code. Although, on deeper investigation, it seems that
intr_disable and intr_enable are not used anywhere, so it probably is
cruft that we don't ned to care about.

#if defined(linux) || defined(__arm32__) || (defined(Lynx) &&
defined(__powerpc__))

#define intr_disable()
#define intr_enable()

#else

static __inline__ void
intr_disable()
{
  __asm__ __volatile__("cli");
}

static __inline__ void
intr_enable()
{
  __asm__ __volatile__("sti");
}

#endif /* else !linux && !__arm32__ */
 
> > Xserver/hw/xfree86/accel/agx/agxInit.c:
> > Use Mach code for priority, as seen in earlier example.
> 
> That appears also to be the BSD code; can you tell me what all would be
> enabled if we defined `CSRG_BASED'?  I can't see from the code what the
> linux version does differently, so I don't know which interface is best.

This is probably a bad idea, as a lot of code will change that we don't want
to change, for example will setpgid not be called anymore in xdm/daemon.c
and so on. I could check all occurences, but in general it seems that one
should not try to be clever with the X sources. (X could really profit from
something like libiberty and configure).

> Many things where you changed `#ifdef linux' into
> `#if defined(linux) || defined(__GNU__)', I would argue
> should instead be doing `#if __GLIBC__ - 0 >= 2' or something like that.
> That is, these are generic glibc API issues and the test should be
> appropriate for that.  I don't know if the X people would dislike that
> change more, but it's a better change.

It would require some coordination with the linux people, see above.
Currently, the GLIBC symbol is not used at all in X, so at least it would be
a clean start. I will try to get hold of the new X sources and some email
address of the Linux guys writing the conf parts of X.

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org Check Key server 
Marcus Brinkmann              GNU    http://www.gnu.org    for public PGP Key 
[EMAIL PROTECTED],     [EMAIL PROTECTED]    PGP Key ID 36E7CD09
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/       [EMAIL PROTECTED]

Reply via email to