/* File "osc_sched.h" copyright (c) 2001 by Collin Lally of Polytech Industries. This software is covered by the GNU General Public License. It is free to the public, and may be modified and/or redistributed at will, as long as all end-products remain under the GPL and are free to the public. */

#define PID_TELNET 10 /* Not real Telnet */
#define PID_KBD_DRIVER 1
#define PID_KERNEL 0 /* Note: the kernel processes cannot be interrupted for any reason */
#define MAX_P_NUM 25

int process_stack[MAX_P_NUM][8192];
typedef int jbuf;
typedef int address_t;
typedef int stack_ptr_t;

struct pid{
	int pid;
	char p_name;
	int p_id_num;
	int priority;
	int previous_task;
	int next_task;
} *pid_struct[50];

struct stack{
	address_t *address_space[25][4];
} *add_space_s;

struct jmp_buf{
	jbuf jmp_stack_buf;
	jbuf jmp_pid_buf;
} *jmp_buf;

extern int *stack_ptr;
extern int set_stack_ptr(int pid_num);
extern int set_p_stack_ptr(int *pid_num, int *priority_num);
typedef char p_type_t;
extern void set_pid(int *pid, p_type_t *p_type);
extern void get_pid(char *process);
extern inline void long_jmp(int address, int *pid_num, int *priority_num);
extern inline void set_jmp();
extern void sys_call(int *call_num, int *pid);
extern void create_process(address_t *ad_space, p_type_t *p_type, stack_ptr_t *stackp_ptr, int pid, int *priority, int *exec_ptr);