📄 monitor.h
字号:
/* * File: monitor.h * * Description: * The RTEMS monitor task include file. * * TODO: * * $Id: monitor.h,v 1.13 2002/07/01 22:19:33 joel Exp $ */#ifndef __MONITOR_H#define __MONITOR_H#include <rtems/symbols.h>#include <rtems/error.h> /* rtems_error() */#ifdef __cplusplusextern "C" {#endif/* * Monitor types are derived from rtems object classes */typedef enum { RTEMS_MONITOR_OBJECT_INVALID = OBJECTS_NO_CLASS, RTEMS_MONITOR_OBJECT_TASK = OBJECTS_RTEMS_TASKS, RTEMS_MONITOR_OBJECT_EXTENSION = OBJECTS_RTEMS_EXTENSIONS, RTEMS_MONITOR_OBJECT_QUEUE = OBJECTS_RTEMS_MESSAGE_QUEUES, RTEMS_MONITOR_OBJECT_SEMAPHORE = OBJECTS_RTEMS_SEMAPHORES, RTEMS_MONITOR_OBJECT_PARTITION = OBJECTS_RTEMS_PARTITIONS, RTEMS_MONITOR_OBJECT_REGION = OBJECTS_RTEMS_REGIONS, RTEMS_MONITOR_OBJECT_PORT = OBJECTS_RTEMS_PORTS, /* following monitor objects are not known to RTEMS, but * we like to have "types" for them anyway */ RTEMS_MONITOR_OBJECT_DRIVER = OBJECTS_RTEMS_CLASSES_LAST+1, RTEMS_MONITOR_OBJECT_DNAME, RTEMS_MONITOR_OBJECT_CONFIG, RTEMS_MONITOR_OBJECT_INIT_TASK, RTEMS_MONITOR_OBJECT_MPCI, RTEMS_MONITOR_OBJECT_SYMBOL} rtems_monitor_object_type_t;/* * rtems_monitor_init() flags */#define RTEMS_MONITOR_SUSPEND 0x0001 /* suspend monitor on startup */#define RTEMS_MONITOR_GLOBAL 0x0002 /* monitor should be global *//* * Public interfaces for RTEMS data structures monitor is aware of. * These are only used by the monitor. * * NOTE: * All the canonical objects that correspond to RTEMS managed "objects" * must have an identical first portion with 'id' and 'name' fields. * * Others do not have that restriction, even tho we would like them to. * This is because some of the canonical structures are almost too big * for shared memory driver (eg: mpci) and we are nickel and diming it. *//* * Type of a pointer that may be a symbol */ #define MONITOR_SYMBOL_LEN 20typedef struct { char name[MONITOR_SYMBOL_LEN]; unsigned32 value; unsigned32 offset;} rtems_monitor_symbol_t; typedef struct { rtems_id id; rtems_name name; /* end of common portion */} rtems_monitor_generic_t; /* * Task */typedef struct { rtems_id id; rtems_name name; /* end of common portion */ Thread_Entry entry; unsigned32 argument; void *stack; unsigned32 stack_size; rtems_task_priority priority; States_Control state; rtems_event_set events; rtems_mode modes; rtems_attribute attributes; unsigned32 notepad[RTEMS_NUMBER_NOTEPADS]; rtems_id wait_id; unsigned32 wait_args;} rtems_monitor_task_t;/* * Init task */typedef struct { rtems_id id; /* not really an id */ rtems_name name; /* end of common portion */ rtems_monitor_symbol_t entry; unsigned32 argument; unsigned32 stack_size; rtems_task_priority priority; rtems_mode modes; rtems_attribute attributes;} rtems_monitor_init_task_t;/* * Message queue */typedef struct { rtems_id id; rtems_name name; /* end of common portion */ rtems_attribute attributes; unsigned32 number_of_pending_messages; unsigned32 maximum_pending_messages; unsigned32 maximum_message_size;} rtems_monitor_queue_t;/* * Extension */typedef struct { rtems_id id; rtems_name name; /* end of common portion */ rtems_monitor_symbol_t e_create; rtems_monitor_symbol_t e_start; rtems_monitor_symbol_t e_restart; rtems_monitor_symbol_t e_delete; rtems_monitor_symbol_t e_tswitch; rtems_monitor_symbol_t e_begin; rtems_monitor_symbol_t e_exitted; rtems_monitor_symbol_t e_fatal;} rtems_monitor_extension_t;/* * Device driver */typedef struct { rtems_id id; /* not really an id (should be tho) */ rtems_name name; /* ditto */ /* end of common portion */ rtems_monitor_symbol_t initialization; /* initialization procedure */ rtems_monitor_symbol_t open; /* open request procedure */ rtems_monitor_symbol_t close; /* close request procedure */ rtems_monitor_symbol_t read; /* read request procedure */ rtems_monitor_symbol_t write; /* write request procedure */ rtems_monitor_symbol_t control; /* special functions procedure */} rtems_monitor_driver_t;typedef struct { rtems_id id; /* not used for drivers (yet) */ rtems_name name; /* not used for drivers (yet) */ /* end of common portion */ unsigned32 major; unsigned32 minor; char name_string[64];} rtems_monitor_dname_t;/* * System config */typedef struct { void *work_space_start; unsigned32 work_space_size; unsigned32 maximum_tasks; unsigned32 maximum_timers; unsigned32 maximum_semaphores; unsigned32 maximum_message_queues; unsigned32 maximum_partitions; unsigned32 maximum_regions; unsigned32 maximum_ports; unsigned32 maximum_periods; unsigned32 maximum_extensions; unsigned32 microseconds_per_tick; unsigned32 ticks_per_timeslice; unsigned32 number_of_initialization_tasks;} rtems_monitor_config_t;/* * MPCI config */#if defined(RTEMS_MULTIPROCESSING)typedef struct { unsigned32 node; /* local node number */ unsigned32 maximum_nodes; /* maximum # nodes in system */ unsigned32 maximum_global_objects; /* maximum # global objects */ unsigned32 maximum_proxies; /* maximum # proxies */ unsigned32 default_timeout; /* in ticks */ unsigned32 maximum_packet_size; rtems_monitor_symbol_t initialization; rtems_monitor_symbol_t get_packet; rtems_monitor_symbol_t return_packet; rtems_monitor_symbol_t send_packet; rtems_monitor_symbol_t receive_packet;} rtems_monitor_mpci_t;#endif/* * The generic canonical information union */typedef union { rtems_monitor_generic_t generic; rtems_monitor_task_t task; rtems_monitor_queue_t queue; rtems_monitor_extension_t extension; rtems_monitor_driver_t driver; rtems_monitor_dname_t dname;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -