subst.h 1.61 KB
/*
 * 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_ */