Drivers for the MNT ZZ9000 graphics and ARM coprocessor card for classic Amigas.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

66 lines
1.5 KiB

  1. /*
  2. compiler.h
  3. (C) 2018 Henryk Richter <henryk.richter@gmx.net>
  4. Interface macros for ASM subroutines for VBCC, GCC and SAS/C
  5. syntax:
  6. ASM SAVEDS int some_asm_subroutine(
  7. ASMR(d3) unsigned int some_data ASMREG(d3),
  8. ASMR(a0) unsigned char *some_address ASMREG(a0)
  9. );
  10. Reason for the double spec of An/Dn: some compilers (SAS) require the register
  11. on the left hand side, gcc on the right hand side. I wanted to avoid a big macro
  12. for the whole argument and moved the stuff into two macros per argument.
  13. */
  14. #ifndef _INC_ASMINTERFACE_H
  15. #define _INC_ASMINTERFACE_H
  16. #ifdef __SASC
  17. #define ASM __asm
  18. #define ASMR(x) register __ ## x
  19. #define ASMREG(x)
  20. #define SAVEDS __saveds
  21. #define STRUCTOFFSET OFFSET /* exec/initializers.h */
  22. #define INLINE __inline static
  23. #else /* __SASC */
  24. #ifdef __GNUC__
  25. #define ASM
  26. #define ASMR(x) register
  27. #define ASMREG(x) __asm("" #x "")
  28. //#define SAVEDS __saveds
  29. #define SAVEDS
  30. #define STRUCTOFFSET OFFSET /* exec/initializers.h */
  31. #define INLINE static inline
  32. #else /* __GNUC__ */
  33. #ifdef __VBCC__
  34. #define ASM
  35. #define ASMR(x) __reg("" #x "")
  36. #define ASMREG(x)
  37. #define SAVEDS __saveds
  38. #define STRUCTOFFSET(_a_,_b_) offsetof(struct _a_, _b_) /* stddef.h */
  39. #include <stddef.h>
  40. /* sorry, I ran into some issues inlining stuff with VBCC, disabling it */
  41. #define INLINE
  42. #else /* __VBCC__ */
  43. #error "Compiler not supported yet in compiler.h"
  44. #endif /* __VBCC__ */
  45. #endif /* __GNUC__ */
  46. #endif /* __SASC */
  47. #endif /* _INC_ASMINTERFACE_H */