minix/include/minix/syslib.h

236 lines
11 KiB
C
Raw Normal View History

/* Prototypes for system library functions. */
2005-04-21 16:53:53 +02:00
#ifndef _SYSLIB_H
#define _SYSLIB_H
#ifndef _TYPES_H
#include <sys/types.h>
#endif
#ifndef _IPC_H
#include <minix/ipc.h>
#endif
#include <minix/u64.h>
2005-04-21 16:53:53 +02:00
#ifndef _DEVIO_H
#include <minix/devio.h>
#endif
. 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++
2006-06-20 10:38:15 +02:00
#include <minix/safecopies.h>
2005-07-29 12:21:04 +02:00
/* Forward declaration */
struct reg86u;
struct rs_pci;
2005-07-29 12:21:04 +02:00
#define SYSTASK SYSTEM
2005-04-21 16:53:53 +02:00
/*==========================================================================*
* Minix system library. *
*==========================================================================*/
2005-07-29 17:02:27 +02:00
_PROTOTYPE( int _taskcall, (int who, int syscallnr, message *msgptr));
2005-04-21 16:53:53 +02:00
2005-07-29 17:02:27 +02:00
_PROTOTYPE( int sys_abort, (int how, ...));
. 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++
2006-06-20 10:38:15 +02:00
_PROTOTYPE( int sys_enable_iop, (endpoint_t proc));
_PROTOTYPE( int sys_exec, (endpoint_t proc, char *ptr,
2005-07-29 17:02:27 +02:00
char *aout, vir_bytes initpc));
_PROTOTYPE( int sys_fork, (endpoint_t parent, endpoint_t child, int *,
struct mem_map *ptr, u32_t vm));
. 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++
2006-06-20 10:38:15 +02:00
_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));
. 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++
2006-06-20 10:38:15 +02:00
_PROTOTYPE( int sys_privctl, (endpoint_t proc, int req, int i, void *p));
2006-06-23 17:35:05 +02:00
_PROTOTYPE( int sys_setgrant, (cp_grant_t *grants, int ngrants));
. 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++
2006-06-20 10:38:15 +02:00
_PROTOTYPE( int sys_nice, (endpoint_t proc, int priority));
2005-04-21 16:53:53 +02:00
2005-07-29 17:02:27 +02:00
_PROTOTYPE( int sys_int86, (struct reg86u *reg86p));
_PROTOTYPE( int sys_vm_setbuf, (phys_bytes base, phys_bytes size,
phys_bytes high));
. 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++
2006-06-20 10:38:15 +02:00
_PROTOTYPE( int sys_vm_map, (endpoint_t proc_nr, int do_map,
phys_bytes base, phys_bytes size, phys_bytes offset));
_PROTOTYPE( int sys_vmctl, (endpoint_t who, int param, u32_t value));
_PROTOTYPE( int sys_vmctl_get_pagefault_i386, (endpoint_t *who, u32_t *cr2, u32_t *err));
_PROTOTYPE( int sys_vmctl_get_cr3_i386, (endpoint_t who, u32_t *cr3) );
_PROTOTYPE( int sys_vmctl_get_memreq, (endpoint_t *who, vir_bytes *mem,
vir_bytes *len, int *wrflag) );
2005-04-21 16:53:53 +02:00
_PROTOTYPE( int sys_readbios, (phys_bytes address, void *buf, size_t size));
_PROTOTYPE( int sys_stime, (time_t boottime));
_PROTOTYPE( int sys_sysctl, (int ctl, char *arg1, int arg2));
_PROTOTYPE( int sys_sysctl_stacktrace, (endpoint_t who));
2005-04-21 16:53:53 +02:00
/* Shorthands for sys_sdevio() system call. */
#define sys_insb(port, proc_nr, buffer, count) \
. 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++
2006-06-20 10:38:15 +02:00
sys_sdevio(DIO_INPUT_BYTE, port, proc_nr, buffer, count, 0)
2005-04-21 16:53:53 +02:00
#define sys_insw(port, proc_nr, buffer, count) \
. 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++
2006-06-20 10:38:15 +02:00
sys_sdevio(DIO_INPUT_WORD, port, proc_nr, buffer, count, 0)
2005-04-21 16:53:53 +02:00
#define sys_outsb(port, proc_nr, buffer, count) \
. 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++
2006-06-20 10:38:15 +02:00
sys_sdevio(DIO_OUTPUT_BYTE, port, proc_nr, buffer, count, 0)
2005-04-21 16:53:53 +02:00
#define sys_outsw(port, proc_nr, buffer, count) \
. 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++
2006-06-20 10:38:15 +02:00
sys_sdevio(DIO_OUTPUT_WORD, port, proc_nr, buffer, count, 0)
#define sys_safe_insb(port, ept, grant, offset, count) \
sys_sdevio(DIO_SAFE_INPUT_BYTE, port, ept, (void*)grant, count, offset)
#define sys_safe_outsb(port, ept, grant, offset, count) \
sys_sdevio(DIO_SAFE_OUTPUT_BYTE, port, ept, (void*)grant, count, offset)
. 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++
2006-06-20 10:38:15 +02:00
#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));
_PROTOTYPE(void *alloc_contig, (size_t len, int flags, phys_bytes *phys));
#define AC_ALIGN4K 0x01
#define AC_LOWER16M 0x02
2005-04-21 16:53:53 +02:00
/* Clock functionality: get system times or (un)schedule an alarm call. */
2007-08-16 15:16:26 +02:00
_PROTOTYPE( int sys_times, (endpoint_t proc_nr, clock_t *user_time,
clock_t *sys_time, clock_t *uptime));
2005-07-29 17:02:27 +02:00
_PROTOTYPE(int sys_setalarm, (clock_t exp_time, int abs_time));
2005-04-21 16:53:53 +02:00
/* Shorthands for sys_irqctl() system call. */
2005-05-02 16:30:04 +02:00
#define sys_irqdisable(hook_id) \
sys_irqctl(IRQ_DISABLE, 0, 0, hook_id)
#define sys_irqenable(hook_id) \
sys_irqctl(IRQ_ENABLE, 0, 0, hook_id)
#define sys_irqsetpolicy(irq_vec, policy, hook_id) \
sys_irqctl(IRQ_SETPOLICY, irq_vec, policy, hook_id)
#define sys_irqrmpolicy(irq_vec, hook_id) \
sys_irqctl(IRQ_RMPOLICY, irq_vec, 0, hook_id)
2005-04-21 16:53:53 +02:00
_PROTOTYPE ( int sys_irqctl, (int request, int irq_vec, int policy,
2005-05-02 16:30:04 +02:00
int *irq_hook_id) );
2005-04-21 16:53:53 +02:00
2005-04-29 17:36:43 +02:00
/* Shorthands for sys_vircopy() and sys_physcopy() system calls. */
2005-04-21 16:53:53 +02:00
#define sys_biosin(bios_vir, dst_vir, bytes) \
sys_vircopy(SELF, BIOS_SEG, bios_vir, SELF, D, dst_vir, bytes)
#define sys_biosout(src_vir, bios_vir, bytes) \
sys_vircopy(SELF, D, src_vir, SELF, BIOS_SEG, bios_vir, bytes)
#define sys_datacopy(src_proc, src_vir, dst_proc, dst_vir, bytes) \
sys_vircopy(src_proc, D, src_vir, dst_proc, D, dst_vir, bytes)
#define sys_textcopy(src_proc, src_vir, dst_proc, dst_vir, bytes) \
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)
. 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++
2006-06-20 10:38:15 +02:00
_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));
2005-04-21 16:53:53 +02:00
2005-04-29 17:36:43 +02:00
#define sys_abscopy(src_phys, dst_phys, bytes) \
sys_physcopy(NONE, PHYS_SEG, src_phys, NONE, PHYS_SEG, dst_phys, bytes)
. 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++
2006-06-20 10:38:15 +02:00
_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));
/* Grant-based copy functions. */
_PROTOTYPE(int sys_safecopyfrom, (endpoint_t source, cp_grant_id_t grant,
vir_bytes grant_offset, vir_bytes my_address, size_t bytes, int my_seg));
_PROTOTYPE(int sys_safecopyto, (endpoint_t dest, cp_grant_id_t grant,
vir_bytes grant_offset, vir_bytes my_address, size_t bytes, int my_seg));
_PROTOTYPE(int sys_vsafecopy, (struct vscp_vec *copyvec, int elements));
. 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++
2006-06-20 10:38:15 +02:00
2005-07-29 17:02:27 +02:00
_PROTOTYPE(int sys_memset, (unsigned long pattern,
phys_bytes base, phys_bytes bytes));
. 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++
2006-06-20 10:38:15 +02:00
2005-07-29 17:02:27 +02:00
/* 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
2005-04-29 17:36:43 +02:00
. 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++
2006-06-20 10:38:15 +02:00
_PROTOTYPE(int sys_umap, (endpoint_t proc_nr, int seg, vir_bytes vir_addr,
2005-07-29 17:02:27 +02:00
vir_bytes bytes, phys_bytes *phys_addr));
_PROTOTYPE(int sys_umap_data_fb, (endpoint_t proc_nr, vir_bytes vir_addr,
vir_bytes bytes, phys_bytes *phys_addr));
2005-04-29 17:36:43 +02:00
_PROTOTYPE(int sys_segctl, (int *index, u16_t *seg, vir_bytes *off,
phys_bytes phys, vir_bytes size));
2005-04-21 16:53:53 +02:00
/* Shorthands for sys_getinfo() system call. */
#define sys_getkmessages(dst) sys_getinfo(GET_KMESSAGES, dst, 0,0,0)
2005-04-29 17:36:43 +02:00
#define sys_getkinfo(dst) sys_getinfo(GET_KINFO, dst, 0,0,0)
2005-11-14 16:58:07 +01:00
#define sys_getloadinfo(dst) sys_getinfo(GET_LOADINFO, dst, 0,0,0)
2005-04-29 17:36:43 +02:00
#define sys_getmachine(dst) sys_getinfo(GET_MACHINE, dst, 0,0,0)
2005-04-21 16:53:53 +02:00
#define sys_getproctab(dst) sys_getinfo(GET_PROCTAB, dst, 0,0,0)
#define sys_getprivtab(dst) sys_getinfo(GET_PRIVTAB, dst, 0,0,0)
2005-04-21 16:53:53 +02:00
#define sys_getproc(dst,nr) sys_getinfo(GET_PROC, dst, 0,0, nr)
#define sys_getrandomness(dst) sys_getinfo(GET_RANDOMNESS, dst, 0,0,0)
2005-04-21 16:53:53 +02:00
#define sys_getimage(dst) sys_getinfo(GET_IMAGE, dst, 0,0,0)
2005-05-02 16:30:04 +02:00
#define sys_getirqhooks(dst) sys_getinfo(GET_IRQHOOKS, dst, 0,0,0)
#define sys_getirqactids(dst) sys_getinfo(GET_IRQACTIDS, dst, 0,0,0)
2005-04-21 16:53:53 +02:00
#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)
. 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++
2006-06-20 10:38:15 +02:00
#define sys_getbiosbuffer(virp, sizep) \
sys_getinfo(GET_BIOSBUFFER, virp, sizeof(*virp), sizep, sizeof(*sizep))
#define sys_getprivid(nr) sys_getinfo(GET_PRIVID, 0, 0,0, nr)
2005-04-21 16:53:53 +02:00
_PROTOTYPE(int sys_getinfo, (int request, void *val_ptr, int val_len,
void *val_ptr2, int val_len2) );
_PROTOTYPE(int sys_whoami, (endpoint_t *ep, char *name, int namelen));
2005-04-21 16:53:53 +02:00
2005-04-29 17:36:43 +02:00
/* Signal control. */
. 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++
2006-06-20 10:38:15 +02:00
_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) );
2005-04-21 16:53:53 +02:00
/* NOTE: two different approaches were used to distinguish the device I/O
* types 'byte', 'word', 'long': the latter uses #define and results in a
* smaller implementation, but looses the static type checking.
*/
_PROTOTYPE(int sys_voutb, (pvb_pair_t *pvb_pairs, int nr_ports) );
_PROTOTYPE(int sys_voutw, (pvw_pair_t *pvw_pairs, int nr_ports) );
_PROTOTYPE(int sys_voutl, (pvl_pair_t *pvl_pairs, int nr_ports) );
_PROTOTYPE(int sys_vinb, (pvb_pair_t *pvb_pairs, int nr_ports) );
_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. */
. 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++
2006-06-20 10:38:15 +02:00
#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)
2005-04-21 16:53:53 +02:00
_PROTOTYPE(int sys_out, (int port, unsigned long value, int type) );
/* Shorthands for sys_in() system call. */
. 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++
2006-06-20 10:38:15 +02:00
#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)
2005-04-21 16:53:53 +02:00
_PROTOTYPE(int sys_in, (int port, unsigned long *value, int type) );
2005-12-02 15:40:51 +01:00
/* pci.c */
_PROTOTYPE( void pci_init, (void) );
_PROTOTYPE( void pci_init1, (char *name) );
2005-12-02 15:40:51 +01:00
_PROTOTYPE( int pci_first_dev, (int *devindp, u16_t *vidp, u16_t *didp) );
_PROTOTYPE( int pci_next_dev, (int *devindp, u16_t *vidp, u16_t *didp) );
_PROTOTYPE( int pci_find_dev, (U8_t bus, U8_t dev, U8_t func,
int *devindp) );
_PROTOTYPE( void pci_reserve, (int devind) );
_PROTOTYPE( int pci_reserve_ok, (int devind) );
2005-12-02 15:40:51 +01:00
_PROTOTYPE( void pci_ids, (int devind, u16_t *vidp, u16_t *didp) );
_PROTOTYPE( void pci_rescan_bus, (U8_t busnr) );
2005-12-02 15:40:51 +01:00
_PROTOTYPE( u8_t pci_attr_r8, (int devind, int port) );
_PROTOTYPE( u16_t pci_attr_r16, (int devind, int port) );
_PROTOTYPE( u32_t pci_attr_r32, (int devind, int port) );
_PROTOTYPE( void pci_attr_w8, (int devind, int port, U8_t value) );
2005-12-02 15:40:51 +01:00
_PROTOTYPE( void pci_attr_w16, (int devind, int port, U16_t value) );
_PROTOTYPE( void pci_attr_w32, (int devind, int port, u32_t value) );
_PROTOTYPE( char *pci_dev_name, (U16_t vid, U16_t did) );
_PROTOTYPE( char *pci_slot_name, (int devind) );
_PROTOTYPE( int pci_set_acl, (struct rs_pci *rs_pci) );
_PROTOTYPE( int pci_del_acl, (endpoint_t proc_nr) );
2005-12-02 15:40:51 +01:00
/* Profiling. */
_PROTOTYPE( int sys_sprof, (int action, int size, int freq, int endpt,
void *ctl_ptr, void *mem_ptr) );
_PROTOTYPE( int sys_cprof, (int action, int size, int endpt,
void *ctl_ptr, void *mem_ptr) );
_PROTOTYPE( int sys_profbuf, (void *ctl_ptr, void *mem_ptr) );
/* read_tsc() and friends. */
_PROTOTYPE( void read_tsc_64, (u64_t *t) );
_PROTOTYPE( void read_tsc, (u32_t *hi, u32_t *lo) );
2005-04-21 16:53:53 +02:00
#endif /* _SYSLIB_H */