endpoint_t in syslib

- headers use the endpoint_t in syslib.h and the implmentation was using int
  instead. Both uses endpoint_t now

- every variable named like proc, proc_nr or proc_nr_e of type endpoint_t has
  name proc_ep now

- endpoint_t defined as u32_t not int
This commit is contained in:
Tomas Hruby 2009-09-22 21:42:02 +00:00
parent 64df404150
commit b900311656
28 changed files with 92 additions and 90 deletions

View file

@ -313,7 +313,7 @@ u16_t *didp;
*===========================================================================*/
PUBLIC int pci_reserve2(devind, proc)
int devind;
int proc;
endpoint_t proc;
{
int i, r;
int ilr;

View file

@ -28,26 +28,26 @@ struct rs_pci;
/*==========================================================================*
* Minix system library. *
*==========================================================================*/
_PROTOTYPE( int _taskcall, (int who, int syscallnr, message *msgptr));
_PROTOTYPE( int _taskcall, (endpoint_t who, int syscallnr, message *msgptr));
_PROTOTYPE( int sys_abort, (int how, ...));
_PROTOTYPE( int sys_enable_iop, (endpoint_t proc));
_PROTOTYPE( int sys_exec, (endpoint_t proc, char *ptr,
_PROTOTYPE( int sys_enable_iop, (endpoint_t proc_ep));
_PROTOTYPE( int sys_exec, (endpoint_t proc_ep, char *ptr,
char *aout, vir_bytes initpc));
_PROTOTYPE( int sys_fork, (endpoint_t parent, endpoint_t child, int *,
struct mem_map *ptr, u32_t vm, vir_bytes *));
_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_newmap, (endpoint_t proc_ep, struct mem_map *ptr));
_PROTOTYPE( int sys_exit, (endpoint_t proc_ep));
_PROTOTYPE( int sys_trace, (int req, endpoint_t proc_ep, long addr, long *data_p));
_PROTOTYPE( int sys_privctl, (endpoint_t proc, int req, void *p));
_PROTOTYPE( int sys_privctl, (endpoint_t proc_ep, int req, int i, void *p));
_PROTOTYPE( int sys_setgrant, (cp_grant_t *grants, int ngrants));
_PROTOTYPE( int sys_nice, (endpoint_t proc, int priority));
_PROTOTYPE( int sys_nice, (endpoint_t proc_ep, 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, (endpoint_t proc_nr, int do_map,
_PROTOTYPE( int sys_vm_map, (endpoint_t proc_ep, 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));
@ -62,14 +62,14 @@ _PROTOTYPE( int sys_sysctl, (int ctl, char *arg1, int arg2));
_PROTOTYPE( int sys_sysctl_stacktrace, (endpoint_t who));
/* Shorthands for sys_sdevio() system call. */
#define sys_insb(port, 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_WORD, port, proc_nr, buffer, count, 0)
#define sys_outsb(port, 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_WORD, port, proc_nr, buffer, count, 0)
#define sys_insb(port, proc_ep, buffer, count) \
sys_sdevio(DIO_INPUT_BYTE, port, proc_ep, buffer, count, 0)
#define sys_insw(port, proc_ep, buffer, count) \
sys_sdevio(DIO_INPUT_WORD, port, proc_ep, buffer, count, 0)
#define sys_outsb(port, proc_ep, buffer, count) \
sys_sdevio(DIO_OUTPUT_BYTE, port, proc_ep, buffer, count, 0)
#define sys_outsw(port, proc_ep, buffer, count) \
sys_sdevio(DIO_OUTPUT_WORD, port, proc_ep, 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) \
@ -78,7 +78,7 @@ _PROTOTYPE( int sys_sysctl_stacktrace, (endpoint_t who));
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,
_PROTOTYPE( int sys_sdevio, (int req, long port, endpoint_t proc_ep,
void *buffer, int count, vir_bytes offset));
_PROTOTYPE(void *alloc_contig, (size_t len, int flags, phys_bytes *phys));
#define AC_ALIGN4K 0x01
@ -89,7 +89,7 @@ _PROTOTYPE(void *alloc_contig, (size_t len, int flags, phys_bytes *phys));
/* Clock functionality: get system times, (un)schedule an alarm call, or
* retrieve/set a process-virtual timer.
*/
_PROTOTYPE( int sys_times, (endpoint_t proc_nr, clock_t *user_time,
_PROTOTYPE( int sys_times, (endpoint_t proc_ep, clock_t *user_time,
clock_t *sys_time, clock_t *uptime));
_PROTOTYPE(int sys_setalarm, (clock_t exp_time, int abs_time));
_PROTOTYPE( int sys_vtimer, (endpoint_t proc_nr, int which, clock_t *newval,
@ -144,9 +144,9 @@ _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, (endpoint_t proc_nr, int seg, vir_bytes vir_addr,
_PROTOTYPE(int sys_umap, (endpoint_t proc_ep, int seg, vir_bytes vir_addr,
vir_bytes bytes, phys_bytes *phys_addr));
_PROTOTYPE(int sys_umap_data_fb, (endpoint_t proc_nr, vir_bytes vir_addr,
_PROTOTYPE(int sys_umap_data_fb, (endpoint_t proc_ep, 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));
@ -173,11 +173,11 @@ _PROTOTYPE(int sys_getinfo, (int request, void *val_ptr, int val_len,
_PROTOTYPE(int sys_whoami, (endpoint_t *ep, char *name, int namelen));
/* Signal control. */
_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) );
_PROTOTYPE(int sys_kill, (endpoint_t proc_ep, int sig) );
_PROTOTYPE(int sys_sigsend, (endpoint_t proc_ep, struct sigmsg *sig_ctxt) );
_PROTOTYPE(int sys_sigreturn, (endpoint_t proc_ep, struct sigmsg *sig_ctxt) );
_PROTOTYPE(int sys_getksig, (endpoint_t *proc_ep, sigset_t *k_sig_map) );
_PROTOTYPE(int sys_endksig, (endpoint_t proc_ep) );
/* NOTE: two different approaches were used to distinguish the device I/O
* types 'byte', 'word', 'long': the latter uses #define and results in a
@ -222,12 +222,12 @@ _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) );
_PROTOTYPE( int pci_del_acl, (endpoint_t proc_ep) );
/* 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,
_PROTOTYPE( int sys_sprof, (int action, int size, int freq,
endpoint_t endpt, void *ctl_ptr, void *mem_ptr) );
_PROTOTYPE( int sys_cprof, (int action, int size, endpoint_t endpt,
void *ctl_ptr, void *mem_ptr) );
_PROTOTYPE( int sys_profbuf, (void *ctl_ptr, void *mem_ptr) );

View file

@ -13,7 +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 */
typedef u32_t endpoint_t; /* process identifier */
#if (_MINIX_CHIP == _CHIP_INTEL)
typedef long unsigned int vir_bytes; /* virtual addresses/lengths in bytes */

View file

@ -183,7 +183,7 @@ _PROTOTYPE( int getdomainname, (char *_domain, size_t _len) );
_PROTOTYPE( int ttyslot, (void) );
_PROTOTYPE( int fttyslot, (int _fd) );
_PROTOTYPE( char *crypt, (const char *_key, const char *_salt) );
_PROTOTYPE( int getsysinfo, (int who, int what, void *where) );
_PROTOTYPE( int getsysinfo, (endpoint_t who, int what, void *where) );
_PROTOTYPE( int getsigset, (sigset_t *sigset) );
_PROTOTYPE( int getprocnr, (void) );
_PROTOTYPE( int getnprocnr, (pid_t pid) );

View file

@ -256,6 +256,7 @@ PUBLIC void idt_init(void)
idt_copy_vectors(gate_table);
idt_copy_vectors(gate_table_pic);
idt_reload();
}

View file

@ -3,11 +3,11 @@
/*===========================================================================*
* sys_enable_iop *
*===========================================================================*/
PUBLIC int sys_enable_iop(proc_nr)
int proc_nr; /* number of process to allow I/O */
PUBLIC int sys_enable_iop(proc_nr_e)
endpoint_t proc_nr_e; /* number of process to allow I/O */
{
message m_iop;
m_iop.IO_ENDPT = proc_nr;
m_iop.IO_ENDPT = proc_nr_e;
return _taskcall(SYSTASK, SYS_IOPENABLE, &m_iop);
}

View file

@ -7,7 +7,7 @@
#include <minix/syslib.h>
PUBLIC int _taskcall(who, syscallnr, msgptr)
int who;
endpoint_t who;
int syscallnr;
register message *msgptr;
{

View file

@ -12,8 +12,8 @@ pci_del_acl.c
/*===========================================================================*
* pci_del_acl *
*===========================================================================*/
PUBLIC int pci_del_acl(proc_nr)
endpoint_t proc_nr;
PUBLIC int pci_del_acl(proc_ep)
endpoint_t proc_ep;
{
int r;
message m;
@ -33,7 +33,7 @@ endpoint_t proc_nr;
m.m_type= BUSC_PCI_DEL_ACL;
m.m1_i1= proc_nr;
m.m1_i1= proc_ep;
r= sendrec(pci_procnr, &m);
if (r != 0)

View file

@ -6,7 +6,7 @@
PUBLIC int sys_cprof(action, size, endpt, ctl_ptr, mem_ptr)
int action; /* get/reset profiling tables */
int size; /* size of allocated memory */
int endpt; /* caller endpoint */
endpoint_t endpt; /* caller endpoint */
void *ctl_ptr; /* location of info struct */
void *mem_ptr; /* location of allocated memory */
{

View file

@ -3,13 +3,13 @@
/*===========================================================================*
* sys_endksig *
*===========================================================================*/
PUBLIC int sys_endksig(proc_nr)
int proc_nr; /* process number */
PUBLIC int sys_endksig(proc_ep)
endpoint_t proc_ep; /* process number */
{
message m;
int result;
m.SIG_ENDPT = proc_nr;
m.SIG_ENDPT = proc_ep;
result = _taskcall(SYSTASK, SYS_ENDKSIG, &m);
return(result);
}

View file

@ -3,11 +3,11 @@
/*===========================================================================*
* sys_enable_iop *
*===========================================================================*/
PUBLIC int sys_enable_iop(proc_nr_e)
int proc_nr_e; /* number of process to allow I/O */
PUBLIC int sys_enable_iop(proc_ep)
endpoint_t proc_ep; /* number of process to allow I/O */
{
message m_iop;
m_iop.IO_ENDPT = proc_nr_e;
m_iop.IO_ENDPT = proc_ep;
return _taskcall(SYSTASK, SYS_IOPENABLE, &m_iop);
}

View file

@ -1,7 +1,7 @@
#include "syslib.h"
PUBLIC int sys_exec(proc, ptr, prog_name, initpc)
int proc; /* process that did exec */
PUBLIC int sys_exec(proc_ep, ptr, prog_name, initpc)
endpoint_t proc_ep; /* process that did exec */
char *ptr; /* new stack pointer */
char *prog_name; /* name of the new program */
vir_bytes initpc;
@ -10,7 +10,7 @@ vir_bytes initpc;
message m;
m.PR_ENDPT = proc;
m.PR_ENDPT = proc_ep;
m.PR_STACK_PTR = ptr;
m.PR_NAME_PTR = prog_name;
m.PR_IP_PTR = (char *)initpc;

View file

@ -3,8 +3,8 @@
/*===========================================================================*
* sys_exit *
*===========================================================================*/
PUBLIC int sys_exit(proc)
int proc; /* which process has exited */
PUBLIC int sys_exit(proc_ep)
endpoint_t proc_ep; /* which process has exited */
{
/* A process has exited. PM tells the kernel. In addition this call can be
* used by system processes to directly exit without passing through the
@ -12,6 +12,6 @@ int proc; /* which process has exited */
*/
message m;
m.PR_ENDPT = proc;
m.PR_ENDPT = proc_ep;
return(_taskcall(SYSTASK, SYS_EXIT, &m));
}

View file

@ -3,15 +3,15 @@
/*===========================================================================*
* sys_getksig *
*===========================================================================*/
PUBLIC int sys_getksig(k_proc_nr, k_sig_map)
int *k_proc_nr; /* return process number here */
PUBLIC int sys_getksig(proc_ep, k_sig_map)
endpoint_t *proc_ep; /* return process number here */
sigset_t *k_sig_map; /* return signal map here */
{
message m;
int result;
result = _taskcall(SYSTASK, SYS_GETKSIG, &m);
*k_proc_nr = m.SIG_ENDPT;
*proc_ep = m.SIG_ENDPT;
*k_sig_map = (sigset_t) m.SIG_MAP;
return(result);
}

View file

@ -1,13 +1,13 @@
#include "syslib.h"
PUBLIC int sys_kill(proc, signr)
int proc; /* which proc has exited */
PUBLIC int sys_kill(proc_ep, signr)
endpoint_t proc_ep; /* which proc_ep has exited */
int signr; /* signal number: 1 - 16 */
{
/* A proc has to be signaled via MM. Tell the kernel. */
/* A proc_ep has to be signaled via MM. Tell the kernel. */
message m;
m.SIG_ENDPT = proc;
m.SIG_ENDPT = proc_ep;
m.SIG_NUMBER = signr;
return(_taskcall(SYSTASK, SYS_KILL, &m));
}

View file

@ -1,14 +1,14 @@
#include "syslib.h"
PUBLIC int sys_newmap(proc, ptr)
int proc; /* process whose map is to be changed */
PUBLIC int sys_newmap(proc_ep, ptr)
endpoint_t proc_ep; /* process whose map is to be changed */
struct mem_map *ptr; /* pointer to new map */
{
/* A process has been assigned a new memory map. Tell the kernel. */
message m;
m.PR_ENDPT = proc;
m.PR_ENDPT = proc_ep;
m.PR_MEM_PTR = (char *) ptr;
return(_taskcall(SYSTASK, SYS_NEWMAP, &m));
}

View file

@ -3,11 +3,11 @@
/*===========================================================================*
* sys_nice *
*===========================================================================*/
PUBLIC int sys_nice(int proc, int prio)
PUBLIC int sys_nice(endpoint_t proc_ep, int prio)
{
message m;
m.PR_ENDPT = proc;
m.PR_ENDPT = proc_ep;
m.PR_PRIORITY = prio;
return(_taskcall(SYSTASK, SYS_NICE, &m));
}

View file

@ -2,10 +2,10 @@
PUBLIC int sys_physcopy(src_proc, src_seg, src_vir,
dst_proc, dst_seg, dst_vir, bytes)
int src_proc; /* source process */
endpoint_t src_proc; /* source process */
int src_seg; /* source memory segment */
vir_bytes src_vir; /* source virtual address */
int dst_proc; /* destination process */
endpoint_t dst_proc; /* destination process */
int dst_seg; /* destination memory segment */
vir_bytes dst_vir; /* destination virtual address */
phys_bytes bytes; /* how many bytes */

View file

@ -1,10 +1,10 @@
#include "syslib.h"
int sys_privctl(endpoint_t proc, int request, void *p)
int sys_privctl(endpoint_t proc_ep, int request, int i, void *p)
{
message m;
m.CTL_ENDPT = proc;
m.CTL_ENDPT = proc_ep;
m.CTL_REQUEST = request;
m.CTL_ARG_PTR = p;

View file

@ -3,14 +3,14 @@
/*===========================================================================*
* sys_sigreturn *
*===========================================================================*/
PUBLIC int sys_sigreturn(proc_nr, sig_ctxt)
int proc_nr; /* for which process */
PUBLIC int sys_sigreturn(proc_ep, sig_ctxt)
endpoint_t proc_ep; /* for which process */
struct sigmsg *sig_ctxt; /* POSIX style handling */
{
message m;
int result;
m.SIG_ENDPT = proc_nr;
m.SIG_ENDPT = proc_ep;
m.SIG_CTXT_PTR = (char *) sig_ctxt;
result = _taskcall(SYSTASK, SYS_SIGRETURN, &m);
return(result);

View file

@ -3,14 +3,14 @@
/*===========================================================================*
* sys_sigsend *
*===========================================================================*/
PUBLIC int sys_sigsend(proc_nr, sig_ctxt)
int proc_nr; /* for which process */
PUBLIC int sys_sigsend(proc_ep, sig_ctxt)
endpoint_t proc_ep; /* for which process */
struct sigmsg *sig_ctxt; /* POSIX style handling */
{
message m;
int result;
m.SIG_ENDPT = proc_nr;
m.SIG_ENDPT = proc_ep;
m.SIG_CTXT_PTR = (char *) sig_ctxt;
result = _taskcall(SYSTASK, SYS_SIGSEND, &m);
return(result);

View file

@ -9,7 +9,7 @@ PUBLIC int sys_sprof(action, size, freq, endpt, ctl_ptr, mem_ptr)
int action; /* start/stop profiling */
int size; /* available profiling memory */
int freq; /* sample frequency */
int endpt; /* caller endpoint */
endpoint_t endpt; /* caller endpoint */
void *ctl_ptr; /* location of info struct */
void *mem_ptr; /* location of profiling memory */
{

View file

@ -1,18 +1,18 @@
#include "syslib.h"
PUBLIC int sys_times(proc, user_time, sys_time, uptime)
int proc; /* proc whose times are needed */
PUBLIC int sys_times(proc_ep, user_time, sys_time, uptime)
endpoint_t proc_ep; /* proc_ep whose times are needed */
clock_t *user_time; /* time spend in the process itself */
clock_t *sys_time; /* time spend in system on behalf of the
* process
*/
clock_t *uptime; /* time the system is running */
{
/* Fetch the accounting info for a proc. */
/* Fetch the accounting info for a proc_ep. */
message m;
int r;
m.T_ENDPT = proc;
m.T_ENDPT = proc_ep;
r = _taskcall(SYSTASK, SYS_TIMES, &m);
if (user_time) *user_time = m.T_USER_TIME;
if (sys_time) *sys_time = m.T_SYSTEM_TIME;

View file

@ -1,13 +1,14 @@
#include "syslib.h"
PUBLIC int sys_trace(req, proc_nr, addr, data_p)
int req, proc_nr;
PUBLIC int sys_trace(req, proc_ep, addr, data_p)
int req;
endpoint_t proc_ep;
long addr, *data_p;
{
message m;
int r;
m.CTL_ENDPT = proc_nr;
m.CTL_ENDPT = proc_ep;
m.CTL_REQUEST = req;
m.CTL_ADDRESS = addr;
if (data_p) m.CTL_DATA = *data_p;

View file

@ -3,8 +3,8 @@
/*===========================================================================*
* sys_umap *
*===========================================================================*/
PUBLIC int sys_umap(proc_nr, seg, vir_addr, bytes, phys_addr)
int proc_nr; /* process number to do umap for */
PUBLIC int sys_umap(proc_ep, seg, vir_addr, bytes, phys_addr)
endpoint_t proc_ep; /* process number to do umap for */
int seg; /* T, D, or S segment */
vir_bytes vir_addr; /* address in bytes with segment*/
vir_bytes bytes; /* number of bytes to be copied */
@ -13,7 +13,7 @@ phys_bytes *phys_addr; /* placeholder for result */
message m;
int result;
m.CP_SRC_ENDPT = proc_nr;
m.CP_SRC_ENDPT = proc_ep;
m.CP_SRC_SPACE = seg;
m.CP_SRC_ADDR = vir_addr;
m.CP_NR_BYTES = bytes;

View file

@ -2,10 +2,10 @@
PUBLIC int sys_vircopy(src_proc, src_seg, src_vir,
dst_proc, dst_seg, dst_vir, bytes)
int src_proc; /* source process */
endpoint_t src_proc; /* source process */
int src_seg; /* source memory segment */
vir_bytes src_vir; /* source virtual address */
int dst_proc; /* destination process */
endpoint_t dst_proc; /* destination process */
int dst_seg; /* destination memory segment */
vir_bytes dst_vir; /* destination virtual address */
phys_bytes bytes; /* how many bytes */

View file

@ -7,7 +7,7 @@
#include <minix/syslib.h>
PUBLIC int _taskcall(who, syscallnr, msgptr)
int who;
endpoint_t who;
int syscallnr;
register message *msgptr;
{

View file

@ -7,7 +7,7 @@
#include <minix/syslib.h>
PUBLIC int _taskcall(who, syscallnr, msgptr)
int who;
endpoint_t who;
int syscallnr;
register message *msgptr;
{