home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / Drivers / joystick-0.0-I / joystick.next / joystick_kernel.h next >
Encoding:
C/C++ Source or Header  |  1997-05-09  |  1.2 KB  |  40 lines

  1. #ifndef _NEXT_JOYSTICK_KERNEL_H
  2. #define _NEXT_JOYSTICK_KERNEL_H
  3.  
  4. #include "joystick.h"
  5.  
  6. #define HZ 100
  7. #define JS_TRUE 1
  8. #define JS_FALSE 0
  9. #define JS_PORT 0x201        /*io port for joystick operations*/
  10. #define JS_DEF_TIMEOUT 0x1300    /*default timeout value for js_read()*/
  11. #define JS_DEF_CORR    0    /*default correction factor*/
  12. #define JS_DEF_TIMELIMIT 10L    /*default data valid time =10 jiffies == 100ms*/
  13.  
  14. #define JS_X_0    0x01        /*bit mask for x-axis js0*/
  15. #define JS_Y_0    0x02        /*bit mask for y-axis js0*/
  16. #define JS_X_1    0x04        /*bit mask for x-axis js1*/
  17. #define JS_Y_1    0x08        /*bit mask for y-axis js1*/
  18.  
  19. #define PIT_MODE 0x43        /*io port for timer 0*/
  20. #define PIT_COUNTER_0 0x40    /*io port for timer 0*/
  21.  
  22. #define LATCH (1193180L/HZ)    /*initial timer 0 value*/
  23. #define DELTA_TIME(X,Y) ((X)-(Y)+(((X)>=(Y))?0:LATCH))
  24. // #define CURRENT_JIFFIES (jiffies)
  25.  
  26. #define TIMELIMIT    1
  27. #define CURRENT_JIFFIES (clock_value(System) / 10000000ULL)
  28.  
  29. // #define    CLI_STI    1
  30. #ifdef    CLI_STI
  31. #define sti() __asm__ __volatile__ ("sti": : :"memory")
  32. #define cli() __asm__ __volatile__ ("cli": : :"memory")
  33. #endif    CLI_STI
  34.  
  35. #define linux_outb(DATA,ADDRESS)    outb(ADDRESS,DATA)
  36. #define JOYSTICK_MAJOR        32
  37.  
  38.  
  39. #endif /* _NEXT_JOYSTICK_KERNEL_H */
  40.