From: Xiaoguang Sun Date: Mon, 22 Apr 2013 23:50:45 +0000 (+0000) Subject: Change function prototype to use endpoint_t instead of int X-Git-Tag: v3.3.0~1012 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/NetBSD.png?a=commitdiff_plain;h=20e6c9329f4d8f52b72a5dd96d036b5c42de6b66;p=minix.git Change function prototype to use endpoint_t instead of int --- diff --git a/lib/libc/sys-minix/mmap.c b/lib/libc/sys-minix/mmap.c index a84034e92..19e4d8170 100644 --- a/lib/libc/sys-minix/mmap.c +++ b/lib/libc/sys-minix/mmap.c @@ -116,7 +116,7 @@ int vm_unmap(endpoint_t endpt, void *addr) return _syscall(VM_PROC_NR, VM_SHM_UNMAP, &m); } -unsigned long vm_getphys(int endpt, void *addr) +unsigned long vm_getphys(endpoint_t endpt, void *addr) { message m; int r; diff --git a/servers/inet/inet.h b/servers/inet/inet.h index 684f3b622..a7e2b8629 100644 --- a/servers/inet/inet.h +++ b/servers/inet/inet.h @@ -90,7 +90,7 @@ void inet_panic(void) _NORETURN; do { if (((level) & DEBUG) && (condition)) \ { where(); code; } } while(0) -extern int this_proc; +extern endpoint_t this_proc; extern char version[]; #ifndef HZ diff --git a/servers/vfs/device.c b/servers/vfs/device.c index 2ef5c9bf0..b9984e18d 100644 --- a/servers/vfs/device.c +++ b/servers/vfs/device.c @@ -393,7 +393,7 @@ static int cancel_nblock(struct dmap * dp, int dev_io( int op, /* DEV_READ, DEV_WRITE, DEV_IOCTL, etc. */ dev_t dev, /* major-minor device number */ - int proc_e, /* in whose address space is buf? */ + endpoint_t proc_e, /* in whose address space is buf? */ void *buf, /* virtual address of the buffer */ u64_t pos, /* byte position */ size_t bytes, /* how many bytes to transfer */ @@ -827,7 +827,7 @@ int ctty_io( int no_dev( int UNUSED(op), /* operation, DEV_OPEN or DEV_CLOSE */ dev_t UNUSED(dev), /* device to open or close */ - int UNUSED(proc), /* process to open/close for */ + endpoint_t UNUSED(proc), /* process to open/close for */ int UNUSED(flags) /* mode bits and flags */ ) { @@ -852,7 +852,7 @@ int no_dev_io(endpoint_t UNUSED(proc), message *UNUSED(m)) int clone_opcl( int op, /* operation, DEV_OPEN or DEV_CLOSE */ dev_t dev, /* device to open or close */ - int proc_e, /* process to open/close for */ + endpoint_t proc_e, /* process to open/close for */ int flags /* mode bits and flags */ ) { diff --git a/servers/vfs/dmap.h b/servers/vfs/dmap.h index e5455b691..cd15a1cc4 100644 --- a/servers/vfs/dmap.h +++ b/servers/vfs/dmap.h @@ -14,8 +14,8 @@ */ extern struct dmap { - int(*dmap_opcl) (int, dev_t, int, int); - int(*dmap_io) (int, message *); + int(*dmap_opcl) (int, dev_t, endpoint_t, int); + int(*dmap_io) (endpoint_t, message *); endpoint_t dmap_driver; char dmap_label[LABEL_MAX]; int dmap_flags; diff --git a/servers/vfs/misc.c b/servers/vfs/misc.c index 78c5dd599..754bdb0ef 100644 --- a/servers/vfs/misc.c +++ b/servers/vfs/misc.c @@ -505,7 +505,7 @@ static void free_proc(struct fproc *exiter, int flags) * pm_exit * *===========================================================================*/ void pm_exit(proc) -int proc; +endpoint_t proc; { /* Perform the file system portion of the exit(status) system call. */ int exitee_p; @@ -520,7 +520,7 @@ int proc; * pm_setgid * *===========================================================================*/ void pm_setgid(proc_e, egid, rgid) -int proc_e; +endpoint_t proc_e; int egid; int rgid; { @@ -539,7 +539,7 @@ int rgid; * pm_setgroups * *===========================================================================*/ void pm_setgroups(proc_e, ngroups, groups) -int proc_e; +endpoint_t proc_e; int ngroups; gid_t *groups; { @@ -562,7 +562,7 @@ gid_t *groups; * pm_setuid * *===========================================================================*/ void pm_setuid(proc_e, euid, ruid) -int proc_e; +endpoint_t proc_e; int euid; int ruid; { diff --git a/servers/vfs/proto.h b/servers/vfs/proto.h index 8ea43dc5d..5eec16aee 100644 --- a/servers/vfs/proto.h +++ b/servers/vfs/proto.h @@ -40,12 +40,12 @@ int dev_io(int op, dev_t dev, endpoint_t proc_e, void *buf, u64_t pos, int gen_opcl(int op, dev_t dev, endpoint_t task_nr, int flags); int gen_io(endpoint_t driver_e, message *mess_ptr); int asyn_io(endpoint_t drv_e, message *mess_ptr); -int no_dev(int op, dev_t dev, int proc, int flags); -int no_dev_io(int, message *); +int no_dev(int op, dev_t dev, endpoint_t proc, int flags); +int no_dev_io(endpoint_t, message *); int tty_opcl(int op, dev_t dev, endpoint_t proc, int flags); int ctty_opcl(int op, dev_t dev, endpoint_t proc, int flags); -int clone_opcl(int op, dev_t dev, int proc, int flags); -int ctty_io(int task_nr, message *mess_ptr); +int clone_opcl(int op, dev_t dev, endpoint_t proc, int flags); +int ctty_io(endpoint_t task_nr, message *mess_ptr); int do_ioctl(message *m_out); void pm_setsid(endpoint_t proc_e); void dev_status(endpoint_t drv_e); @@ -62,13 +62,13 @@ int do_mapdriver(void); void init_dmap(void); void init_dmap_locks(void); int dmap_driver_match(endpoint_t proc, int major); -void dmap_endpt_up(int proc_nr, int is_blk); -void dmap_unmap_by_endpt(int proc_nr); +void dmap_endpt_up(endpoint_t proc_nr, int is_blk); +void dmap_unmap_by_endpt(endpoint_t proc_nr); struct dmap *get_dmap(endpoint_t proc_e); struct dmap *get_dmap_by_major(int major); int do_mapdriver(void); int map_service(struct rprocpub *rpub); -void dmap_unmap_by_endpt(int proc_nr); +void dmap_unmap_by_endpt(endpoint_t proc_nr); int map_driver(const char *label, int major, endpoint_t proc_nr, int dev_style, int flags); int map_service(struct rprocpub *rpub); @@ -132,12 +132,12 @@ void thread_cleanup(struct fproc *rfp); void unlock_proc(struct fproc *rfp); /* misc.c */ -void pm_exit(int proc); +void pm_exit(endpoint_t proc); int do_fcntl(message *m_out); -void pm_fork(int pproc, int cproc, int cpid); -void pm_setgid(int proc_e, int egid, int rgid); -void pm_setuid(int proc_e, int euid, int ruid); -void pm_setgroups(int proc_e, int ngroups, gid_t *addr); +void pm_fork(endpoint_t pproc, endpoint_t cproc, pid_t cpid); +void pm_setgid(endpoint_t proc_e, int egid, int rgid); +void pm_setuid(endpoint_t proc_e, int euid, int ruid); +void pm_setgroups(endpoint_t proc_e, int ngroups, gid_t *addr); int do_sync(message *m_out); int do_fsync(message *m_out); void pm_reboot(void); diff --git a/sys/sys/mman.h b/sys/sys/mman.h index f5f3b3887..c4265f563 100644 --- a/sys/sys/mman.h +++ b/sys/sys/mman.h @@ -108,11 +108,11 @@ int munmap(void *, size_t); void * minix_mmap(void *, size_t, int, int, int, off_t); void * minix_mmap_for(endpoint_t, void *, size_t, int, int, int, off_t); int minix_munmap(void *, size_t); -void * vm_remap(int d, int s, void *da, void *sa, size_t si); -void * vm_remap_ro(int d, int s, void *da, void *sa, size_t si); -int vm_unmap(int endpt, void *addr); -unsigned long vm_getphys(int endpt, void *addr); -u8_t vm_getrefcount(int endpt, void *addr); +void * vm_remap(endpoint_t d, endpoint_t s, void *da, void *sa, size_t si); +void * vm_remap_ro(endpoint_t d, endpoint_t s, void *da, void *sa, size_t si); +int vm_unmap(endpoint_t endpt, void *addr); +unsigned long vm_getphys(endpoint_t endpt, void *addr); +u8_t vm_getrefcount(endpoint_t endpt, void *addr); #endif /* __minix */ __END_DECLS