On Tue, 24 Apr 2007 00:56:02 +0200 Luca Tettamanti <[EMAIL PROTECTED]> wrote:
> Il Fri, Apr 20, 2007 at 06:59:11PM +0200, Stefan Seyfried ha scritto: > > On Wed, Apr 18, 2007 at 09:22:20PM +0200, Tim Dijkstra wrote: > > > Luca Tettamanti <[EMAIL PROTECTED]> wrote: > > > > Well, it's possible to do something like this: > > > > > > > > int s2ram_default_do(void) { > > > > use /s/p/s > > > > } > > > > > > > > __attribute__((weak)) int s2ram_do(void) { > > > > return s2ram_default_do(); > > > > } > > > > > > > > and then in PPC code: > > > > > > > > int s2ram_do(void) { > > > > poke PMU; > > > > > > > > return s2ram_default_do(); > > > > } > > > > > > I must confess that I didn't know about these fancy weak-linking stuff, > > > learned something new;) To me it seems a bit overkill, but logically it > > > seems the OK, so be my guest... > > > > For me, as a not-so-experienced C programmer, it is probably easier to > > understand why there is some ppc-specific code in main(), either #ifdef'd > > directly or simply where i know that this function is defined as NULL in > > the !PPC case. > > > > But i think i will also learn about this weak linking stuff if i actually > > need to, so i don't care too much which way we go either ;-) > > It's quite simple: a weak symbol may be discared by the linker if it > found another copy. Yes, but it reads a little less easier. > This is the updated patch. You can either use the original 2/2 or this > one: OK looks good, if nobody objects. I'll commit this tomorrow. Thanks Luca. grts Tim
signature.asc
Description: PGP signature
------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/
_______________________________________________ Suspend-devel mailing list Suspend-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/suspend-devel