/*
 *	Type definitions for C scheduler and occam support
 *	Version for MIPS.  Copyright (C) 2002 Fred Barnes
 *	Copyright (C) 1998 Jim Moores
 *	Modifications (C) 1999-2002 Fred Barnes <frmb2@ukc.ac.uk>
 *
 *	This program is free software; you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation; either version 2 of the License, or
 *	(at your option) any later version.
 *
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License
 *	along with this program; if not, write to the Free Software
 *	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#ifndef SCHED_TYPES_H
#define SCHED_TYPES_H

#include <ukcthreads_types.h>

struct _sepflags {
	#if defined(BLOCKING_SYSCALLS)
		byte block_sync;		/* set when a blocking sys-call goes off */
	#else
		byte kbd_sync;			/* set when the keyboard goes off */
	#endif
	#if defined(PROCESS_PRIORITY)
		byte priority_sync;		/* set when a higher-priority process is known to be waiting */
	#else
		byte dummy0;
	#endif
	byte tim_sync;				/* set when a timer expires */
	#if defined(OOS_BUILD)
		byte interrupt_sync;		/* for OOS, set when an interrupt occurs */
	#else
		byte dummy2;
	#endif
};

typedef struct _sepflags sepflags;

/* hopefully MIPS won't go batty, we should be aligned.. */

typedef struct _sync_type {
	union {
		word combined_sync;
		sepflags s;
	} u;
	word *ptr;		/* used for Tptr */
} __attribute__ ((packed)) sync_type;

#endif
