port-type.lisp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ;;
  2. ;; In this file we define the foreign type mach_port_type_t.
  3. ;;
  4. (defmacro %create-port-type-type ()
  5. ;; XXX should %mach-port-type-get return
  6. ;; a syntax instead?
  7. (flet ((%mach-port-type-get (code)
  8. (ash 1 (+ (foreign-enum-value port-right code) 16))))
  9. (let* ((+type-none+ 0)
  10. (+type-send+ (%mach-port-type-get :right-send))
  11. (+type-receive+ (%mach-port-type-get :right-receive))
  12. (+type-send-once+ (%mach-port-type-get :right-send-once))
  13. (+type-port-set+ (%mach-port-type-get :right-port-set))
  14. (+type-dead-name+ (%mach-port-type-get :right-dead-name))
  15. (+type-send-receive+ (boole boole-ior
  16. +type-send+
  17. +type-receive+))
  18. (+type-send-rights+ (boole boole-ior
  19. +type-send+
  20. +type-send-once+))
  21. (+type-port-rights+ (boole boole-ior
  22. +type-send-rights+
  23. +type-receive+))
  24. (+type-port-or-dead+ (boole boole-ior
  25. +type-port-rights+
  26. +type-dead-name+))
  27. (+type-all-rights+ (boole boole-ior
  28. +type-port-or-dead+
  29. +type-port-set+))
  30. (+type-dnrequest+ #x80000000)
  31. (+type-marequest+ #x40000000)
  32. (+type-compat+ #x20000000))
  33. #`(defbitfield port-type-t
  34. (:type-none #,+type-none+)
  35. (:type-send #,+type-send+)
  36. (:type-receive #,+type-receive+)
  37. (:type-send-once #,+type-send-once+)
  38. (:type-port-set #,+type-port-set+)
  39. (:type-dead-name #,+type-dead-name+)
  40. (:type-send-receive #,+type-send-receive+)
  41. (:type-send-rights #,+type-send-rights+)
  42. (:type-port-rights #,+type-port-rights+)
  43. (:type-port-or-dead #,+type-port-or-dead+)
  44. (:type-all-rights #,+type-all-rights+)
  45. (:type-dnrequest #,+type-dnrequest+)
  46. (:type-marequest #,+type-marequest+)
  47. (:type-compat #,+type-compat+)))))
  48. (%create-port-type-type)