home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / varia / memory-device / source / memory.h < prev    next >
C/C++ Source or Header  |  1977-12-31  |  2KB  |  72 lines

  1. #ifndef __MEMORY_H
  2. #define __MEMORY_H
  3. /*
  4. ** $VER: memory.h 1.0 (20 Dec 1995)
  5. **
  6. ** (C) Copyright 1995 Marius Gröger
  7. **     All Rights Reserved
  8. **
  9. ** $HISTORY:
  10. **
  11. ** 20 Dec 1995 : 001.000 :  created
  12. */
  13.  
  14.    /* system header files */
  15. #ifndef EXEC_SEMAPHORES_H
  16. #include <exec/semaphores.h>
  17. #endif
  18. #ifndef EXEC_LISTS_H
  19. #include <exec/lists.h>
  20. #endif
  21. #ifndef EXEC_INTERRUPTS_H
  22. #include <exec/interrupts.h>
  23. #endif
  24. #ifndef EXEC_LIBRARIES_H
  25. #include <exec/libraries.h>
  26. #endif
  27. #ifndef DOS_DOS_H
  28. #include <dos/dos.h>
  29. #endif
  30.  
  31. #ifndef __COMPILER_H
  32. #include "compiler.h"
  33. #endif
  34.  
  35.  
  36. /****************************************************************************/
  37.  
  38.       /* default values */
  39.  
  40.       /* maximum values */
  41.  
  42. /****************************************************************************/
  43.  
  44. struct MemoryBase
  45. {
  46.    struct Library              mb_DevNode;        /* basic device structure */
  47.    ULONG                       mb_SegList;               /* pointer to code */
  48.    struct Library          *   mb_SysBase;
  49.    struct SignalSemaphore      mb_Lock;
  50. };
  51.  
  52. #ifdef __SASC
  53.      /*
  54.      ** redirect all shared library bases to our device base.
  55.      */
  56. #  define SysBase      mb->mb_SysBase
  57.      /*
  58.      ** This macro declares a local variable which temporary gets
  59.      ** SysBase directly from AbsExecBase.
  60.      */
  61. #  define LOCALSYSBASE struct { void *mb_SysBase; } *mb = (void*)0x4
  62.      /*
  63.      ** Use this macro as argument for all functions which need to
  64.      ** have access to your data base.
  65.      */
  66. #  define BASEPTR      struct MemoryBase *mb
  67. #else
  68. #  error Please define library bases for your compiler
  69. #endif
  70.  
  71. #endif
  72.