subst.h
1.61 KB
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
48
49
50
51
52
53
54
55
/*
* Copyright (C) 1998 by the Board of Trustees
* of Leland Stanford Junior University.
* Copyright (C) 1998 Digital Equipment Corporation
*
* This file is part of the SimOS distribution.
* See LICENSE file for terms of the license.
*
*/
#ifndef _SUBST_H_
#define _SUBST_H_
/* To substitute real system calls with AINT equivalents */
void subst_init ();
typedef enum {SYSCALL_EXIT, SYSCALL_NEXT, SYSCALL_SAME} SyscallStatus;
typedef SyscallStatus (*syscall_substitute)(thread_ptr);
extern SyscallStatus callsys_f ( thread_ptr);
extern SyscallStatus aint_ioctl ( thread_ptr);
extern SyscallStatus aint_close ( thread_ptr);
extern SyscallStatus aint_write ( thread_ptr);
extern SyscallStatus aint_read ( thread_ptr);
extern SyscallStatus aint_lseek ( thread_ptr);
extern SyscallStatus aint_exit ( thread_ptr);
extern SyscallStatus aint_fork ( thread_ptr);
extern SyscallStatus aint_open ( thread_ptr);
extern SyscallStatus aint_stat ( thread_ptr);
extern SyscallStatus aint_fstat ( thread_ptr);
extern SyscallStatus aint_brk ( thread_ptr);
extern SyscallStatus aint_getpagesize ( thread_ptr);
extern SyscallStatus aint_gettimeofday ( thread_ptr);
extern SyscallStatus aint_wait4 ( thread_ptr);
extern SyscallStatus aint_getdtablesize ( thread_ptr);
extern SyscallStatus aint_getrusage ( thread_ptr);
extern SyscallStatus aint_getpid ( thread_ptr);
extern SyscallStatus aint_execve( thread_ptr pthread);
extern void subst_init (void);
#define MAX_PATH 100
#define MAX_EXECUTABLES 10
#define MAX_ARGV 100
#define MAX_ENV 200
#define ARG1_REG 16
#define ARG2_REG 17
#define ARG3_REG 18
#define ARG4_REG 19
#endif /* _SUBST_H_ */