home *** CD-ROM | disk | FTP | other *** search
/ Amiga Times / AmigaTimes.iso / demos / programme / WarpUPV3 / WarpUP-WarpOS / hwdrivers / Template / WarpHW.c < prev   
Encoding:
C/C++ Source or Header  |  1998-10-06  |  1.8 KB  |  95 lines

  1. /*
  2.  *
  3.  *      68K part of the WarpUp hardware driver
  4.  *      Be sure to read the instructions in the documentation before
  5.  *      writing the code!
  6.  *
  7.  */
  8.  
  9. #include <exec/libraries.h>
  10.  
  11. struct WarpHWBase
  12. {
  13.         struct Library base;
  14. };
  15.  
  16. #pragma libbase WarpHWBase
  17.  
  18. extern void sync(void);         /* ASM source which performs one NOP */
  19.  
  20. /*
  21.  *
  22.  *      GetDriverID
  23.  *      returns an identification string for this hardware driver
  24.  *
  25.  */
  26.  
  27. char* __saveds GetDriverID(void)
  28. {
  29.         return("WarpUp hardware driver for <insert your identification here>");
  30. }
  31.  
  32. /*
  33.  *
  34.  *      SupportedProtocol
  35.  *      returns the version of the supported WarpUp HWDriver protocol
  36.  *      Currently the only version is 1
  37.  *
  38.  *      This function exists for backward compatibility reasons, so
  39.  *      that the WarpUp HAL won't call new functions which don't
  40.  *      exist in old HW drivers.
  41.  *
  42.  */
  43.  
  44. int __saveds SupportedProtocol(void)
  45. {
  46.         return(1);
  47. }
  48.  
  49. /*
  50.  *
  51.  *      InitBootArea
  52.  *      Determines the address of the PowerPC's exception area
  53.  *      space. The exception area can be allocated inside this
  54.  *      function using exec memory allocation mechanisms.
  55.  *
  56.  */
  57.  
  58. void* __saveds InitBootArea(void)
  59. {
  60.  
  61. /* allocate at least 64KB of memory and modify all necessary registers of
  62.    the hardware, so that the hardware can map the exception area
  63.    space to the allocated memory
  64.    Return the address of the exception area or NULL for failure */
  65.  
  66.         return(NULL);
  67. }
  68.  
  69. /*
  70.  *
  71.  *      BootPowerPC
  72.  *      Resets the PowerPC and initializes all hardware registers
  73.  *
  74.  */
  75.  
  76. void __saveds BootPowerPC(void)
  77. {
  78. /* reset the PowerPC processor and initialize hardware registers */
  79.  
  80. }
  81.  
  82. /*
  83.  *
  84.  *      CauseInterrupt
  85.  *      Invokes the PPC Interrupt. INT signal should be kept active
  86.  *      until confirmed by the PPC side.
  87.  *
  88.  */
  89.  
  90. void __saveds CauseInterrupt(void)
  91. {
  92.  
  93. /* trigger PowerPC external interrupt */
  94. }
  95.