segment.h 958 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef _M68K_SEGMENT_H
  2. #define _M68K_SEGMENT_H
  3. /* define constants */
  4. /* Address spaces (FC0-FC2) */
  5. #define USER_DATA (1)
  6. #ifndef __USER_DS
  7. #define __USER_DS (USER_DATA)
  8. #endif
  9. #define USER_PROGRAM (2)
  10. #define SUPER_DATA (5)
  11. #ifndef __KERNEL_DS
  12. #define __KERNEL_DS (SUPER_DATA)
  13. #endif
  14. #define SUPER_PROGRAM (6)
  15. #define CPU_SPACE (7)
  16. #ifndef __ASSEMBLY__
  17. typedef struct {
  18. unsigned long seg;
  19. } mm_segment_t;
  20. #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
  21. #define USER_DS MAKE_MM_SEG(__USER_DS)
  22. #define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS)
  23. /*
  24. * Get/set the SFC/DFC registers for MOVES instructions
  25. */
  26. static inline mm_segment_t get_fs(void)
  27. {
  28. return USER_DS;
  29. }
  30. static inline mm_segment_t get_ds(void)
  31. {
  32. /* return the supervisor data space code */
  33. return KERNEL_DS;
  34. }
  35. static inline void set_fs(mm_segment_t val)
  36. {
  37. }
  38. #define segment_eq(a,b) ((a).seg == (b).seg)
  39. #endif /* __ASSEMBLY__ */
  40. #endif /* _M68K_SEGMENT_H */