Microchip® Advanced Software Framework

process.c File Reference

    Implementation of the Contiki process kernel.
Author
Adam Dunkels adam@.nosp@m.sics.nosp@m..se
#include <stdio.h>
#include "sys/process.h"
#include "sys/arg.h"

Data Structures

struct  event_data
 

Macros

#define _DEBUG_   0
 
#define PRINTF(...)
 
#define PROCESS_STATE_CALLED   2
 
#define PROCESS_STATE_NONE   0
 
#define PROCESS_STATE_RUNNING   1
 

Functions

static void call_process (struct process *p, process_event_t ev, process_data_t data)
 
static void do_event (void)
 
static void do_poll (void)
 
static void exit_process (struct process *p, struct process *fromprocess)
 
Functions called from application programs
process_event_t process_alloc_event (void)
 Allocate a global event number. More...
 
void process_start (struct process *p, const char *arg)
 Start a process. More...
 
void process_exit (struct process *p)
 Cause a process to exit. More...
 
int process_post (struct process *p, process_event_t ev, void *data)
 Post an asynchronous event. More...
 
void process_post_synch (struct process *p, process_event_t ev, void *data)
 Post a synchronous event to a process. More...
 
Functions called by the system and boot-up code
void process_init (void)
 Initialize the process module. More...
 
int process_run (void)
 Run the system once - call poll handlers and process one event. More...
 
int process_nevents (void)
 Number of events waiting to be processed. More...
 
int process_is_running (struct process *p)
 Check if a process is running. More...
 
Functions called from device drivers
void process_poll (struct process *p)
 Request a process to be polled. More...
 

Variables

static struct event_data events [PROCESS_CONF_NUMEVENTS]
 
static process_num_events_t fevent
 
static process_event_t lastevent
 
static process_num_events_t nevents
 
static volatile unsigned char poll_requested
 
struct processprocess_current = NULL
 
struct processprocess_list = NULL