. 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:
parent
6ef5aa4fb2
commit
aaca17c36d
8 changed files with 125 additions and 57 deletions
|
@ -8,4 +8,13 @@
|
|||
#define bit_empty(mask) ((mask) = 0)
|
||||
#define bit_fill(mask) ((mask) = ~0)
|
||||
|
||||
/* Definitions previously in kernel/const.h */
|
||||
#define BITCHUNK_BITS (sizeof(bitchunk_t) * CHAR_BIT)
|
||||
#define BITMAP_CHUNKS(nr_bits) (((nr_bits)+BITCHUNK_BITS-1)/BITCHUNK_BITS)
|
||||
#define MAP_CHUNK(map,bit) (map)[((bit)/BITCHUNK_BITS)]
|
||||
#define CHUNK_OFFSET(bit) ((bit)%BITCHUNK_BITS))
|
||||
#define GET_BIT(map,bit) ( MAP_CHUNK(map,bit) & (1 << CHUNK_OFFSET(bit) )
|
||||
#define SET_BIT(map,bit) ( MAP_CHUNK(map,bit) |= (1 << CHUNK_OFFSET(bit) )
|
||||
#define UNSET_BIT(map,bit) ( MAP_CHUNK(map,bit) &= ~(1 << CHUNK_OFFSET(bit) )
|
||||
|
||||
#endif /* _BITMAP_H */
|
||||
|
|
|
@ -145,6 +145,12 @@
|
|||
#define DEV_SELECT (DEV_RQ_BASE + 12) /* request select() attention */
|
||||
#define DEV_STATUS (DEV_RQ_BASE + 13) /* request driver status */
|
||||
|
||||
#define DEV_READ_S (DEV_RQ_BASE + 20) /* (safecopy) read from minor */
|
||||
#define DEV_WRITE_S (DEV_RQ_BASE + 21) /* (safecopy) write to minor */
|
||||
#define DEV_SCATTER_S (DEV_RQ_BASE + 22) /* (safecopy) write from a vector */
|
||||
#define DEV_GATHER_S (DEV_RQ_BASE + 23) /* (safecopy) read into a vector */
|
||||
#define DEV_IOCTL_S (DEV_RQ_BASE + 24) /* (safecopy) I/O control code */
|
||||
|
||||
#define DEV_REPLY (DEV_RS_BASE + 0) /* general task reply */
|
||||
#define DEV_CLONED (DEV_RS_BASE + 1) /* return cloned minor */
|
||||
#define DEV_REVIVE (DEV_RS_BASE + 2) /* driver revives process */
|
||||
|
@ -155,9 +161,11 @@
|
|||
#define DEVICE m2_i1 /* major-minor device */
|
||||
#define IO_ENDPT m2_i2 /* which (proc/endpoint) wants I/O? */
|
||||
#define COUNT m2_i3 /* how many bytes to transfer */
|
||||
#define REQUEST m2_i3 /* ioctl request code */
|
||||
#define POSITION m2_l1 /* file offset */
|
||||
#define REQUEST m2_i3 /* ioctl request code */
|
||||
#define POSITION m2_l1 /* file offset (low 4 bytes) */
|
||||
#define HIGHPOS m2_l2 /* file offset (high 4 bytes) */
|
||||
#define ADDRESS m2_p1 /* core buffer address */
|
||||
#define IO_GRANT m2_p1 /* grant id (for DEV_*_S variants) */
|
||||
|
||||
/* Field names for DEV_SELECT messages to device drivers. */
|
||||
#define DEV_MINOR m2_i1 /* minor device */
|
||||
|
@ -167,13 +175,13 @@
|
|||
/* Field names used in reply messages from tasks. */
|
||||
#define REP_ENDPT m2_i1 /* # of proc on whose behalf I/O was done */
|
||||
#define REP_STATUS m2_i2 /* bytes transferred or error number */
|
||||
#define REP_IO_GRANT m2_i3 /* DEV_REVIVE: grant by which I/O was done */
|
||||
# define SUSPEND -998 /* status to suspend caller, reply later */
|
||||
|
||||
/* Field names for messages to TTY driver. */
|
||||
#define TTY_LINE DEVICE /* message parameter: terminal line */
|
||||
#define TTY_REQUEST COUNT /* message parameter: ioctl request code */
|
||||
#define TTY_SPEK POSITION/* message parameter: ioctl speed, erasing */
|
||||
#define TTY_FLAGS m2_l2 /* message parameter: ioctl tty mode */
|
||||
#define TTY_PGRP m2_i3 /* message parameter: process group */
|
||||
|
||||
/* Field names for the QIC 02 status reply from tape driver */
|
||||
|
@ -278,8 +286,13 @@
|
|||
# define SYS_IOPENABLE (KERNEL_CALL + 28) /* sys_enable_iop() */
|
||||
# define SYS_VM_SETBUF (KERNEL_CALL + 29) /* sys_vm_setbuf() */
|
||||
# define SYS_VM_MAP (KERNEL_CALL + 30) /* sys_vm_map() */
|
||||
# define SYS_SAFECOPYFROM (KERNEL_CALL + 31) /* sys_safecopyfrom() */
|
||||
# define SYS_SAFECOPYTO (KERNEL_CALL + 32) /* sys_safecopyto() */
|
||||
|
||||
#define NR_SYS_CALLS 31 /* number of system calls */
|
||||
#define NR_SYS_CALLS 33 /* number of system calls */
|
||||
|
||||
/* Pseudo call for use in kernel/table.c. */
|
||||
#define SYS_ALL_CALLS (NR_SYS_CALLS)
|
||||
|
||||
/* Subfunctions for SYS_PRIVCTL */
|
||||
#define SYS_PRIV_INIT 1 /* Initialize a privilege structure */
|
||||
|
@ -287,6 +300,7 @@
|
|||
#define SYS_PRIV_ADD_MEM 3 /* Add memory range (struct mem_range)
|
||||
*/
|
||||
#define SYS_PRIV_ADD_IRQ 4 /* Add IRQ */
|
||||
#define SYS_PRIV_SET_GRANTS 5 /* Set grant table */
|
||||
|
||||
/* Field names for SYS_MEMSET, SYS_SEGCTL. */
|
||||
#define MEM_PTR m2_p1 /* base */
|
||||
|
@ -299,17 +313,29 @@
|
|||
|
||||
/* Field names for SYS_DEVIO, SYS_VDEVIO, SYS_SDEVIO. */
|
||||
#define DIO_REQUEST m2_i3 /* device in or output */
|
||||
# define DIO_INPUT 0 /* input */
|
||||
# define DIO_OUTPUT 1 /* output */
|
||||
#define DIO_TYPE m2_i1 /* flag indicating byte, word, or long */
|
||||
# define DIO_BYTE 'b' /* byte type values */
|
||||
# define DIO_WORD 'w' /* word type values */
|
||||
# define DIO_LONG 'l' /* long type values */
|
||||
# define _DIO_INPUT 0x001
|
||||
# define _DIO_OUTPUT 0x002
|
||||
# define _DIO_DIRMASK 0x00f
|
||||
# define _DIO_BYTE 0x010
|
||||
# define _DIO_WORD 0x020
|
||||
# define _DIO_LONG 0x030
|
||||
# define _DIO_TYPEMASK 0x0f0
|
||||
# define _DIO_SAFE 0x100
|
||||
# define _DIO_SAFEMASK 0xf00
|
||||
# define DIO_INPUT_BYTE (_DIO_INPUT|_DIO_BYTE)
|
||||
# define DIO_INPUT_WORD (_DIO_INPUT|_DIO_WORD)
|
||||
# define DIO_OUTPUT_BYTE (_DIO_OUTPUT|_DIO_BYTE)
|
||||
# define DIO_OUTPUT_WORD (_DIO_OUTPUT|_DIO_WORD)
|
||||
# define DIO_SAFE_INPUT_BYTE (_DIO_INPUT|_DIO_BYTE|_DIO_SAFE)
|
||||
# define DIO_SAFE_INPUT_WORD (_DIO_INPUT|_DIO_WORD|_DIO_SAFE)
|
||||
# define DIO_SAFE_OUTPUT_BYTE (_DIO_OUTPUT|_DIO_BYTE|_DIO_SAFE)
|
||||
# define DIO_SAFE_OUTPUT_WORD (_DIO_OUTPUT|_DIO_WORD|_DIO_SAFE)
|
||||
#define DIO_PORT m2_l1 /* single port address */
|
||||
#define DIO_VALUE m2_l2 /* single I/O value */
|
||||
#define DIO_VEC_ADDR m2_p1 /* address of buffer or (p,v)-pairs */
|
||||
#define DIO_VEC_SIZE m2_l2 /* number of elements in vector */
|
||||
#define DIO_VEC_ENDPT m2_i2 /* number of process where vector is */
|
||||
#define DIO_OFFSET m2_i1 /* offset from grant */
|
||||
|
||||
/* Field names for SYS_SIGNARLM, SYS_FLAGARLM, SYS_SYNCALRM. */
|
||||
#define ALRM_EXP_TIME m2_l1 /* expire time for the alarm call */
|
||||
|
@ -446,6 +472,18 @@
|
|||
/* Field names for SYS_INT86 */
|
||||
#define INT86_REG86 m1_p1 /* pointer to registers */
|
||||
|
||||
/* Field names for SYS_SAFECOPY */
|
||||
#define SCP_FROM_TO m2_i1 /* from/to whom? */
|
||||
#define SCP_INFO m2_i2 /* byte: DDDDSSSS Dest and Src seg */
|
||||
#define SCP_GID m2_i3 /* grant id */
|
||||
#define SCP_OFFSET m2_l1 /* offset within grant */
|
||||
#define SCP_ADDRESS m2_p1 /* my own address */
|
||||
#define SCP_BYTES m2_l2 /* bytes from offset */
|
||||
|
||||
/* For the SCP_INFO field: encoding and decoding. */
|
||||
#define SCP_MAKEINFO(seg) ((seg) & 0xffff)
|
||||
#define SCP_INFO2SEG(info) ((info) & 0xffff)
|
||||
|
||||
/* Field names for SELECT (FS). */
|
||||
#define SEL_NFDS m8_i1
|
||||
#define SEL_READFDS m8_p1
|
||||
|
@ -502,11 +540,12 @@
|
|||
# define FKEY_EVENTS 12 /* request open key presses */
|
||||
# define FKEY_FKEYS m2_l1 /* F1-F12 keys pressed */
|
||||
# define FKEY_SFKEYS m2_l2 /* Shift-F1-F12 keys pressed */
|
||||
#define DIAGNOSTICS 100 /* output a string without FS in between */
|
||||
# define DIAG_PRINT_BUF m1_p1
|
||||
#define DIAG_BASE 0xa00
|
||||
#define DIAGNOSTICS (DIAG_BASE+1) /* output a string without FS in between */
|
||||
#define DIAGNOSTICS_S (DIAG_BASE+2) /* grant-based version of DIAGNOSTICS */
|
||||
# define DIAG_PRINT_BUF_G m1_p1
|
||||
# define DIAG_BUF_COUNT m1_i1
|
||||
# define DIAG_ENDPT m1_i2
|
||||
#define GET_KMESS 101 /* get kmess from TTY */
|
||||
#define GET_KMESS (DIAG_BASE+3) /* get kmess from TTY */
|
||||
# define GETKM_PTR m1_p1
|
||||
|
||||
#define PM_BASE 0x900
|
||||
|
|
|
@ -81,10 +81,6 @@
|
|||
/* DMA_SECTORS may be increased to speed up DMA based drivers. */
|
||||
#define DMA_SECTORS 1 /* DMA buffer size (must be >= 1) */
|
||||
|
||||
/* Include or exclude backwards compatibility code. */
|
||||
#define ENABLE_BINCOMPAT 0 /* for binaries using obsolete calls */
|
||||
#define ENABLE_SRCCOMPAT 0 /* for sources using obsolete calls */
|
||||
|
||||
/* Which processes should receive diagnostics from the kernel and system?
|
||||
* Directly sending it to TTY only displays the output. Sending it to the
|
||||
* log driver will cause the diagnostics to be buffered and displayed.
|
||||
|
|
|
@ -43,6 +43,8 @@
|
|||
|
||||
#define PHYS_SEG 0x0400 /* flag indicating entire physical memory */
|
||||
|
||||
#define GRANT_SEG 0x0800 /* flag indicating grant for umap */
|
||||
|
||||
/* Labels used to disable code sections for different reasons. */
|
||||
#define DEAD_CODE 0 /* unused code in normal configuration */
|
||||
#define FUTURE_CODE 0 /* new code to be activated + tested later */
|
||||
|
|
|
@ -30,6 +30,13 @@
|
|||
_IOC_IN)
|
||||
#define _IORW(x,y,t) ((x << 8) | y | ((sizeof(t) & _IOCPARM_MASK) << 16) |\
|
||||
_IOC_INOUT)
|
||||
|
||||
/* Decode an ioctl call. */
|
||||
#define _MINIX_IOCTL_SIZE(i) (((i) >> 16) & _IOCPARM_MASK)
|
||||
#define _MINIX_IOCTL_IOR(i) ((i) & _IOC_OUT)
|
||||
#define _MINIX_IOCTL_IORW(i) ((i) & _IOC_INOUT)
|
||||
#define _MINIX_IOCTL_IOW(i) ((i) & _IOC_IN)
|
||||
|
||||
#else
|
||||
/* No fancy encoding on a 16-bit machine. */
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ typedef struct {int m7i1, m7i2, m7i3, m7i4; char *m7p1, *m7p2;} mess_7;
|
|||
typedef struct {int m8i1, m8i2; char *m8p1, *m8p2, *m8p3, *m8p4;} mess_8;
|
||||
|
||||
typedef struct {
|
||||
int m_source; /* who sent the message */
|
||||
endpoint_t m_source; /* who sent the message */
|
||||
int m_type; /* what kind of message is it */
|
||||
union {
|
||||
mess_1 m_m1;
|
||||
|
@ -92,10 +92,10 @@ typedef struct {
|
|||
#define send _send
|
||||
|
||||
_PROTOTYPE( int echo, (message *m_ptr) );
|
||||
_PROTOTYPE( int notify, (int dest) );
|
||||
_PROTOTYPE( int sendrec, (int src_dest, message *m_ptr) );
|
||||
_PROTOTYPE( int receive, (int src, message *m_ptr) );
|
||||
_PROTOTYPE( int send, (int dest, message *m_ptr) );
|
||||
_PROTOTYPE( int notify, (endpoint_t dest) );
|
||||
_PROTOTYPE( int sendrec, (endpoint_t src_dest, message *m_ptr) );
|
||||
_PROTOTYPE( int receive, (endpoint_t src, message *m_ptr) );
|
||||
_PROTOTYPE( int send, (endpoint_t dest, message *m_ptr) );
|
||||
|
||||
#define ipc_request _ipc_request
|
||||
#define ipc_reply _ipc_reply
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
typedef unsigned int vir_clicks; /* virtual addr/length in clicks */
|
||||
typedef unsigned long phys_bytes; /* physical addr/length in bytes */
|
||||
typedef unsigned int phys_clicks; /* physical addr/length in clicks */
|
||||
typedef int endpoint_t; /* process identifier */
|
||||
|
||||
#if (_MINIX_CHIP == _CHIP_INTEL)
|
||||
typedef unsigned int vir_bytes; /* virtual addresses and lengths in bytes */
|
||||
|
@ -130,7 +131,7 @@ struct machine {
|
|||
int pc_at;
|
||||
int ps_mca;
|
||||
int processor;
|
||||
int protected;
|
||||
int prot;
|
||||
int vdu_ega;
|
||||
int vdu_vga;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue