From: Jorrit Herder Date: Thu, 14 Jul 2005 15:15:18 +0000 (+0000) Subject: Renamed some system library functionality. X-Git-Tag: v3.1.0~613 X-Git-Url: http://zhaoyanbai.com/repos/doc/tz-art.htm?a=commitdiff_plain;h=279250889fff2df86688b51e52626bff001e374e;p=minix.git Renamed some system library functionality. --- diff --git a/drivers/dpeth/dp.c b/drivers/dpeth/dp.c index 6c04589cb..0f443be27 100644 --- a/drivers/dpeth/dp.c +++ b/drivers/dpeth/dp.c @@ -13,11 +13,11 @@ ** ** m_type DL_PORT DL_PROC DL_COUNT DL_MODE DL_ADDR ** +------------+---------+---------+--------+-------+---------+ -** | HARD_INT | | | | | | NOTIFICATION|0 +** | HARD_INT | | | | | | ** +------------+---------+---------+--------+-------+---------+ -** | SYN_ALARM | | | | | | NOTIFICATION|1 +** | SYN_ALARM | | | | | | ** +------------+---------+---------+--------+-------+---------+ -** | HARD_STOP | | | | | | NOTIFICATION|4 +** | HARD_STOP | | | | | | ** +------------+---------+---------+--------+-------+---------+ ** | FKEY_PRESSED | | | | | (99) ** +------------+---------+---------+--------+-------+---------+ @@ -49,6 +49,9 @@ ** +------------+---------+---------+---------------+ ** ** $Log$ +** Revision 1.2 2005/07/14 15:15:17 jnherder +** Renamed some system library functionality. +** ** Revision 1.1 2005/06/29 10:16:46 beng ** Import of dpeth 3c501/3c509b/.. ethernet driver by ** Giovanni Falzoni . @@ -557,7 +560,7 @@ PUBLIC int main(void) #endif /* Request function key for debug dumps */ fkeys = sfkeys = 0; bit_set(sfkeys, 8); - if ((fkey_map(fkeys, sfkeys)) != OK) + if ((fkey_map(&fkeys, &sfkeys)) != OK) printf("%s: couldn't program Shift+F8 key (%d)\n", DevName, errno); #ifdef ETH_IGN_PROTO diff --git a/drivers/floppy/floppy.c b/drivers/floppy/floppy.c index fdfab651e..8801881cd 100644 --- a/drivers/floppy/floppy.c +++ b/drivers/floppy/floppy.c @@ -325,7 +325,7 @@ PRIVATE void f_expire_tmrs(struct driver *dp) int s; /* Get the current time to compare the timers against. */ - if ((s=sys_getuptime(&now)) != OK) + if ((s=getuptime(&now)) != OK) panic("FLOPPY","Couldn't get uptime from clock.", s); /* Scan the timers queue for expired timers. Dispatch the watchdog function @@ -354,7 +354,7 @@ tmr_func_t watchdog; /* watchdog function to be called */ int s; /* Get the current time. */ - if ((s=sys_getuptime(&now)) != OK) + if ((s=getuptime(&now)) != OK) panic("FLOPPY","Couldn't get uptime from clock.", s); /* Add the timer to the local timer queue. */ diff --git a/drivers/fxp/fxp.c b/drivers/fxp/fxp.c index ca589dc86..5855354f7 100644 --- a/drivers/fxp/fxp.c +++ b/drivers/fxp/fxp.c @@ -2364,7 +2364,7 @@ tmr_func_t watchdog; /* watchdog function to be called */ int r; /* Get the current time. */ - r= sys_getuptime(&now); + r= getuptime(&now); if (r != OK) panic("FXP","unable to get uptime from clock", r); @@ -2400,7 +2400,7 @@ PRIVATE void fxp_expire_timers() int r; /* Get the current time to compare the timers against. */ - r= sys_getuptime(&now); + r= getuptime(&now); if (r != OK) panic("FXP","Unable to get uptime from clock.", r); diff --git a/drivers/memory/memory.c b/drivers/memory/memory.c index 18957aa2f..96ca3b35d 100644 --- a/drivers/memory/memory.c +++ b/drivers/memory/memory.c @@ -12,7 +12,6 @@ * Apr 29, 2005 added null byte generator (Jorrit N. Herder) * Apr 27, 2005 added random device handling (Jorrit N. Herder) * Apr 09, 2005 added support for boot device (Jorrit N. Herder) - * Sep 03, 2004 secured code with ENABLE_USERPRIV (Jorrit N. Herder) * Jul 26, 2004 moved RAM driver to user-space (Jorrit N. Herder) * Apr 20, 1992 device dependent/independent split (Kees J. Bot) */ @@ -21,6 +20,7 @@ #include "../libdriver/driver.h" #include #include "../../kernel/const.h" +#include "../../kernel/config.h" #include "../../kernel/type.h" #define NR_DEVS 7 /* number of minor devices */ @@ -230,18 +230,12 @@ PRIVATE int m_do_open(dp, m_ptr) struct driver *dp; message *m_ptr; { -/* Check device number on open. Give I/O privileges to a process opening - * /dev/mem or /dev/kmem. This may be needed in case of memory mapped I/O. +/* Check device number on open. (This used to give I/O privileges to a + * process opening /dev/mem or /dev/kmem. This may be needed in case of + * memory mapped I/O. With system calls to do I/O this is no longer needed.) */ if (m_prepare(m_ptr->DEVICE) == NIL_DEV) return(ENXIO); -#if (CHIP == INTEL) && ENABLE_USERPRIV && ENABLE_USERIOPL - if (m_device == MEM_DEV || m_device == KMEM_DEV) { - sys_enable_iop(m_ptr->PROC_NR); - report("MEM", "sys_enable_iop for proc nr", m_ptr->PROC_NR); - } -#endif - return(OK); } diff --git a/drivers/rtl8139/rtl8139.c b/drivers/rtl8139/rtl8139.c index 2c104379f..b075b68fe 100755 --- a/drivers/rtl8139/rtl8139.c +++ b/drivers/rtl8139/rtl8139.c @@ -69,6 +69,7 @@ #include #include #include "../../kernel/const.h" +#include "../../kernel/config.h" #include "../../kernel/type.h" #define tmra_ut timer_t @@ -1902,8 +1903,8 @@ int may_block; reply.DL_PROC = rep->re_client; reply.DL_STAT = status | ((u32_t) err << 16); reply.DL_COUNT = rep->re_read_s; - if (OK != (r = sys_getuptime(&now))) - panic("dp8390","sys_getuptime() failed:", r); + if (OK != (r = getuptime(&now))) + panic("dp8390","getuptime() failed:", r); reply.DL_CLCK = now; r= send(rep->re_client, &reply); diff --git a/drivers/tty/console.c b/drivers/tty/console.c index 2dca24fb1..37894fffc 100644 --- a/drivers/tty/console.c +++ b/drivers/tty/console.c @@ -23,6 +23,7 @@ #include "tty.h" #include "../../kernel/const.h" +#include "../../kernel/config.h" #include "../../kernel/type.h" /* Definitions used by the console driver. */ @@ -746,7 +747,7 @@ PRIVATE void beep() int port_b_val, s; /* Fetch current time in advance to prevent beeping delay. */ - if ((s=sys_getuptime(&now)) != OK) + if ((s=getuptime(&now)) != OK) panic("TTY","Console couldn't get clock's uptime.", s); if (!beeping) { /* Set timer channel 2, square wave, with given frequency. */ diff --git a/drivers/tty/keyboard.c b/drivers/tty/keyboard.c index b4d1f21e8..138a1aa88 100644 --- a/drivers/tty/keyboard.c +++ b/drivers/tty/keyboard.c @@ -18,6 +18,7 @@ #include "tty.h" #include "keymaps/us-std.src" #include "../../kernel/const.h" +#include "../../kernel/config.h" #include "../../kernel/type.h" #include "../../kernel/proc.h" @@ -538,7 +539,11 @@ int scode; /* scan code for a function key */ /* See if an observer is registered and send it a message. */ if (proc_nr != NONE) { m.NOTIFY_TYPE = FKEY_PRESSED; +#if DEAD_CODE notify(proc_nr, &m); +#else + alert(proc_nr); +#endif } return(TRUE); } diff --git a/drivers/tty/tty.c b/drivers/tty/tty.c index dd2b7348e..b935bf536 100644 --- a/drivers/tty/tty.c +++ b/drivers/tty/tty.c @@ -199,10 +199,11 @@ PUBLIC void main(void) case SYN_ALARM: /* fall through */ expire_timers(); /* run watchdogs of expired timers */ continue; /* contine to check for events */ - case HARD_INT: /* hardware interrupt notification */ + case HARD_INT: { /* hardware interrupt notification */ do_interrupt(&tty_mess);/* fetch chars from keyboard */ expire_timers(); /* run watchdogs of expired timers */ continue; /* contine to check for events */ + } case NEW_KMESS: /* new kernel message is available */ do_new_kmess(&tty_mess); continue; @@ -1494,7 +1495,7 @@ PRIVATE void expire_timers(void) int s; /* Get the current time to compare the timers against. */ - if ((s=sys_getuptime(&now)) != OK) + if ((s=getuptime(&now)) != OK) panic("TTY","Couldn't get uptime from clock.", s); /* Scan the queue of timers for expired timers. This dispatch the watchdog @@ -1521,7 +1522,7 @@ int enable; /* set timer if true, otherwise unset */ int s; /* Get the current time to calculate the timeout time. */ - if ((s=sys_getuptime(&now)) != OK) + if ((s=getuptime(&now)) != OK) panic("TTY","Couldn't get uptime from clock.", s); if (enable) { exp_time = now + tty_ptr->tty_termios.c_cc[VTIME] * (HZ/10);