-
Notifications
You must be signed in to change notification settings - Fork 0
/
proc.h
47 lines (40 loc) · 1.06 KB
/
proc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* Copyright (c) 2000 by Tsuyoshi Ishii. All rights reserved. ---------------*/
#ifndef _PROC_H
#define _PROC_H
/* proc ---------------------------------------------------------------------*/
typedef struct proc {
unsigned long stack; /* pints to stack */
unsigned long reg[256]; /* register pool */
#if 0
unsigned long eip; /* program counter */
unsigned long stack; /* stack pointer */
#endif
int flag;
int id; /* equal to task id */
} proc_t;
/* register offset ----------------------------------------------------------*/
#define ECX 0
#define EDX 1
#define ESP 2
#define EIP 3
#define EBP 4
#define ESI 5
#define EDI 6
#define EFLAGS 7
#define EAX 8
#define EBX 9
#define DS 10
#define ES 11
#define SAV_EFLAGS 12
#define FLAG_USE 1
#define FLAG_NON 0
/* function declarations ----------------------------------------------------*/
void proc_init();
proc_t* proc_create(ID, T_CTSK*);
ER proc_set_tsk_arg(ID, VP_INT);
ER proc_delete(ID);
void proc_eflags_save(ID);
void proc_eflags_restore(ID);
void proc_switch();
extern proc_t* current_proc[];
#endif