Paul Irofti <p...@irofti.net> wrote:

> On 2020-05-29 16:00, Mark Kettenis wrote:
> >> Date: Fri, 29 May 2020 13:45:37 +0100
> >> From: Stuart Henderson <s...@spacehopper.org>
> >>
> >> On 2020/05/29 13:50, Paul Irofti wrote:
> >>> +struct __timekeep {
> >>> + uint32_t major;         /* version major number */
> >>> + uint32_t minor;         /* version minor number */
> >>> +
> >>> + u_int64_t               th_scale;
> >>> + unsigned int            th_offset_count;
> >>> + struct bintime          th_offset;
> >>> + struct bintime          th_naptime;
> >>> + struct bintime          th_boottime;
> >>> + volatile unsigned int   th_generation;
> >>> +
> >>> + unsigned int            tc_user;
> >>> + unsigned int            tc_counter_mask;
> >>> +};
> >>
> >> Ah good, you got rid of u_int, that was causing problems with port builds.
> >
> > That in itself is a problem.  This means <time.h> is the wrong place
> > for this struct.  We need to find a better place for this.
> >
> > Since this is now closely linked to the timecounter stuff
> > <sys/timetc.h> would be an obvious place.  Now that file has:
> >
> > #ifndef _KERNEL
> > #error "no user-serviceable parts inside"
> > #endif
> >
> > you could change that into
> >
> > #if !defined(_KERNEL) && !defined(_LIBC)
> > #error "no user-serviceable parts inside"
> > #endif
> >
> > and make sure you #define _LIBC brefore uncluding this file where it
> > is needed.  As few places as possible obviously.
> 
> Hmmm... so this would make it libc bound. I don't see anything wrong
> with it, but is it what we want?

what a strange comment

in our world, libc (and subjuncts crt0 and ld.so) are THE ONLY valid
interfaces to the kernel

Another place to put it is in elf, since it is tied to a new elf marker.

Tremendous caution is required, these include files must not reference
each other in a way that requires excessive #include which will break
public software

Reply via email to