Updated PCI IDs to latest snapshot.
[tangerine.git] / compiler / clib / __arosc_privdata.h
blob154436a4ac1074b2a37772f110c0e7f6bd35b7ae
1 #ifndef ___AROSC_PRIVDATA_H
2 #define ___AROSC_PRIVDATA_H
4 #include <exec/semaphores.h>
5 #include <devices/timer.h>
6 #include <proto/timer.h>
7 #include <dos/dos.h>
9 #include <sys/types.h>
10 #include <sys/arosc.h>
12 #include "etask.h"
13 #include "__vfork.h"
15 struct _fdesc;
16 struct __env_item;
18 struct arosc_privdata
20 /* All stuff visible by the user */
21 struct arosc_userdata acpd_acud;
23 /* arosc_userdata can grow as much as it wishes,
24 as long as all new fields are added at the end of it.
26 arosc_privdata can also grow at please, but it has no restrictions
27 on the way things are modified in it, as long as arosc_userdata
28 is always kept at its beginning. */
30 /* Keep in here the pointer to the already existing arosc_privdata
31 structure.
33 This is a structure which gets allocated on a per-process basis,
34 however CLI programs are invoked as sort of subroutines of the CLI
35 process, although they must behave as if they were the only ones
36 having possession of their Process structure. Hence, this field
37 is used to save/restore the data of the previous CLI process. */
38 struct arosc_privdata *acpd_oldprivdata;
40 /* malloc.c */
41 APTR acpd_startup_mempool;
42 struct SignalSemaphore acpd_startup_memsem;
44 /* __env.c */
45 struct __env_item *acpd_env_list;
47 /* __stdio.c */
48 struct MinList acpd_stdio_files;
50 /* clock.c */
51 struct DateStamp acpd_startup_datestamp;
53 /* __open.c */
54 APTR acpd_fd_mempool;
55 int acpd_numslots;
56 struct _fdesc **acpd_fd_array;
58 /* atexit.c */
59 struct MinList acpd_atexit_list;
61 /* umask.c */
62 mode_t acpd_umask;
64 /* Used by chdir() */
65 int acpd_startup_cd_changed;
66 BPTR acpd_startup_cd_lock;
68 /* gettimeofday */
69 struct timerequest acpd_timereq;
70 struct MsgPort acpd_timeport;
71 struct Device *acpd_TimerBase;
73 /* __arosc_usedata */
74 APTR acpd_process_returnaddr;
75 ULONG acpd_usercount;
77 /* __upath */
78 char *acpd_apathbuf; /* Buffer that holds the AROS path converted from the
79 equivalent *nix path. */
80 int acpd_doupath; /* BOOL - does the conversion need to be done? */
82 /* spawn* */
83 char *acpd_joined_args;
84 int acpd_flags;
86 /* strerror */
87 char acpd_fault_buf[100];
89 /* __arosc_nixmain */
90 int acpd_parent_does_upath;
92 /* flock.c */
93 struct MinList acpd_file_locks;
95 /* __vfork.c */
96 struct vfork_data *acpd_vfork_data;
98 /* __exec.c */
99 BPTR acpd_exec_seglist;
100 char *acpd_exec_args;
101 char *acpd_exec_taskname;
102 char **acpd_exec_tmparray;
103 BPTR acpd_exec_oldin, acpd_exec_oldout, acpd_exec_olderr;
104 struct Library *acpd_exec_aroscbase;
107 /* acpd_flags */
109 /* By default arosc.library keeps the old arosc_privdata if it's opened another
110 time in the same process. Setting this flag forces it to create new
111 arosc_privdata. */
112 #define CREATE_NEW_ACPD 1
114 /* Programs compiled with -nix flag are cloning dos.library environment
115 variables before execution and restoring them during exit. Cloning
116 prevents clobbering the process environment variables by another program
117 ran with RunCommand() or similar means. Setting this flag disables
118 environment cloning. */
119 #define DO_NOT_CLONE_ENV_VARS 2
121 /* This flag is set by vfork() to correctly report child process ID during
122 execution of child code, even though that it's actually executed by parent
123 process until execve() is called. */
124 #define PRETEND_CHILD 4
126 /* By default arosc.library creates new arosc_privdata when opened if
127 pr_ReturnAddr has changed (for example during RunCommand()). Setting
128 this flag prevents creation of new arosc_privdata. */
129 #define KEEP_OLD_ACPD 8
131 /* By default a new process will get new ACPD when it(or any other library
132 it uses) opens arosc.library. This flag prohibits that and forces the
133 child process to share ACPD with parent process */
134 #define SHARE_ACPD_WITH_CHILD 16
136 /* !acpd_flags */
138 #define __get_arosc_privdata() ((struct arosc_privdata *)__get_arosc_userdata())
140 #define __oldprivdata (__get_arosc_privdata()->acpd_oldprivdata)
141 #define __env_list (__get_arosc_privdata()->acpd_env_list)
142 #define __stdio_files (__get_arosc_privdata()->acpd_stdio_files)
143 #define __numslots (__get_arosc_privdata()->acpd_numslots)
144 #define __fd_mempool (__get_arosc_privdata()->acpd_fd_mempool)
145 #define __fd_array (__get_arosc_privdata()->acpd_fd_array)
146 #define __startup_memsem (__get_arosc_privdata()->acpd_startup_memsem)
147 #define __startup_mempool (__get_arosc_privdata()->acpd_startup_mempool)
148 #define __startup_datestamp (__get_arosc_privdata()->acpd_startup_datestamp)
149 #define __atexit_list (__get_arosc_privdata()->acpd_atexit_list)
150 #define __umask (__get_arosc_privdata()->acpd_umask)
151 #define __startup_cd_changed (__get_arosc_privdata()->acpd_startup_cd_changed)
152 #define __startup_cd_lock (__get_arosc_privdata()->acpd_startup_cd_lock)
153 #define __timereq (__get_arosc_privdata()->acpd_timereq)
154 #define __timeport (__get_arosc_privdata()->acpd_timeport)
155 #define TimerBase (__get_arosc_privdata()->acpd_TimerBase)
156 #define __apathbuf (__get_arosc_privdata()->acpd_apathbuf)
157 #define __doupath (__get_arosc_privdata()->acpd_doupath)
158 #define __flocks_list (__get_arosc_privdata()->acpd_file_locks)
160 #define __aros_startup ((struct aros_startup *)GetIntETask(FindTask(NULL))->iet_startup)
161 #define __aros_startup_jmp_buf (__aros_startup->as_startup_jmp_buf)
162 #define __aros_startup_error (__aros_startup->as_startup_error)
164 #endif /* !___AROSC_PRIVDATA_H */