home *** CD-ROM | disk | FTP | other *** search
-
- #####################################################################################################
- #####################################################################################################
- #####################################################################################################
-
- o you can`t write .elf binary "dos loadable"
- handlers or filesystems yet. We need to fully rewrite DeviceProc();
- because it calls LoadSeg through bsr...maybe some rom patch could
- fix this easier.
-
-
- #####################################################################################################
- #####################################################################################################
- #####################################################################################################
-
- o The PPC fd2inline does NOT generate gcc 68k compatible macros as
- it ignores the A4,A5,D7 problem cases completely.
- So don`t copy over your old 68k inlines into the ppcinline dir.
- Always generate it new...there are enough examples how to do it.
-
- #####################################################################################################
- #####################################################################################################
- #####################################################################################################
-
- o MorphOS executable elfs work different than powerup elfs therefore
- we have to seperate both.
- Put that into your programs for now.
-
- /*
- * New PPC AmigaOS startup
- */
- ULONG __amigappc__=1;
-
-
-
- #####################################################################################################
- #####################################################################################################
- #####################################################################################################
-
- o When you port 68k C to GCC PPC you must be *VERY* careful with
- "..." functions because the PPC has a complete different varargs
- ABI than the 68k.
- It shares the varargs elements between registers and the stack.
-
- This means that you can`t address varargs elements as if it were
- a linear stream like "((ULONG*) &Args"
-
- You *MUST* use the varargs macros.
-
- Make also sure that you use the gcc's OWN stdargs.h and *NOT* some
- stdargs from some ixemul/linix includes. It will save you a lot
- headaches.
-
-
-
- An example.
-
- void kprintf(const char *FmtString,
- ...)
- {
- va_list args;
-
- va_start(args,FmtString);
-
- vhprintf((char*) FmtString,
- (void*) 1,
- NULL,
- args);
-
- va_end(args);
- }
-
-
- Now more experienced people will probably wonder how to handle
- AmigaOS`s varargs APIs.
- Expecially the Boopsi interface which is heavily used in datatypes,
- gadgets and mui is a problem here.
-
- fd2inline generally handles such cases for AmigaOS functions
- but there are cases (amiga.lib) and own functions which must
- be done in a different way.
-
- Examples:
-
- Send a Notify Msg...
-
- #define SendOMNotify(MyObject, GInfo, Flags, tags...) \
- ({ \
- ULONG _tags[] = { tags }; \
- struct opUpdate MyopUpdate; \
- MyopUpdate.MethodID = OM_NOTIFY; \
- MyopUpdate.opu_AttrList =(struct TagItem*) _tags; \
- MyopUpdate.opu_GInfo = GInfo; \
- MyopUpdate.opu_Flags = Flags; \
- DoMethodA((MyObject), (APTR) &MyopUpdate); \
- })
-
- Or convert a Method() call into a Ptr MethodA call.
-
- #define DoMethod(MyObject, tags...) \
- ({ULONG _tags[] = { tags }; DoMethodA((MyObject), (APTR)_tags);})
-
- !!!!!!!!!!!!! Attention !!!!!!!!!!!!!!!
-
- MUI uses a special recursive tagarray programming style
- which collides with the varargs macros. You need to
- preprocess MUI sources with a special preprocessor we
- provide in <emultools>.
-
- .c.o$(TARGET):
- emultools/muicp/pregcc <$*.c > /t/$*.cp
- ppc-amigaos-gcc $(G_CFLAGS) $(G_OPTFLAGS) $(G_DEBUG) $(G_DEFINES) $(G_IPATH) -x c -S -o $*.s /t/$*.cp
- ppc-amigaos-as -o$*.o$(TARGET) $*.s
-
- would do the job in a makefile
-
-
- As you can see...it`s not that difficult.
- You only have to know what to do.
-
-
- #####################################################################################################
- #####################################################################################################
- #####################################################################################################
-
- o When a lot of inline os calls are used in a function you compile
- with gcc this may cause hidden stack demands you wouldn`t have
- expected.
-
- Current gcc is very unsmart about the following situation
-
- ({
- struct EmulCaos MyCaos;
- .
- .
- CallOS
- })
-
- ({
- struct EmulCaos MyCaos;
- .
- .
- CallOS
- })
-
- ({
- struct EmulCaos MyCaos;
- .
- .
- CallOS
- })
-
- where it *adds* these EmulCaos structures to the stacksize instead
- of making a union on the stack as the lifetime of these structs is
- limited.
- Let's hope this is fixed in the next gcc release.
-
-
- #####################################################################################################
- #####################################################################################################
- #####################################################################################################
-
- o Coldreboot is not 100% safe. It may always work for you but there is
- a potential dead lock as it can`t cause a hw reset.
-