Re: Question about genassym, locore.s and 0-sized arrays (showstopper for an icc compiled kernel)

From: Marius Strobl <marius_at_alchemy.franken.de>
Date: Fri, 5 Sep 2003 02:59:22 +0200
On Thu, Sep 04, 2003 at 03:47:09PM -0700, Marcel Moolenaar wrote:
> 
> We use the size of the symbol (ie the size of the object identified
> by the symbol) to pass around values. This we do by creating arrays.
> If we want to export a C constant 'FOOBAR' to assembly and the constant
> is defined to be 6, then we create an array for the sign, of which the
> size is 1 for negative numbers and 0 otherwise. In this case the array
> will be named FOOBARsign and its size is 0. We also create 4 arrays (*w0,
> *w1, *w2 and *w3), each with a maximum of 64K and corresponding to the
> 4 16-bit words that constitutes a single 64-bit entity.
> In this case
> 	00000006 C FOOBARw0
> 	00000000 C FOOBARw1
> 	00000000 C FOOBARw2
> 	00000000 C FOOBARw3
> 
> If the compiler creates arrays of size 1 for arrays we define as a
> zero-sized array, you get exactly what you've observed.
> 

Is this rather complex approach really necessary? I have successfully
generated assyms.s' using genassym.sh(8) from NetBSD and both ICC and
GCC on i386 which have exactly the same values as one generated with
sys/kern/genassym.sh from FreeBSD. The genassym.sh(8) of NetBSD kind
of directly exports the C-constants so it just needs one symbol per
constant and doesn't require zero sized arrays. Given that it's from
NetBSD their approach also should be very MI.
Received on Thu Sep 04 2003 - 15:59:31 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:21 UTC