[parisc-linux] Some PA-RISC 2.0 Gotchas
John Curry
jcurry@cup.hp.com
Fri, 11 Feb 2000 09:10:54 -0800
Hello all,
we have been looking into the kernel code for porting to the 2.0
Architecture. We have
stumbled upon a few gothas:
- In 2.0, function pointers are not addresses to functions, but are
addresses to data strcutures
called "function descriptors". So, if assembly code gets passed a pointer to
a function, it will have
to remember which slot in the "function descriptor" the actual function
pointer resides.
- There are some places in the kernel where the implicit assumption that
longs == ints will break!
For example, the parisc_set_bit function is used in several places to
operate on bitmaps of type long.
Obviously, this function (and the other related functions) has to converted
to operate on 64-bit quantities.
But, in the free_area_struc type, the map variable is declared as an integer
ptr. Depending on the size of
the bitmap, this will cause the parisc_set_bit to operate incorrectly. We
solved this problem by making
the map variable a unsigned long pointer.
- The 32-bit assembly LDIL, LDO trick of getting the address of some label
(or address) will not work the way you want.
In the 64-bit architeture, you will have to use MFIA in conjunction with
loading the difference from the address
you want, to where you are.
Hope these are of some use.
J.C.