Renamed some system library functionality.

This commit is contained in:
Jorrit Herder 2005-07-14 15:15:18 +00:00
parent 272a8496ac
commit 279250889f
8 changed files with 29 additions and 24 deletions

View file

@ -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 <fgalzoni@inwind.it>.
@ -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

View file

@ -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. */

View file

@ -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);

View file

@ -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 <sys/ioc_memory.h>
#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);
}

View file

@ -69,6 +69,7 @@
#include <unistd.h>
#include <sys/ioc_memory.h>
#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);

View file

@ -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. */

View file

@ -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);
}

View file

@ -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);