/*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is legOS code, released October 17, 1999.
*
* The Initial Developer of the Original Code is Markus L. Noga.
* Portions created by Markus L. Noga are Copyright (C) 1999
* Markus L. Noga. All Rights Reserved.
*
* Contributor(s): Markus L. Noga <markus@noga.de>
* Lou Sortman <lou (at) sunsite (dot) unc (dot) edu>
*/
#ifndef __tm_h__
#define __tm_h__
#include <mem.h>
//
// Definitions
//
typedef unsigned char pstate_t;
typedef unsigned char priority_t;
#define PRIO_LOWEST 1
#define PRIO_NORMAL 10
#define PRIO_HIGHEST 20
typedef unsigned long wakeup_t;
//
// process states
//
#define P_DEAD 0
#define P_ZOMBIE 1
#define P_WAITING 2
#define P_SLEEPING 3
#define P_RUNNING 4
#define DEFAULT_STACK_SIZE 512
/* priority chain data structure
*/
struct _pchain_t {
priority_t priority;
struct _pchain_t *next;
struct _pchain_t *prev;
struct _pdata_t *cpid;
};
typedef struct _pchain_t pchain_t;
/*
*/
struct _pdata_t {
size_t *sp_save;
pstate_t pstate;
pchain_t *priority;
struct _pdata_t *next;
struct _pdata_t *prev;
struct _pdata_t *parent;
size_t *stack_base;
wakeup_t(*wakeup) (wakeup_t);
wakeup_t wakeup_data;
};
typedef struct _pdata_t pdata_t;
typedef size_t pid_t;
#endif
legOS-0.2.4 is released under the