//
/*
mlexec.h
Structures private to the scheduling executive.
Copyright (c) 1996 Eliot W. Dudley. All rights reserved.
You may distribute under the terms of either the GNU General Public
License or the Artistic License, as specified in the README file.
*/
/*
1-Wire, DS, DS1820, DS2405, DS2407, DS9097, and MicroLan
are trademarks and/or registered trademarks of
Dallas Semiconductor Coporation
*/
//
/**
Source: \URL{../mlexec.h.html#top}
*/
//=============================================================================
//@Man: EOBJ
//@Memo: typedef union EOBJt EOBJ;
typedef union EOBJt EOBJ;
///
//@Memo: Underlying data maintined by.
/**
The underlying \Ref{EVENTt} object data: A semophore count,
message pointer, or a pointer to a queue object.
*/
union EOBJt{
/// Semaphore count.
int sem;
/// Message pointer.
void *msg;
/// Pointer to \Ref{Qt} structure.
pQ pq;
};
///
//@Memo: Task coordination event.
/**
A semaphore, message mailbox, or message queue.
*/
struct EVENTt {
/// Pointer to name string.
char *name;
/// Type: EVENT_SEM, EVENT_MSG, EVENT_Q.
BYTE type;
/// Priority queue of tasks waiting on this event.
BITPRIQ bitpriq_wait;
/// Underlying \Ref{EOBJt} data.
EOBJ e;
};
///
//@Memo: Circular FIFO queue of void *.
/**
Simple array of void* organized a circular FIFO.
*/
struct Qt {
/// Queue size available.
int siz;
/// Count of objects in the queue.
int cnt;
/// Insertion point.
void **in;
/// Extraction point.
void **out;
/// Pointer to zeroeth element.
void **bottom;
/// Pointer one past last element.
void **top;
};
//=============================================================================
//=Task states.================================================================
#define RDY 3
#define BLOCKED 1
//=============================================================================
//=Stack sizes for the core tasks in mlexec.c.=================================
#define main_SIZ 0x1800
#define TPrintf_SIZ 0x1800
#define TIdle_SIZ 0x0100
#define TMain_SIZ 0x0300
//=============================================================================
//