(** Shared memory page accessors (4096 bytes). {v Offset Size Field 0x000 8 bytes Guest heartbeat counter (uint64) 0x008 8 bytes Host heartbeat ack (uint64) 0x010 4 bytes Time version (uint32, seqlock) 0x014 8 bytes Mission time seconds (uint64) 0x01C 4 bytes Mission time nanoseconds (uint32) 0x020 4 bytes Guest status word (uint32) 0x024 4 bytes Host command word (uint32) 0x028 4 bytes Guest command ack (uint32) 0x100 256 bytes Guest health string (UTF-8, null-terminated) v} *) val page_size : int (** Shared memory page size: 4096 bytes. *) (** {1 Field offsets} *) val off_heartbeat : int (** Offset of the guest heartbeat counter (8 bytes). *) val off_heartbeat_ack : int (** Offset of the host heartbeat acknowledgement (8 bytes). *) val off_time_version : int (** Offset of the time version seqlock (4 bytes). *) val off_time_seconds : int (** Offset of mission time seconds (8 bytes). *) val off_time_nanos : int (** Offset of mission time nanoseconds (4 bytes). *) val off_guest_status : int (** Offset of the guest status word (4 bytes). *) val off_host_cmd : int (** Offset of the host command word (4 bytes). *) val off_guest_cmd_ack : int (** Offset of the guest command acknowledgement (4 bytes). *) val off_health_string : int (** Offset of the guest health string (256 bytes). *) val health_string_len : int (** Maximum health string length: 256 bytes. *) (** {1 Accessors} All accessors work on a [bytes] buffer of at least [page_size] bytes, using big-endian byte order. *) val heartbeat : bytes -> int64 (** Read the guest heartbeat counter. *) val set_heartbeat : bytes -> int64 -> unit (** Write the guest heartbeat counter. *) val heartbeat_ack : bytes -> int64 (** Read the host heartbeat acknowledgement. *) val set_heartbeat_ack : bytes -> int64 -> unit (** Write the host heartbeat acknowledgement. *) val time_version : bytes -> int (** Read the time version seqlock. *) val set_time_version : bytes -> int -> unit (** Write the time version seqlock. *) val time_seconds : bytes -> int64 (** Read the mission time seconds. *) val set_time_seconds : bytes -> int64 -> unit (** Write the mission time seconds. *) val time_nanos : bytes -> int (** Read the mission time nanoseconds. *) val set_time_nanos : bytes -> int -> unit (** Write the mission time nanoseconds. *) val guest_status : bytes -> int (** Read the guest status word. *) val set_guest_status : bytes -> int -> unit (** Write the guest status word. *) val host_cmd : bytes -> int (** Read the host command word. *) val set_host_cmd : bytes -> int -> unit (** Write the host command word. *) val guest_cmd_ack : bytes -> int (** Read the guest command acknowledgement. *) val set_guest_cmd_ack : bytes -> int -> unit (** Write the guest command acknowledgement. *) val health_string : bytes -> string (** Read the guest health string. *) val set_health_string : bytes -> string -> unit (** Write the guest health string. *) (** {1 Mission time with seqlock} *) type mission_time = { seconds : int64; nanos : int } val write_mission_time : bytes -> mission_time -> unit (** Host: write mission time with seqlock protocol. *) val read_mission_time : bytes -> mission_time (** Guest: read mission time with seqlock retry. *) (** {1 Command word bits} *) val cmd_shutdown : int (** Shutdown command bit. *) val cmd_param_reload : int (** Parameter reload command bit. *) val cmd_dp_ack : int (** Data product acknowledgement command bit. *)