Files | |
file | process.c |
Implementation of the Contiki process kernel. | |
file | process.h |
Header file for the Contiki process interface. | |
Defines | |
#define | PROCESS_STATE_NONE 0 |
#define | PROCESS_STATE_INIT 1 |
#define | PROCESS_STATE_RUNNING 2 |
#define | PROCESS_STATE_NEEDS_POLL 3 |
Typedefs | |
typedef unsigned char | process_event_t |
typedef void * | process_data_t |
typedef unsigned char | process_num_events_t |
Functions | |
process_event_t | process_alloc_event (void) |
Allocate a global event number. | |
void | process_start (struct process *p, char *arg) |
Start a process. | |
void | process_exit (struct process *p) |
Cause a process to exit. | |
void | process_init (void) |
Initialize the process module. | |
int | process_run (void) |
Run the system once - call poll handlers and process one event. | |
int | process_post (struct process *p, process_event_t ev, process_data_t data) |
Post an asynchronous event. | |
void | process_post_synch (struct process *p, process_event_t ev, process_data_t data) |
Post a synchronous event to a process. | |
void | process_poll (struct process *p) |
Request a process to be polled. | |
Variables | |
process * | process_list = NULL |
process * | process_current = NULL |
|
Allocate a global event number.
Definition at line 90 of file process.c. Referenced by PROCESS_THREAD(). |
|
Cause a process to exit.
Definition at line 203 of file process.c. References PROCESS_CURRENT. |
|
Initialize the process module. This function initializes the process module and should be called by the system boot-up code. Definition at line 209 of file process.c. References NULL, and PROCESS_EVENT_MAX. |
|
Request a process to be polled. This function typically is called from an interrupt handler to cause a process to be polled.
Definition at line 384 of file process.c. References NULL, PROCESS_STATE_NEEDS_POLL, PROCESS_STATE_RUNNING, and state. Referenced by etimer_request_poll(), and PROCESS_THREAD(). |
|
Post an asynchronous event. This function posts an asynchronous event to one or more processes. The handing of the event is deferred until the target process is scheduled by the kernel. An event can be broadcast to all processes, in which case all processes in the system will be scheduled to handle the event.
Definition at line 356 of file process.c. References PROCESS_ERR_FULL, and PROCESS_ERR_OK. Referenced by mt_post(), process_start(), PROCESS_THREAD(), program_handler_load(), resolv_conf(), resolv_found(), service_remove(), tcpip_poll_tcp(), and tcpip_poll_udp(). |
|
Post a synchronous event to a process.
Definition at line 375 of file process.c. Referenced by PROCESS_THREAD(), tcpip_input(), and tcpip_uipcall(). |
|
Run the system once - call poll handlers and process one event. This function should be called repeatedly from the main() program to actuall run the Contiki system. It calls the necessary poll handlers, and processes one event. The function returns the number of events that are waiting in the event queue so that the caller may choose to put the CPU to sleep when there are no pending events.
|
|
Start a process.
Definition at line 96 of file process.c. References next, NULL, PROCESS_EVENT_INIT, process_post(), PROCESS_STATE_INIT, pt, PT_INIT, and state. Referenced by mtp_start(). |