
o Support for ptrace T_ATTACH/T_DETACH and T_SYSCALL o PM signal handling logic should now work properly, even with debuggers being present o Asynchronous PM/VFS protocol, full IPC support for senda(), and AMF_NOREPLY senda() flag DETAILS Process stop and delay call handling of PM: o Added sys_runctl() kernel call with sys_stop() and sys_resume() aliases, for PM to stop and resume a process o Added exception for sending/syscall-traced processes to sys_runctl(), and matching SIGKREADY pseudo-signal to PM o Fixed PM signal logic to deal with requests from a process after stopping it (so-called "delay calls"), using the SIGKREADY facility o Fixed various PM panics due to race conditions with delay calls versus VFS calls o Removed special PRIO_STOP priority value o Added SYS_LOCK RTS kernel flag, to stop an individual process from running while modifying its process structure Signal and debugger handling in PM: o Fixed debugger signals being dropped if a second signal arrives when the debugger has not retrieved the first one o Fixed debugger signals being sent to the debugger more than once o Fixed debugger signals unpausing process in VFS; removed PM_UNPAUSE_TR protocol message o Detached debugger signals from general signal logic and from being blocked on VFS calls, meaning that even VFS can now be traced o Fixed debugger being unable to receive more than one pending signal in one process stop o Fixed signal delivery being delayed needlessly when multiple signals are pending o Fixed wait test for tracer, which was returning for children that were not waited for o Removed second parallel pending call from PM to VFS for any process o Fixed process becoming runnable between exec() and debugger trap o Added support for notifying the debugger before the parent when a debugged child exits o Fixed debugger death causing child to remain stopped forever o Fixed consistently incorrect use of _NSIG Extensions to ptrace(): o Added T_ATTACH and T_DETACH ptrace request, to attach and detach a debugger to and from a process o Added T_SYSCALL ptrace request, to trace system calls o Added T_SETOPT ptrace request, to set trace options o Added TO_TRACEFORK trace option, to attach automatically to children of a traced process o Added TO_ALTEXEC trace option, to send SIGSTOP instead of SIGTRAP upon a successful exec() of the tracee o Extended T_GETUSER ptrace support to allow retrieving a process's priv structure o Removed T_STOP ptrace request again, as it does not help implementing debuggers properly o Added MINIX3-specific ptrace test (test42) o Added proper manual page for ptrace(2) Asynchronous PM/VFS interface: o Fixed asynchronous messages not being checked when receive() is called with an endpoint other than ANY o Added AMF_NOREPLY senda() flag, preventing such messages from satisfying the receive part of a sendrec() o Added asynsend3() that takes optional flags; asynsend() is now a #define passing in 0 as third parameter o Made PM/VFS protocol asynchronous; reintroduced tell_fs() o Made PM_BASE request/reply number range unique o Hacked in a horrible temporary workaround into RS to deal with newly revealed RS-PM-VFS race condition triangle until VFS is asynchronous System signal handling: o Fixed shutdown logic of device drivers; removed old SIGKSTOP signal o Removed is-superuser check from PM's do_procstat() (aka getsigset()) o Added sigset macros to allow system processes to deal with the full signal set, rather than just the POSIX subset Miscellaneous PM fixes: o Split do_getset into do_get and do_set, merging common code and making structure clearer o Fixed setpriority() being able to put to sleep processes using an invalid parameter, or revive zombie processes o Made find_proc() global; removed obsolete proc_from_pid() o Cleanup here and there Also included: o Fixed false-positive boot order kernel warning o Removed last traces of old NOTIFY_FROM code THINGS OF POSSIBLE INTEREST o It should now be possible to run PM at any priority, even lower than user processes o No assumptions are made about communication speed between PM and VFS, although communication must be FIFO o A debugger will now receive incoming debuggee signals at kill time only; the process may not yet be fully stopped o A first step has been made towards making the SYSTEM task preemptible
180 lines
8.2 KiB
C
Executable File
180 lines
8.2 KiB
C
Executable File
/* Function prototypes. */
|
|
|
|
#ifndef PROTO_H
|
|
#define PROTO_H
|
|
|
|
#include <minix/safecopies.h>
|
|
#include <archtypes.h>
|
|
#include <a.out.h>
|
|
|
|
/* Struct declarations. */
|
|
struct proc;
|
|
struct timer;
|
|
|
|
/* clock.c */
|
|
_PROTOTYPE( void clock_task, (void) );
|
|
_PROTOTYPE( clock_t get_uptime, (void) );
|
|
_PROTOTYPE( void set_timer, (struct timer *tp, clock_t t, tmr_func_t f) );
|
|
_PROTOTYPE( void reset_timer, (struct timer *tp) );
|
|
_PROTOTYPE( void ser_dump_proc, (void) );
|
|
|
|
/* main.c */
|
|
_PROTOTYPE( void main, (void) );
|
|
_PROTOTYPE( void prepare_shutdown, (int how) );
|
|
_PROTOTYPE( void minix_shutdown, (struct timer *tp) );
|
|
_PROTOTYPE( void idle_task, (void) );
|
|
|
|
/* utility.c */
|
|
_PROTOTYPE( int kprintf, (const char *fmt, ...) );
|
|
_PROTOTYPE( void minix_panic, (char *s, int n) );
|
|
|
|
/* proc.c */
|
|
_PROTOTYPE( int sys_call, (int call_nr, int src_dst,
|
|
message *m_ptr, long bit_map) );
|
|
_PROTOTYPE( void sys_call_restart, (struct proc *caller) );
|
|
_PROTOTYPE( int lock_notify, (int src, int dst) );
|
|
_PROTOTYPE( int mini_notify, (struct proc *src, endpoint_t dst) );
|
|
_PROTOTYPE( int lock_send, (int dst, message *m_ptr) );
|
|
_PROTOTYPE( void enqueue, (struct proc *rp) );
|
|
_PROTOTYPE( void dequeue, (struct proc *rp) );
|
|
_PROTOTYPE( void balance_queues, (struct timer *tp) );
|
|
_PROTOTYPE( void schedcheck, (void) );
|
|
_PROTOTYPE( struct proc *endpoint_lookup, (endpoint_t ep) );
|
|
#if DEBUG_ENABLE_IPC_WARNINGS
|
|
_PROTOTYPE( int isokendpt_f, (char *file, int line, endpoint_t e, int *p, int f));
|
|
#define isokendpt_d(e, p, f) isokendpt_f(__FILE__, __LINE__, (e), (p), (f))
|
|
#else
|
|
_PROTOTYPE( int isokendpt_f, (endpoint_t e, int *p, int f) );
|
|
#define isokendpt_d(e, p, f) isokendpt_f((e), (p), (f))
|
|
#endif
|
|
|
|
/* start.c */
|
|
_PROTOTYPE( void cstart, (U16_t cs, U16_t ds, U16_t mds,
|
|
U16_t parmoff, U16_t parmsize) );
|
|
|
|
/* system.c */
|
|
_PROTOTYPE( int get_priv, (register struct proc *rc, int proc_type) );
|
|
_PROTOTYPE( void set_sendto_bit, (struct proc *rc, int id) );
|
|
_PROTOTYPE( void unset_sendto_bit, (struct proc *rc, int id) );
|
|
_PROTOTYPE( void send_sig, (int proc_nr, int sig_nr) );
|
|
_PROTOTYPE( void cause_sig, (int proc_nr, int sig_nr) );
|
|
_PROTOTYPE( void sig_delay_done, (struct proc *rp) );
|
|
_PROTOTYPE( void sys_task, (void) );
|
|
#define numap_local(proc_nr, vir_addr, bytes) \
|
|
umap_local(proc_addr(proc_nr), D, (vir_addr), (bytes))
|
|
_PROTOTYPE( phys_bytes umap_grant, (struct proc *, cp_grant_id_t,
|
|
vir_bytes));
|
|
_PROTOTYPE( vir_bytes vir_verify_grant, (struct proc *, endpoint_t,
|
|
cp_grant_id_t, vir_bytes, vir_bytes, int, endpoint_t *));
|
|
_PROTOTYPE( void clear_endpoint, (struct proc *rc) );
|
|
_PROTOTYPE( phys_bytes umap_bios, (vir_bytes vir_addr, vir_bytes bytes));
|
|
_PROTOTYPE( phys_bytes umap_verify_grant, (struct proc *rp, endpoint_t grantee, cp_grant_id_t grant, vir_bytes offset, vir_bytes bytes, int access));
|
|
|
|
/* system/do_newmap.c */
|
|
_PROTOTYPE( int newmap, (struct proc *rp, struct mem_map *map_ptr) );
|
|
|
|
/* system/do_vtimer.c */
|
|
_PROTOTYPE( void vtimer_check, (struct proc *rp) );
|
|
|
|
/* interrupt.c */
|
|
_PROTOTYPE( void intr_handle, (irq_hook_t *hook) );
|
|
_PROTOTYPE( void put_irq_handler, (irq_hook_t *hook, int irq,
|
|
irq_handler_t handler) );
|
|
_PROTOTYPE( void rm_irq_handler, (irq_hook_t *hook) );
|
|
_PROTOTYPE( void enable_irq, (irq_hook_t *hook) );
|
|
_PROTOTYPE( int disable_irq, (irq_hook_t *hook) );
|
|
_PROTOTYPE( void cons_setc, (int pos, int c) );
|
|
_PROTOTYPE( void cons_seth, (int pos, int n) );
|
|
|
|
/* debug.c */
|
|
#if DEBUG_SCHED_CHECK
|
|
#define CHECK_RUNQUEUES check_runqueues_f(__FILE__, __LINE__)
|
|
_PROTOTYPE( void check_runqueues_f, (char *file, int line) );
|
|
#endif
|
|
_PROTOTYPE( char *rtsflagstr, (int flags) );
|
|
_PROTOTYPE( char *miscflagstr, (int flags) );
|
|
|
|
/* system/do_safecopy.c */
|
|
_PROTOTYPE( int verify_grant, (endpoint_t, endpoint_t, cp_grant_id_t, vir_bytes,
|
|
int, vir_bytes, vir_bytes *, endpoint_t *));
|
|
|
|
/* system/do_sysctl.c */
|
|
_PROTOTYPE( int do_sysctl, (message *m));
|
|
|
|
#if SPROFILE
|
|
/* profile.c */
|
|
_PROTOTYPE( void init_profile_clock, (u32_t) );
|
|
_PROTOTYPE( void stop_profile_clock, (void) );
|
|
#endif
|
|
|
|
/* functions defined in architecture-dependent files. */
|
|
_PROTOTYPE( phys_bytes phys_copy, (phys_bytes source, phys_bytes dest,
|
|
phys_bytes count) );
|
|
_PROTOTYPE( void phys_copy_fault, (void));
|
|
#define virtual_copy(src, dst, bytes) virtual_copy_f(src, dst, bytes, 0)
|
|
#define virtual_copy_vmcheck(src, dst, bytes) virtual_copy_f(src, dst, bytes, 1)
|
|
_PROTOTYPE( int virtual_copy_f, (struct vir_addr *src, struct vir_addr *dst,
|
|
vir_bytes bytes, int vmcheck) );
|
|
_PROTOTYPE( int data_copy, (endpoint_t from, vir_bytes from_addr,
|
|
endpoint_t to, vir_bytes to_addr, size_t bytes));
|
|
_PROTOTYPE( int data_copy_vmcheck, (endpoint_t from, vir_bytes from_addr,
|
|
endpoint_t to, vir_bytes to_addr, size_t bytes));
|
|
#define data_copy_to(d, p, v, n) data_copy(SYSTEM, (d), (p), (v), (n));
|
|
#define data_copy_from(d, p, v, n) data_copy((p), (v), SYSTEM, (d), (n));
|
|
_PROTOTYPE( void alloc_segments, (struct proc *rp) );
|
|
_PROTOTYPE( void vm_init, (struct proc *first) );
|
|
_PROTOTYPE( void vm_map_range, (u32_t base, u32_t size, u32_t offset) );
|
|
_PROTOTYPE( int vm_copy, (vir_bytes src, struct proc *srcproc,
|
|
vir_bytes dst, struct proc *dstproc, phys_bytes bytes));
|
|
_PROTOTYPE( phys_bytes umap_local, (register struct proc *rp, int seg,
|
|
vir_bytes vir_addr, vir_bytes bytes));
|
|
_PROTOTYPE( void cp_mess, (int src,phys_clicks src_clicks,
|
|
vir_bytes src_offset, phys_clicks dst_clicks, vir_bytes dst_offset));
|
|
_PROTOTYPE( phys_bytes umap_remote, (struct proc* rp, int seg,
|
|
vir_bytes vir_addr, vir_bytes bytes) );
|
|
_PROTOTYPE( phys_bytes umap_virtual, (struct proc* rp, int seg,
|
|
vir_bytes vir_addr, vir_bytes bytes) );
|
|
_PROTOTYPE( phys_bytes seg2phys, (U16_t) );
|
|
_PROTOTYPE( int vm_phys_memset, (phys_bytes source, u8_t pattern,
|
|
phys_bytes count) );
|
|
_PROTOTYPE( vir_bytes alloc_remote_segment, (u32_t *, segframe_t *,
|
|
int, phys_bytes, vir_bytes, int));
|
|
_PROTOTYPE( int arch_init_clock, (void) );
|
|
_PROTOTYPE( clock_t read_clock, (void) );
|
|
_PROTOTYPE( void clock_stop, (void) );
|
|
_PROTOTYPE( int intr_init, (int) );
|
|
_PROTOTYPE( int intr_disabled, (void) );
|
|
_PROTOTYPE( int intr_unmask, (irq_hook_t* hook) );
|
|
_PROTOTYPE( int intr_mask, (irq_hook_t* hook) );
|
|
_PROTOTYPE( void idle_task, (void) );
|
|
_PROTOTYPE( void arch_init, (void) );
|
|
_PROTOTYPE( void ser_putc, (char) );
|
|
_PROTOTYPE( void arch_shutdown, (int) );
|
|
_PROTOTYPE( void arch_get_aout_headers, (int i, struct exec *h) );
|
|
_PROTOTYPE( void restart, (void) );
|
|
_PROTOTYPE( void idle_task, (void) );
|
|
_PROTOTYPE( void read_tsc, (unsigned long *high, unsigned long *low) );
|
|
_PROTOTYPE( int arch_init_profile_clock, (u32_t freq) );
|
|
_PROTOTYPE( void arch_stop_profile_clock, (void) );
|
|
_PROTOTYPE( void arch_ack_profile_clock, (void) );
|
|
_PROTOTYPE( void do_ser_debug, (void) );
|
|
_PROTOTYPE( int arch_get_params, (char *parm, int max));
|
|
_PROTOTYPE( int arch_set_params, (char *parm, int max));
|
|
_PROTOTYPE( int arch_pre_exec, (struct proc *pr, u32_t, u32_t));
|
|
_PROTOTYPE( int arch_umap, (struct proc *pr, vir_bytes, vir_bytes,
|
|
int, phys_bytes *));
|
|
_PROTOTYPE( int arch_do_vmctl, (message *m_ptr, struct proc *p));
|
|
_PROTOTYPE( int vm_contiguous, (struct proc *targetproc, u32_t vir_buf, size_t count));
|
|
_PROTOTYPE( int vm_checkrange, (struct proc *caller, struct proc *target,
|
|
vir_bytes start, vir_bytes length, int writeflag, int checkonly));
|
|
_PROTOTYPE( void proc_stacktrace, (struct proc *proc) );
|
|
_PROTOTYPE( int vm_lookup, (struct proc *proc, vir_bytes virtual, vir_bytes *result, u32_t *ptent));
|
|
_PROTOTYPE( int vm_suspend, (struct proc *caller, struct proc *target,
|
|
phys_bytes lin, phys_bytes size, int wrflag, int type));
|
|
_PROTOTYPE( int delivermsg, (struct proc *target));
|
|
_PROTOTYPE( phys_bytes arch_switch_copymsg, (struct proc *rp, message *m,
|
|
phys_bytes lin));
|
|
_PROTOTYPE( void arch_do_syscall, (struct proc *proc) );
|
|
|
|
#endif /* PROTO_H */
|