. introduced DEV_READ_S, DEV_WRITE_S, DEV_SCATTER_S, DEV_GATHER_S

and DEV_IOCTL_S as replacements for DEV_READ, DEV_WRITE, DEV_SCATTER,
  DEV_GATHER and DEV_IOCTL. Instead of a direct address, the *_S commands
  pass 'grant ids' to the drivers which are referenced through a new set
  of copy calls (sys_safecopyfrom and sys_safecopyto). in order for this
  copy to succeed, the grant must have previously been created in the
  address space of the granter.
. bitmap manipulation functions moved to <minix/bitmap.h>
. HIGHPOS introduced as field containing high 32 bits of position in
  device I/O message; TTY_FLAGS no longer used
. IO_GRANT field introduced for GRANTs, to replace ADDRESS
. REP_IO_GRANT field for un-SUSPEND messages introduced to indicate
  grant for which I/O was done to disambiguate messages
. SYS_SAFECOPYFROM and SYS_SAFECOPYTO introduced as new calls
. SYS_PRIV_SET_GRANTS code introduced as a code to set the address and
  size of the grant table in a process' own address space
. 'type' and 'direction' field of _ins* and _outs* I/O functions
  are merged into one by ORing _DIO_INPUT/_DIO_OUTPUT and _DIO_BYTE/_DIO_WORD
  etc. This allows for an additional parameter, _DIO_SAFE, which indicates
  the address in another address space isn't actually an address, but
  a grant id. Also needs an offset, for which fields had to be merged.
. SCP_* are field names for SYS_SAFECOPY* functions
. DIAGNOSTICS and GET_KMESS moved to their own range above DIAG_BASE,
  added DIAGNOSTICS_S which is a grant-based variant of DIAGNOSTICS
. removed obsolete BINCOMPAT and SRCCOMPAT options
. added GRANT_SEG type for use in vircopy - allows copying to a grant
  id (without offset)
. added _MINIX_IOCTL_* macros that decode information encoded by
  _IO* macros in ioctl codes, used to check which grants are necessary
  for an ioctl
. introduced the type endpoint_t for process endpoints, changed some
  prototypes and struct field types to match
. renamed protected to prot for g++
This commit is contained in:
Ben Gras
2006-06-20 08:38:15 +00:00
parent 6ef5aa4fb2
commit aaca17c36d
8 changed files with 125 additions and 57 deletions
+47 -33
View File
@@ -15,6 +15,8 @@
#include <minix/devio.h>
#endif
#include <minix/safecopies.h>
/* Forward declaration */
struct reg86u;
@@ -26,37 +28,41 @@ struct reg86u;
_PROTOTYPE( int _taskcall, (int who, int syscallnr, message *msgptr));
_PROTOTYPE( int sys_abort, (int how, ...));
_PROTOTYPE( int sys_enable_iop, (int proc));
_PROTOTYPE( int sys_exec, (int proc, char *ptr,
_PROTOTYPE( int sys_enable_iop, (endpoint_t proc));
_PROTOTYPE( int sys_exec, (endpoint_t proc, char *ptr,
char *aout, vir_bytes initpc));
_PROTOTYPE( int sys_fork, (int parent, int child, int *, struct mem_map *ptr));
_PROTOTYPE( int sys_newmap, (int proc, struct mem_map *ptr));
_PROTOTYPE( int sys_exit, (int proc));
_PROTOTYPE( int sys_trace, (int req, int proc, long addr, long *data_p));
_PROTOTYPE( int sys_newmap, (endpoint_t proc, struct mem_map *ptr));
_PROTOTYPE( int sys_exit, (endpoint_t proc));
_PROTOTYPE( int sys_trace, (int req, endpoint_t proc, long addr, long *data_p));
_PROTOTYPE( int sys_privctl, (int proc, int req, int i, void *p));
_PROTOTYPE( int sys_nice, (int proc, int priority));
_PROTOTYPE( int sys_privctl, (endpoint_t proc, int req, int i, void *p));
_PROTOTYPE( int sys_nice, (endpoint_t proc, int priority));
_PROTOTYPE( int sys_int86, (struct reg86u *reg86p));
_PROTOTYPE( int sys_vm_setbuf, (phys_bytes base, phys_bytes size,
phys_bytes high));
_PROTOTYPE( int sys_vm_map, (int proc_nr, int do_map,
_PROTOTYPE( int sys_vm_map, (endpoint_t proc_nr, int do_map,
phys_bytes base, phys_bytes size, phys_bytes offset));
/* Shorthands for sys_sdevio() system call. */
#define sys_insb(port, proc_nr, buffer, count) \
sys_sdevio(DIO_INPUT, port, DIO_BYTE, proc_nr, buffer, count)
sys_sdevio(DIO_INPUT_BYTE, port, proc_nr, buffer, count, 0)
#define sys_insw(port, proc_nr, buffer, count) \
sys_sdevio(DIO_INPUT, port, DIO_WORD, proc_nr, buffer, count)
sys_sdevio(DIO_INPUT_WORD, port, proc_nr, buffer, count, 0)
#define sys_outsb(port, proc_nr, buffer, count) \
sys_sdevio(DIO_OUTPUT, port, DIO_BYTE, proc_nr, buffer, count)
sys_sdevio(DIO_OUTPUT_BYTE, port, proc_nr, buffer, count, 0)
#define sys_outsw(port, proc_nr, buffer, count) \
sys_sdevio(DIO_OUTPUT, port, DIO_WORD, proc_nr, buffer, count)
_PROTOTYPE( int sys_sdevio, (int req, long port, int type, int proc_nr,
void *buffer, int count));
sys_sdevio(DIO_OUTPUT_WORD, port, proc_nr, buffer, count, 0)
#define sys_safe_insw(port, ept, grant, offset, count) \
sys_sdevio(DIO_SAFE_INPUT_WORD, port, ept, (void*)grant, count, offset)
#define sys_safe_outsw(port, ept, grant, offset, count) \
sys_sdevio(DIO_SAFE_OUTPUT_WORD, port, ept, (void*)grant, count, offset)
_PROTOTYPE( int sys_sdevio, (int req, long port, endpoint_t proc_nr,
void *buffer, int count, vir_bytes offset));
/* Clock functionality: get system times or (un)schedule an alarm call. */
_PROTOTYPE( int sys_times, (int proc_nr, clock_t *ptr));
_PROTOTYPE( int sys_times, (endpoint_t proc_nr, clock_t *ptr));
_PROTOTYPE(int sys_setalarm, (clock_t exp_time, int abs_time));
/* Shorthands for sys_irqctl() system call. */
@@ -82,23 +88,31 @@ _PROTOTYPE ( int sys_irqctl, (int request, int irq_vec, int policy,
sys_vircopy(src_proc, T, src_vir, dst_proc, T, dst_vir, bytes)
#define sys_stackcopy(src_proc, src_vir, dst_proc, dst_vir, bytes) \
sys_vircopy(src_proc, S, src_vir, dst_proc, S, dst_vir, bytes)
_PROTOTYPE(int sys_vircopy, (int src_proc, int src_seg, vir_bytes src_vir,
int dst_proc, int dst_seg, vir_bytes dst_vir, phys_bytes bytes));
_PROTOTYPE(int sys_vircopy, (endpoint_t src_proc, int src_s, vir_bytes src_v,
endpoint_t dst_proc, int dst_seg, vir_bytes dst_vir, phys_bytes bytes));
#define sys_abscopy(src_phys, dst_phys, bytes) \
sys_physcopy(NONE, PHYS_SEG, src_phys, NONE, PHYS_SEG, dst_phys, bytes)
_PROTOTYPE(int sys_physcopy, (int src_proc, int src_seg, vir_bytes src_vir,
int dst_proc, int dst_seg, vir_bytes dst_vir, phys_bytes bytes));
_PROTOTYPE(int sys_physcopy, (endpoint_t src_proc, int src_seg, vir_bytes src_vir,
endpoint_t dst_proc, int dst_seg, vir_bytes dst_vir, phys_bytes bytes));
_PROTOTYPE(int sys_safecopyfrom, (endpoint_t, cp_grant_id_t,
vir_bytes, vir_bytes, size_t, int));
_PROTOTYPE(int sys_safecopyto, (endpoint_t, cp_grant_id_t,
vir_bytes, vir_bytes, size_t, int));
_PROTOTYPE(int sys_memset, (unsigned long pattern,
phys_bytes base, phys_bytes bytes));
/* Vectored virtual / physical copy calls. */
#if DEAD_CODE /* library part not yet implemented */
_PROTOTYPE(int sys_virvcopy, (phys_cp_req *vec_ptr,int vec_size,int *nr_ok));
_PROTOTYPE(int sys_physvcopy, (phys_cp_req *vec_ptr,int vec_size,int *nr_ok));
#endif
_PROTOTYPE(int sys_umap, (int proc_nr, int seg, vir_bytes vir_addr,
_PROTOTYPE(int sys_umap, (endpoint_t proc_nr, int seg, vir_bytes vir_addr,
vir_bytes bytes, phys_bytes *phys_addr));
_PROTOTYPE(int sys_segctl, (int *index, u16_t *seg, vir_bytes *off,
phys_bytes phys, vir_bytes size));
@@ -118,17 +132,17 @@ _PROTOTYPE(int sys_segctl, (int *index, u16_t *seg, vir_bytes *off,
#define sys_getmonparams(v,vl) sys_getinfo(GET_MONPARAMS, v,vl, 0,0)
#define sys_getschedinfo(v1,v2) sys_getinfo(GET_SCHEDINFO, v1,0, v2,0)
#define sys_getlocktimings(dst) sys_getinfo(GET_LOCKTIMING, dst, 0,0,0)
#define sys_getbiosbuffer(virp, sizep) sys_getinfo(GET_BIOSBUFFER, virp, \
sizeof(*virp), sizep, sizeof(*sizep))
#define sys_getbiosbuffer(virp, sizep) \
sys_getinfo(GET_BIOSBUFFER, virp, sizeof(*virp), sizep, sizeof(*sizep))
_PROTOTYPE(int sys_getinfo, (int request, void *val_ptr, int val_len,
void *val_ptr2, int val_len2) );
/* Signal control. */
_PROTOTYPE(int sys_kill, (int proc, int sig) );
_PROTOTYPE(int sys_sigsend, (int proc_nr, struct sigmsg *sig_ctxt) );
_PROTOTYPE(int sys_sigreturn, (int proc_nr, struct sigmsg *sig_ctxt) );
_PROTOTYPE(int sys_getksig, (int *k_proc_nr, sigset_t *k_sig_map) );
_PROTOTYPE(int sys_endksig, (int proc_nr) );
_PROTOTYPE(int sys_kill, (endpoint_t proc, int sig) );
_PROTOTYPE(int sys_sigsend, (endpoint_t proc_nr, struct sigmsg *sig_ctxt) );
_PROTOTYPE(int sys_sigreturn, (endpoint_t proc_nr, struct sigmsg *sig_ctxt) );
_PROTOTYPE(int sys_getksig, (endpoint_t *k_proc_nr, sigset_t *k_sig_map) );
_PROTOTYPE(int sys_endksig, (endpoint_t proc_nr) );
/* NOTE: two different approaches were used to distinguish the device I/O
* types 'byte', 'word', 'long': the latter uses #define and results in a
@@ -142,15 +156,15 @@ _PROTOTYPE(int sys_vinw, (pvw_pair_t *pvw_pairs, int nr_ports) );
_PROTOTYPE(int sys_vinl, (pvl_pair_t *pvl_pairs, int nr_ports) );
/* Shorthands for sys_out() system call. */
#define sys_outb(p,v) sys_out((p), (unsigned long) (v), DIO_BYTE)
#define sys_outw(p,v) sys_out((p), (unsigned long) (v), DIO_WORD)
#define sys_outl(p,v) sys_out((p), (unsigned long) (v), DIO_LONG)
#define sys_outb(p,v) sys_out((p), (unsigned long) (v), _DIO_BYTE)
#define sys_outw(p,v) sys_out((p), (unsigned long) (v), _DIO_WORD)
#define sys_outl(p,v) sys_out((p), (unsigned long) (v), _DIO_LONG)
_PROTOTYPE(int sys_out, (int port, unsigned long value, int type) );
/* Shorthands for sys_in() system call. */
#define sys_inb(p,v) sys_in((p), (v), DIO_BYTE)
#define sys_inw(p,v) sys_in((p), (v), DIO_WORD)
#define sys_inl(p,v) sys_in((p), (v), DIO_LONG)
#define sys_inb(p,v) sys_in((p), (v), _DIO_BYTE)
#define sys_inw(p,v) sys_in((p), (v), _DIO_WORD)
#define sys_inl(p,v) sys_in((p), (v), _DIO_LONG)
_PROTOTYPE(int sys_in, (int port, unsigned long *value, int type) );
/* pci.c */