fixed a typo, removed a now unused header file.
Use #include <..> for header files that represent libraries.
static u32_t read_reg(int function, int index);
static void write_reg(int function, int index, u32_t value);
static void init_domain(int index);
-static void init_map(int index);
-static int do_add_phys(message *m);
-static int do_del_phys(message *m);
+static void init_map(unsigned int ix);
static int do_add4pci(message *m);
static void add_range(u32_t busaddr, u32_t size);
static void del_range(u32_t busaddr, u32_t size);
read_reg(DEVF_BASE_LO, index));
}
-static void init_map(int index)
+static void init_map(unsigned int ix)
{
u32_t v, dom, busno, unit0, unit1;
v= (dom << 26) | (dom << 20) | (busno << 12) |
(0 << 11) | (unit1 << 6) |
(0 << 5) | (unit0 << 0);
- write_reg(DEVF_MAP, index, v);
+ write_reg(DEVF_MAP, ix, v);
- printf("after write: DEVF_MAP: 0x%x\n", read_reg(DEVF_MAP, index));
+ printf("after write: DEVF_MAP: 0x%x\n", read_reg(DEVF_MAP, ix));
}
#if 0
}
#endif
-static int do_add_phys(message *m)
-{
- int i;
- phys_bytes start;
- size_t size;
-
- start= m->m2_l1;
- size= m->m2_l2;
-#if 0
- printf("amddev`do_add_phys: got request for 0x%x@0x%x\n",
- size, start);
-#endif
-
- if (start % I386_PAGE_SIZE)
- {
- printf("amddev`do_add_phys: bad start 0x%x\n", start);
- return EINVAL;
- }
- if (size % I386_PAGE_SIZE)
- {
- printf("amddev`do_add_phys: bad size 0x%x\n", size);
- return EINVAL;
- }
- add_range(start, size);
-
- write_reg(DEVF_CR, 0, 0x10);
- for (i= 0; i<1000000; i++)
- {
- if (read_reg(DEVF_CR, 0) & 0x10)
- continue;
- return OK;
- }
- return EBUSY;
-}
-
-static int do_del_phys(message *m)
-{
- phys_bytes start;
- size_t size;
-
- start= m->m2_l1;
- size= m->m2_l2;
-
-#if 0
- printf("amddev`do_del_phys: got request for 0x%x@0x%x\n",
- size, start);
-#endif
-
- if (start % I386_PAGE_SIZE)
- {
- printf("amddev`do_del_phys: bad start 0x%x\n", start);
- return EINVAL;
- }
- if (size % I386_PAGE_SIZE)
- {
- printf("amddev`do_del_phys: bad size 0x%x\n", size);
- return EINVAL;
- }
- del_range(start, size);
-
- write_reg(DEVF_CR, 0, 0x10);
-
- return OK;
-}
static int do_add4pci(message *m)
{
static void add_range(u32_t busaddr, u32_t size)
{
- u32_t o, bit;
+ u32_t o;
#if 0
printf("add_range: mapping 0x%x@0x%x\n", size, busaddr);
for (o= 0; o<size; o += I386_PAGE_SIZE)
{
- bit= (busaddr+o)/I386_PAGE_SIZE;
- table[bit/8] &= ~(1 << (bit % 8));
+ u32_t bit= (busaddr+o)/I386_PAGE_SIZE;
+ table[bit/8] &= ~(1U << (bit % 8));
}
}
# programs, flags, etc.
MAKE = exec make
CC = exec cc
-CFLAGS = -I$i $(CPROFILE)
+CFLAGS = -I$i -I.. $(CPROFILE)
LDFLAGS = -i -L../libdriver
LIBS = -ldriver -lsys -ltimers
};
/* Timeouts and max retries. */
-int timeout_ticks = DEF_TIMEOUT_TICKS, max_errors = MAX_ERRORS;
-long w_standard_timeouts = 0, w_pci_debug = 0, w_instance = 0,
- disable_dma = 0, atapi_debug = 0, w_identify_wakeup_ticks,
- wakeup_ticks, w_atapi_dma;
+PRIVATE int timeout_ticks = DEF_TIMEOUT_TICKS;
+PRIVATE int max_errors = MAX_ERRORS;
+PRIVATE long w_standard_timeouts = 0;
+PRIVATE long w_pci_debug = 0;
+PRIVATE long w_instance = 0;
+PRIVATE long disable_dma = 0;
+PRIVATE long atapi_debug = 0;
+PRIVATE long w_identify_wakeup_ticks;
+PRIVATE long wakeup_ticks;
+PRIVATE long w_atapi_dma;
-int w_testing = 0, w_silent = 0;
+PRIVATE int w_testing = 0;
+PRIVATE int w_silent = 0;
-int w_next_drive = 0;
+PRIVATE int w_next_drive = 0;
-u32_t system_hz;
+PRIVATE u32_t system_hz;
/* The struct wini is indexed by controller first, then drive (0-3).
* Controller 0 is always the 'compatability' ide controller, at
} wini[MAX_DRIVES], *w_wn;
PRIVATE int w_device = -1;
-PRIVATE int w_controller = -1;
-PRIVATE int w_major = -1;
-PRIVATE int win_tasknr; /* my task number */
PUBLIC int w_command; /* current command in execution */
-PRIVATE u8_t w_byteval; /* used for SYS_IRQCTL */
PRIVATE int w_drive; /* selected drive */
-PRIVATE int w_controller; /* selected controller */
PRIVATE struct device *w_dv; /* device's base and size */
/* Unfortunately, DMA_SECTORS and DMA_BUF_SIZE are already defined libdriver
#undef sys_outb
#undef sys_inb
-#undef sys_outw
-#undef sys_inw
#undef sys_outl
-#undef sys_inl
FORWARD _PROTOTYPE( int at_out, (int line, u32_t port, u32_t value,
char *typename, int type));
#define sys_outb(p, v) at_out(__LINE__, (p), (v), "outb", _DIO_BYTE)
#define sys_inb(p, v) at_in(__LINE__, (p), (v), "inb", _DIO_BYTE)
-#define sys_outw(p, v) at_out(__LINE__, (p), (v), "outw", _DIO_WORD)
-#define sys_inw(p, v) at_in(__LINE__, (p), (v), "inw", _DIO_WORD)
#define sys_outl(p, v) at_out(__LINE__, (p), (v), "outl", _DIO_LONG)
-#define sys_inl(p, v) at_in(__LINE__, (p), (v), "inl", _DIO_LONG)
/* Entry points to this driver. */
PRIVATE struct driver w_dtab = {
/*===========================================================================*
* w_do_open *
*===========================================================================*/
-PRIVATE int w_do_open(dp, m_ptr)
-struct driver *dp;
-message *m_ptr;
+PRIVATE int w_do_open(struct driver *dp, message *m_ptr)
{
/* Device open: Initialize the controller and read the partition table. */
#if VERBOSE
printf("%s: probe failed\n", w_name());
#endif
- if (wn->state & DEAF) w_reset();
+ if (wn->state & DEAF){
+ int err = w_reset();
+ if( err != OK ){
+ return err;
+ }
+ }
wn->state = IGNORING;
return(ENXIO);
}
/*===========================================================================*
* check_dma *
*===========================================================================*/
-void
+PRIVATE void
check_dma(struct wini *wn)
{
unsigned long dma_status = 0;
return com_out(&cmd);
}
-void stop_dma(struct wini *wn)
+PRIVATE void stop_dma(struct wini *wn)
{
int r;
if (r != 0) panic("at_wini", "stop_dma: sys_outb failed", r);
}
-void start_dma(struct wini *wn, int do_write)
+PRIVATE void start_dma(struct wini *wn, int do_write)
{
u32_t v;
int r;
if (r != 0) panic("at_wini", "start_dma: sys_outb failed", r);
}
-int error_dma(struct wini *wn)
+PRIVATE int error_dma(struct wini *wn)
{
int r;
u32_t v;
/*===========================================================================*
* w_do_close *
*===========================================================================*/
-PRIVATE int w_do_close(dp, m_ptr)
-struct driver *dp;
-message *m_ptr;
+PRIVATE int w_do_close(struct driver *dp, message *m_ptr)
{
/* Device close: Release a device. */
if (w_prepare(m_ptr->DEVICE) == NIL_DEV)
}
}
}
-
return(OK);
}
/* Should unlock the device. For now do nothing. (XXX) */
}
-void sense_request(void)
+PRIVATE void sense_request(void)
{
int r, i;
static u8_t sense[100], packet[ATAPI_PACKETSIZE];
#define STSTR(a) if (status & STATUS_ ## a) { strcat(str, #a); strcat(str, " "); }
#define ERRSTR(a) if (e & ERROR_ ## a) { strcat(str, #a); strcat(str, " "); }
-char *strstatus(int status)
+PRIVATE char *strstatus(int status)
{
static char str[200];
str[0] = '\0';
return str;
}
-char *strerr(int e)
+PRIVATE char *strerr(int e)
{
static char str[200];
str[0] = '\0';
-#include "../drivers.h"
-#include "../libdriver/driver.h"
-#include "../libdriver/drvlib.h"
-
-_PROTOTYPE(int main, (int argc, char *argv[]));
+#include <drivers.h>
+#include <libdriver/driver.h>
+#include <libdriver/drvlib.h>
#define VERBOSE 0 /* display identify messages during boot */
#define ENABLE_ATAPI 1 /* add ATAPI cd-rom support to driver */
# programs, flags, etc.
MAKE = exec make
CC = exec cc
-CFLAGS = -I$i $(CPROFILE)
+CFLAGS = -I$i -I.. $(CPROFILE)
LDFLAGS = -i -L../libdriver
LIBS = -ldriver -lsys -lsys -ltimers
* 14 May 2000 by Kees J. Bot: d-d/i rewrite.
*/
-#include "../drivers.h"
-#include "../libdriver/driver.h"
-#include "../libdriver/drvlib.h"
+#include <drivers.h>
+#include <libdriver/driver.h>
+#include <libdriver/drvlib.h>
#include <minix/sysutil.h>
#include <minix/safecopies.h>
#include <sys/ioc_disk.h>
#define ME "BIOS_WINI"
-/* Error codes */
-#define ERR (-1) /* general error */
-
/* Parameters for the disk drive. */
#define MAX_DRIVES 8 /* this driver supports 8 drives (d0 - d7)*/
-#define MAX_SECS 255 /* bios can transfer this many sectors */
#define NR_MINORS (MAX_DRIVES * DEV_PER_DRIVE)
#define SUB_PER_DRIVE (NR_PARTITIONS * NR_PARTITIONS)
#define NR_SUBDEVS (MAX_DRIVES * SUB_PER_DRIVE)
PRIVATE phys_bytes bios_buf_phys;
PRIVATE int remap_first = 0; /* Remap drives for CD HD emulation */
#define BIOSBUF 16384
-PRIVATE cp_grant_id_t my_bios_grant_id;
_PROTOTYPE(int main, (void) );
FORWARD _PROTOTYPE( struct device *w_prepare, (int device) );
_PROTOTYPE( PRIVATE u32_t io_inl, (u16_t); );
_PROTOTYPE( PRIVATE void io_outl, (u16_t, u32_t); );
_PROTOTYPE( PRIVATE void do_conf, (message *); );
-_PROTOTYPE( PRIVATE void do_fkey, (message *); );
_PROTOTYPE( PRIVATE void do_get_name, (message *); );
_PROTOTYPE( PRIVATE void do_get_stat_s, (message *); );
_PROTOTYPE( PRIVATE void do_interrupt, (dpeth_t *); );
/* Error messages */
static char str_CopyErrMsg[] = "unable to read/write user data";
static char str_PortErrMsg[] = "illegal port";
-static char str_RecvErrMsg[] = "receive failed";
static char str_SendErrMsg[] = "send failed";
static char str_SizeErrMsg[] = "illegal packet size";
-static char str_TypeErrMsg[] = "illegal message type";
static char str_UmapErrMsg[] = "Unable to sys_umap";
static char str_BusyErrMsg[] = "Send/Recv failed: busy";
static char str_StatErrMsg[] = "Unable to send stats";
static char str_AlignErrMsg[] = "Bad align of buffer/descriptor";
static char str_DevName[] = "dec21140A:eth#?";
-extern int errno;
-static dpeth_t de_table[DE_PORT_NR];
-static char *progname;
+PRIVATE dpeth_t de_table[DE_PORT_NR];
+PRIVATE const char *progname;
int sef_cb_init(int type, sef_init_info_t *info)
{
return;
}
-PRIVATE void do_fkey(message *mp)
+PRIVATE void de_first_init(dpeth_t *dep)
{
- dpeth_t *dep;
- int port,i;
-
- printf("\n");
- for (port = 0, dep = de_table; port < DE_PORT_NR; port += 1, dep += 1) {
- if (dep->de_mode == DEM_DISABLED) continue;
- printf("%s status:\n", dep->de_name);
- printf("hwaddr: ");
- for(i=0;i<6;i++)
- printf("%02X%c",dep->de_address.ea_addr[i], i!=5?':':'\n');
- printf("Tx packets: %-16d Tx kb: %d.%02d\n", dep->de_stat.ets_packetT,
- dep->bytes_tx/1024,
- (int)(((dep->bytes_tx%1024)/1024.0)*100));
- printf("Rx packets: %-16d Rx kb: %d.%02d\n", dep->de_stat.ets_packetR,
- dep->bytes_rx/1024,
- (int)(((dep->bytes_rx%1024)/1024.0)*100));
- printf("Rx errors: %-16d Tx errors: %d\n",
- dep->de_stat.ets_recvErr,
- dep->de_stat.ets_sendErr);
- }
- return;
-}
-
-PRIVATE void de_first_init(dpeth_t *dep){
int i,j,r;
vir_bytes descr_vir = dep->sendrecv_descr_buf;
vir_bytes buffer_vir = dep->sendrecv_buf;
static dpeth_t de_table[DE_PORT_NR];
static u16_t eth_ign_proto;
-static char *progname;
+static const char *progname;
u32_t system_hz;
char *dpc_envvar;
} dp_conf_t;
-dp_conf_t dp_conf[]= /* Card addresses */
+PRIVATE dp_conf_t dp_conf[]= /* Card addresses */
{
/* I/O port, IRQ, Buffer address, Env. var. */
{ 0x280, 3, 0xD0000, "DPETH0" },
_PROTOTYPE( typedef int (*testf_t), (dpeth_t *dep, int pos, u8_t *pat) );
-u8_t pat0[]= { 0x00, 0x00, 0x00, 0x00 };
-u8_t pat1[]= { 0xFF, 0xFF, 0xFF, 0xFF };
-u8_t pat2[]= { 0xA5, 0x5A, 0x69, 0x96 };
-u8_t pat3[]= { 0x96, 0x69, 0x5A, 0xA5 };
+PRIVATE u8_t pat0[]= { 0x00, 0x00, 0x00, 0x00 };
+PRIVATE u8_t pat1[]= { 0xFF, 0xFF, 0xFF, 0xFF };
+PRIVATE u8_t pat2[]= { 0xA5, 0x5A, 0x69, 0x96 };
+PRIVATE u8_t pat3[]= { 0x96, 0x69, 0x5A, 0xA5 };
_PROTOTYPE( static int test_8, (dpeth_t *dep, int pos, u8_t *pat) );
_PROTOTYPE( static int test_16, (dpeth_t *dep, int pos, u8_t *pat) );
/*===========================================================================*
* ne_probe *
*===========================================================================*/
-int ne_probe(dep)
-dpeth_t *dep;
+int ne_probe(dpeth_t *dep)
{
int byte;
int i;
return;
}
-/*
-** Name: unsigned int insw(unsigned short int port, int proc_nr, void *buffer, int count);
-** Function: Reads a sequence of words from specified i/o port to user space buffer.
-*/
-PUBLIC void insw(unsigned short int port, int proc_nr, void *buffer, int count)
-{
- int rc;
-
- if ((rc = sys_insw(port, proc_nr, buffer, count)) != OK)
- warning("insw", rc);
- return;
-}
/*
** Name: void outb(unsigned short int port, unsigned long value);
return;
}
-/*
-** Name: void outsw(unsigned short int port, int proc_nr, void *buffer, int count);
-** Function: Writes a sequence of bytes from user space to specified i/o port.
-*/
-PUBLIC void outsw(unsigned short port, int proc_nr, void *buffer, int count)
-{
- int rc;
-
- if ((rc = sys_outsw(port, proc_nr, buffer, count)) != OK)
- warning("outsw", rc);
- return;
-}
-
#else
#error To be implemented
#endif /* USE_IOPL */
*/
extern int errno;
static dpeth_t de_table[DE_PORT_NR];
-static char *progname;
+static const char *progname;
typedef struct dp_conf { /* Configuration description structure */
port_t dpc_port;
/* SEF functions and variables. */
FORWARD _PROTOTYPE( void sef_local_startup, (void) );
FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-EXTERN int env_argc;
EXTERN char **env_argv;
/*
/* This is the master header for all device drivers. It includes some other
* files and defines the principal constants.
*/
+
+#ifndef _INC_DRIVERS_H
+#define _INC_DRIVERS_H
+
#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */
#define _MINIX 1 /* tell headers to include MINIX stuff */
#define _SYSTEM 1 /* get negative error number in <errno.h> */
#include <errno.h>
#include <unistd.h>
+#endif
0,
};
-PRIVATE char *progname;
+PRIVATE const char *progname;
PRIVATE e1000_t e1000_table[E1000_PORT_NR];
_PROTOTYPE( PRIVATE void e1000_init, (message *mp) );
_PROTOTYPE( PRIVATE void e1000_interrupt, (message *mp) );
_PROTOTYPE( PRIVATE void e1000_signal, (void) );
_PROTOTYPE( PRIVATE int e1000_link_changed, (e1000_t *e) );
-_PROTOTYPE( PRIVATE void e1000_report_link, (e1000_t *e) );
_PROTOTYPE( PRIVATE void e1000_stop, (void) );
_PROTOTYPE( PRIVATE e1000_t * e1000_port, (int port) );
_PROTOTYPE( PRIVATE uint32_t e1000_reg_read, (e1000_t *e, uint32_t reg) );
return FALSE;
}
-/*===========================================================================*
- * e1000_report_link *
- *===========================================================================*/
-PRIVATE void e1000_report_link(e)
-e1000_t *e;
-{
- E1000_DEBUG(4, ("%s: report_link()\n", e->name));
-}
-
/*===========================================================================*
* e1000_stop *
*===========================================================================*/
# programs, flags, etc.
CC = cc
-CFLAGS = -DDEBUG=1 -DDEBUG2=0
+CFLAGS = -I.. -DDEBUG=1 -DDEBUG2=0
LDFLAGS =
LIBS = -lsys
#include <sys/types.h>
-unsigned long crctab[] = {
+static unsigned long crctab[] = {
0x7fffffff,
0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e,
/*===========================================================================*
* single_revoke *
*===========================================================================*/
-void single_revoke(cp_grant_id_t gid, iovec_s_t vector[NR_IOREQS],
+PRIVATE void single_revoke(cp_grant_id_t gid, iovec_s_t vector[NR_IOREQS],
size_t *sizep, int count)
{
/* Revoke all grants associated with a request to a single driver.
int MAIN_MINOR = -1; /* main partition minor nr */
int BACKUP_MINOR = -1; /* backup partition minor nr */
-struct optset optset_table[] = {
+PRIVATE struct optset optset_table[] = {
{ "label0", OPT_STRING, MAIN_LABEL, LABEL_SIZE },
{ "label1", OPT_STRING, BACKUP_LABEL, LABEL_SIZE },
{ "minor0", OPT_INT, &MAIN_MINOR, 10 },
* reflect the addition of 16 longwords of new data. MD5Update blocks
* the data and converts bytes into longwords for this routine.
*/
-void
+static void
MD5Transform (buf, inraw)
uint32 buf[4];
const unsigned char inraw[64];
* May 2009 (D.C. van Moolenbroek)
*/
-#define _MINIX 1
#include <stdlib.h>
#include <string.h>
#include <minix/config.h>
# programs, flags, etc.
MAKE = exec make
CC = exec cc
-CFLAGS = -I$i $(CPROFILE)
+CFLAGS = -I.. -I$i $(CPROFILE)
LDFLAGS = -i -L../libdriver
LIBS = -ldriver -lsys -ltimers
-#include "../drivers.h"
-#include "../libdriver/driver.h"
-#include "../libdriver/drvlib.h"
-
-_PROTOTYPE(int main, (void));
-
+#include <drivers.h>
+#include <libdriver/driver.h>
+#include <libdriver/drvlib.h>
#define tmra_ut timer_t
#define tmra_inittimer(tp) tmr_inittimer(tp)
-#define Proc_number(p) proc_number(p)
#define debug 0
#define RAND_UPDATE /**/
#define printW() ((void)0)
-#define vm_1phys2bus(p) (p)
#include "assert.h"
#include "fxp.h"
/* ignore interrupt for the moment */
#define interrupt(x) 0
-union tmpbuf
+PRIVATE union tmpbuf
{
char pad[4096];
struct cbl_conf cc;
#define FT_82559 0x4
#define FT_82801 0x8
-static fxp_t *fxp_table;
-phys_bytes fxp_table_phys;
+PRIVATE fxp_t *fxp_table;
+PRIVATE phys_bytes fxp_table_phys;
-static u16_t eth_ign_proto;
-static tmra_ut fxp_watchdog;
-static char *progname;
+PRIVATE u16_t eth_ign_proto;
+PRIVATE tmra_ut fxp_watchdog;
+PRIVATE const char *progname;
-extern int errno;
-
-u32_t system_hz;
+PRIVATE u32_t system_hz;
#define fxp_inb(port, offset) (do_inb((port) + (offset)))
-#define fxp_inw(port, offset) (do_inw((port) + (offset)))
#define fxp_inl(port, offset) (do_inl((port) + (offset)))
#define fxp_outb(port, offset, value) (do_outb((port) + (offset), (value)))
-#define fxp_outw(port, offset, value) (do_outw((port) + (offset), (value)))
#define fxp_outl(port, offset, value) (do_outl((port) + (offset), (value)))
_PROTOTYPE( static void fxp_init, (message *mp) );
_PROTOTYPE( static void fxp_getstat, (message *mp) );
_PROTOTYPE( static void fxp_getstat_s, (message *mp) );
_PROTOTYPE( static void fxp_getname, (message *mp) );
-_PROTOTYPE( static int fxp_handler, (fxp_t *fp) );
+_PROTOTYPE( static void fxp_handler, (fxp_t *fp) );
_PROTOTYPE( static void fxp_check_ints, (fxp_t *fp) );
_PROTOTYPE( static void fxp_watchdog_f, (timer_t *tp) );
_PROTOTYPE( static int fxp_link_changed, (fxp_t *fp) );
/*===========================================================================*
* fxp_getname *
*===========================================================================*/
-static void fxp_getname(mp)
-message *mp;
+static void fxp_getname(message *mp)
{
int r;
/*===========================================================================*
* fxp_handler *
*===========================================================================*/
-static int fxp_handler(fp)
-fxp_t *fp;
+static void fxp_handler(fxp_t *fp)
{
int port;
u16_t isr;
printf("fxp_handler: unhandled interrupt: isr = 0x%02x\n",
isr);
}
-
- return 1;
}
/*===========================================================================*
* fxp_check_ints *
*===========================================================================*/
-static void fxp_check_ints(fp)
-fxp_t *fp;
+static void fxp_check_ints(fxp_t *fp)
{
int n, fxp_flags, prev_tail;
int fxp_tx_tail, fxp_tx_nbuf, fxp_tx_threshold;
Created: Nov 2004 by Philip Homburg <philip@f-mnx.phicoh.com>
*/
+#ifndef _INC_FXP_H
+#define _INC_FXP_H
+
#define VERBOSE 0 /* display output during intialization */
/* Revisions in PCI_REV */
/*
* $PchId: fxp.h,v 1.1 2004/11/23 14:34:03 philip Exp $
*/
+
+#endif
Definitions for the Media Independent (Ethernet) Interface
*/
+#ifndef _INC_MII_H
+#define _INC_MII_H
+
/* Registers in the Machine Independent Interface (MII) to the PHY.
* IEEE 802.3 (2000 Edition) Clause 22.
*/
_PROTOTYPE( void mii_print_stat_speed, (U16_t stat, U16_t extstat) );
_PROTOTYPE( void mii_print_techab, (U16_t techab) );
+#endif
/*
* $PchId: mii.h,v 1.1 2004/12/27 13:33:30 philip Exp $
*/
/* Accesses Lance Control and Status Registers */
_PROTOTYPE( static u8_t in_byte, (port_t port) );
_PROTOTYPE( static u16_t in_word, (port_t port) );
-_PROTOTYPE( static void out_byte, (port_t port, u8_t value) );
_PROTOTYPE( static void out_word, (port_t port, u16_t value) );
_PROTOTYPE( static u16_t read_csr, (port_t ioaddr, u16_t csrno) );
_PROTOTYPE( static void write_csr, (port_t ioaddr, u16_t csrno, u16_t value));
static int tx_slot_nr = 0; /* Tx-slot number */
static int cur_tx_slot_nr = 0; /* Tx-slot number */
static char isstored[TX_RING_SIZE]; /* Tx-slot in-use */
-static char *progname;
+static const char *progname;
phys_bytes lance_buf_phys;
/* SEF functions and variables. */
FORWARD _PROTOTYPE( void sef_local_startup, (void) );
FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-EXTERN int env_argc;
EXTERN char **env_argv;
/*===========================================================================*
return value;
}
-/*===========================================================================*
- * out_byte *
- *===========================================================================*/
-static void out_byte(port_t port, u8_t value)
-{
- int r;
-
- r= sys_outb(port, value);
- if (r != OK)
- panic("lance","sys_outb failed", r);
-}
/*===========================================================================*
* out_word *
# programs, flags, etc.
MAKE = exec make
CC = exec cc
-CFLAGS = -I$i $(CPROFILE)
+CFLAGS = -I.. -I$i $(CPROFILE)
LDFLAGS = -i -L../libdriver
LIBS = -ldriver -lsys
LIB_DEP = ../libdriver/libdriver.a
/* Includes. */
-#include "../drivers.h"
-#include "../libdriver/driver.h"
+#include <drivers.h>
+#include <libdriver/driver.h>
#include <minix/type.h>
#include <minix/const.h>
#include <minix/com.h>
# programs, flags, etc.
CC = exec cc
-CFLAGS = -I$i $(CPROFILE)
+CFLAGS = -I.. -I$i $(CPROFILE)
LDFLAGS = -i
LIBS = -lsys -ltimers
#include "hermes.h"
-PRIVATE int this_proc;
-
/*****************************************************************************
* milli_delay *
* *
* Wait msecs milli seconds *
*****************************************************************************/
-void milli_delay(unsigned int msecs)
+PRIVATE void milli_delay(unsigned int msecs)
{
micro_delay((long)msecs * 1000);
}
hw->io_space = io_space;
hw->reg_spacing = reg_spacing;
hw->inten = 0x0;
- this_proc = getprocnr();
}
}
+/*****************************************************************************
+ * hermes_present *
+ * *
+ * Check whether we have access to the card. Does the SWSUPPORT0 contain the *
+ * value we put in it earlier? *
+ *****************************************************************************/
+PRIVATE int hermes_present (hermes_t * hw) {
+ int i = hermes_read_reg (hw, HERMES_SWSUPPORT0) == HERMES_MAGIC;
+ if (!i)
+ printf("Hermes: Error, card not present?\n");
+ return i;
+}
+
/*****************************************************************************
* hermes_init *
return err;
}
+/*****************************************************************************
+ * hermes_write_words *
+ * *
+ * Write a sequence of words of the buffer to the card *
+ *****************************************************************************/
+void hermes_write_words (hermes_t * hw, int off, const void *buf,
+ unsigned count) {
+ int i = 0;
+
+ for (i = 0; i < count; i++) {
+ hermes_write_reg (hw, off, *((u16_t *) buf + i));
+ }
+}
+
/*****************************************************************************
* hermes_bap_pwrite *
* *
}
-/*****************************************************************************
- * hermes_present *
- * *
- * Check whether we have access to the card. Does the SWSUPPORT0 contain the *
- * value we put in it earlier? *
- *****************************************************************************/
-int hermes_present (hermes_t * hw) {
- int i = hermes_read_reg (hw, HERMES_SWSUPPORT0) == HERMES_MAGIC;
- if (!i)
- printf("Hermes: Error, card not present?\n");
- return i;
-}
-
/*****************************************************************************
* hermes_set_irqmask *
}
}
-/*****************************************************************************
- * hermes_write_words *
- * *
- * Write a sequence of words of the buffer to the card *
- *****************************************************************************/
-void hermes_write_words (hermes_t * hw, int off, const void *buf,
- unsigned count) {
- int i = 0;
-
- for (i = 0; i < count; i++) {
- hermes_write_reg (hw, off, *((u16_t *) buf + i));
- }
-}
-
/*****************************************************************************
* hermes_read_reg *
#ifndef _HERMES_H
#define _HERMES_H
-#include "../drivers.h"
+#include <drivers.h>
#include <net/gen/ether.h>
#include <net/gen/eth_io.h>
#include <net/hton.h>
u16_t offset));
_PROTOTYPE (void hermes_read_words, (hermes_t * hw, int off, void *buf,
unsigned count));
-_PROTOTYPE (void hermes_write_words, (hermes_t * hw, int off,
- const void *buf, unsigned count));
_PROTOTYPE (int hermes_read_ltv, (hermes_t * hw, int bap, u16_t rid,
unsigned buflen, u16_t * length,
void *buf));
_PROTOTYPE (int hermes_write_ltv, (hermes_t * hw, int bap, u16_t rid,
u16_t length, const void *value));
-_PROTOTYPE (int hermes_present, (hermes_t * hw));
-_PROTOTYPE (int myfunc_read, (vir_bytes src));
-_PROTOTYPE (void myfunc_write, (vir_bytes dst, int val));
-_PROTOTYPE (void hermes_print_ioarea, (hermes_t * hw, int first_reg,
- int last_reg));
_PROTOTYPE (int hermes_set_irqmask, (hermes_t * hw, u16_t events));
_PROTOTYPE (u16_t hermes_get_irqmask, (hermes_t * hw));
_PROTOTYPE (int hermes_read_wordrec, (hermes_t * hw, int bap, u16_t rid,
_PROTOTYPE (int hermes_write_wordrec, (hermes_t * hw, int bap, u16_t rid,
u16_t word));
_PROTOTYPE (int hermes_cor_reset, (hermes_t *hw));
-_PROTOTYPE (void milli_delay, (unsigned int msecs));
#endif /* _HERMES_H */
#include <ibm/pci.h>
#include <minix/ds.h>
#include <minix/endpoint.h>
-#include "../../kernel/const.h"
-#include "../../kernel/config.h"
-#include "../../kernel/type.h"
+#include <kernel/const.h>
+#include <kernel/config.h>
+#include <kernel/type.h>
-#define tmra_ut timer_t
-#define tmra_inittimer(tp) tmr_inittimer(tp)
#define VERBOSE 1 /* display message during init */
PRIVATE struct pcitab {
};
-static tmra_ut or_watchdog;
+static timer_t or_watchdog;
#include <stdio.h>
#include <stdlib.h>
#define IRQ_BAP 1
#define ETH_HLEN 14
-static int or_nr_task = ANY;
-static t_or or_table[OR_PORT_NR];
+PRIVATE t_or or_table[OR_PORT_NR];
struct ethhdr {
u8_t h_dest[ETH_ALEN];
********************************************************************/
/* The frequency of each channel in MHz */
-const long channel_frequency[] = {
+PRIVATE const long channel_frequency[] = {
2412, 2417, 2422, 2427, 2432, 2437, 2442,
2447, 2452, 2457, 2462, 2467, 2472, 2484
};
PRIVATE message m;
PRIVATE int int_event_check; /* set to TRUE if events arrived */
-u32_t system_hz;
+PRIVATE u32_t system_hz;
-static char *progname;
-extern int errno;
+PRIVATE const char *progname;
/* SEF functions and variables. */
FORWARD _PROTOTYPE( void sef_local_startup, (void) );
FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-EXTERN int env_argc;
EXTERN char **env_argv;
/*****************************************************************************
first_time = 0;
or_pci_conf (); /* Configure PCI devices. */
- tmra_inittimer(&or_watchdog);
+ tmr_inittimer(&or_watchdog);
/* Use a synchronous alarm instead of a watchdog timer. */
sys_setalarm(system_hz, 0);
}
PRIVATE int done_status; /* status of last output completion */
PRIVATE int oleft; /* bytes of output left in obuf */
PRIVATE unsigned char obuf[128]; /* output buffer */
-PRIVATE unsigned char *optr; /* ptr to next char in obuf to print */
+PRIVATE unsigned const char *optr; /* ptr to next char in obuf to print */
PRIVATE int orig_count; /* original byte count */
PRIVATE int port_base; /* I/O port for printer */
PRIVATE int proc_nr; /* user requesting the printing */
PUBLIC int writing; /* nonzero while write is in progress */
PRIVATE int irq_hook_id; /* id of irq hook at kernel */
-extern int errno; /* error number */
-
FORWARD _PROTOTYPE( void do_cancel, (message *m_ptr) );
FORWARD _PROTOTYPE( void output_done, (void) );
FORWARD _PROTOTYPE( void do_write, (message *m_ptr, int safe) );
#include <sys/types.h>
-#include <sys/stat.h>
#include <stdlib.h>
#include <unistd.h>
-#include <fcntl.h>
#include <stdio.h>
-#include <string.h>
#include <time.h>
#include <errno.h>
#include <signal.h>
#include <minix/syslib.h>
#include <minix/sysutil.h>
#include <minix/com.h>
-#include <minix/portio.h>
#include <ibm/cmos.h>
#include <sys/svrctl.h>
int Wflag = 0; /* Also set the CMOS clock register bits. */
int y2kflag = 0; /* Interpret 1980 as 2000 for clock with Y2K bug. */
-char clocktz[128]; /* Timezone of the clock. */
-
#define MACH_ID_ADDR 0xFFFFE /* BIOS Machine ID at FFFF:000E */
#define PC_AT 0xFC /* Machine ID byte for PC/AT,
# programs, flags, etc.
MAKE = exec make
CC = exec cc
-CFLAGS = -I$i $(CPROFILE)
+CFLAGS = -I.. -I../.. -I$i $(CPROFILE)
LDFLAGS = -i
-LIBS = -lsys -ltimers
+LIBS = -lsys -ltimers
OBJ = rtl8139.o liveupdate.o
PRIVATE message m;
PRIVATE int int_event_check; /* set to TRUE if events arrived */
-static char *progname;
-extern int errno;
-u32_t system_hz;
+static const char *progname;
+PRIVATE u32_t system_hz;
/* SEF functions and variables. */
FORWARD _PROTOTYPE( void sef_local_startup, (void) );
Created: Aug 2003 by Philip Homburg <philip@cs.vu.nl>
*/
-#include "../drivers.h"
+#include <drivers.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <unistd.h>
#include <sys/ioc_memory.h>
-#include "../../kernel/const.h"
-#include "../../kernel/config.h"
-#include "../../kernel/type.h"
+#include <kernel/const.h>
+#include <kernel/config.h>
+#include <kernel/type.h>
#define RL_IDR 0x00 /* Ethernet address
* Note: RL_9346CR_EEM_CONFIG mode is
# programs, flags, etc.
MAKE = exec make
CC = exec cc
-CFLAGS = -I$i $(CPROFILE)
+CFLAGS = -I.. -I../.. -I$i $(CPROFILE)
LDFLAGS = -i
LIBS = -lsys -ltimers
*
*/
-#include "../drivers.h"
+#include <drivers.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <assert.h>
#include <unistd.h>
-#include "../../kernel/const.h"
-#include "../../kernel/config.h"
-#include "../../kernel/type.h"
+#include <kernel/const.h>
+#include <kernel/config.h>
+#include <kernel/type.h>
-#define tmra_ut timer_t
-#define tmra_inittimer(tp) tmr_inittimer(tp)
-#define Proc_number(p) proc_number(p)
#define debug 1
#define printW() ((void)0)
static re_t re_table[RE_PORT_NR];
static u16_t eth_ign_proto;
-static tmra_ut rl_watchdog;
+static timer_t rl_watchdog;
FORWARD _PROTOTYPE(unsigned my_inb, (U16_t port));
FORWARD _PROTOTYPE(unsigned my_inw, (U16_t port));
first_time = 0;
rl_pci_conf(); /* Configure PCI devices. */
- tmra_inittimer(&rl_watchdog);
+ tmr_inittimer(&rl_watchdog);
/* Use a synchronous alarm instead of a watchdog timer. */
sys_setalarm(system_hz, 0);
}
#define DEFAULT_STEREO 0 /* 0 = mono, 1 = stereo */
/* DMA port addresses */
-#define DMA8_ADDR ((SB_DMA_8 & 3) << 1) + 0x00
-#define DMA8_COUNT ((SB_DMA_8 & 3) << 1) + 0x01
+#define DMA8_ADDR (((SB_DMA_8 & 3) << 1) + 0x00)
+#define DMA8_COUNT (((SB_DMA_8 & 3) << 1) + 0x01)
#define DMA8_MASK 0x0A
#define DMA8_MODE 0x0B
#define DMA8_CLEAR 0x0C
#endif
-#define DMA16_ADDR ((SB_DMA_16 & 3) << 2) + 0xC0
-#define DMA16_COUNT ((SB_DMA_16 & 3) << 2) + 0xC2
+#define DMA16_ADDR (((SB_DMA_16 & 3) << 2) + 0xC0)
+#define DMA16_COUNT (((SB_DMA_16 & 3) << 2) + 0xC2)
#define DMA16_MASK 0xD4
#define DMA16_MODE 0xD6
#define DMA16_CLEAR 0xD8
/* DMA modes */
-#define DMA16_AUTO_PLAY 0x58 + (SB_DMA_16 & 3)
-#define DMA16_AUTO_REC 0x54 + (SB_DMA_16 & 3)
-#define DMA8_AUTO_PLAY 0x58 + SB_DMA_8
-#define DMA8_AUTO_REC 0x54 + SB_DMA_8
+#define DMA16_AUTO_PLAY (0x58 + (SB_DMA_16 & 3))
+#define DMA16_AUTO_REC (0x54 + (SB_DMA_16 & 3))
+#define DMA8_AUTO_PLAY (0x58 + SB_DMA_8)
+#define DMA8_AUTO_REC (0x54 + SB_DMA_8)
/* IO ports for soundblaster */
-#define DSP_RESET 0x6 + SB_BASE_ADDR
-#define DSP_READ 0xA + SB_BASE_ADDR
-#define DSP_WRITE 0xC + SB_BASE_ADDR
-#define DSP_COMMAND 0xC + SB_BASE_ADDR
-#define DSP_STATUS 0xC + SB_BASE_ADDR
-#define DSP_DATA_AVL 0xE + SB_BASE_ADDR
-#define DSP_DATA16_AVL 0xF + SB_BASE_ADDR
-#define MIXER_REG 0x4 + SB_BASE_ADDR
-#define MIXER_DATA 0x5 + SB_BASE_ADDR
-#define OPL3_LEFT 0x0 + SB_BASE_ADDR
-#define OPL3_RIGHT 0x2 + SB_BASE_ADDR
-#define OPL3_BOTH 0x8 + SB_BASE_ADDR
+#define DSP_RESET (0x6 + SB_BASE_ADDR)
+#define DSP_READ (0xA + SB_BASE_ADDR)
+#define DSP_WRITE (0xC + SB_BASE_ADDR)
+#define DSP_COMMAND (0xC + SB_BASE_ADDR)
+#define DSP_STATUS (0xC + SB_BASE_ADDR)
+#define DSP_DATA_AVL (0xE + SB_BASE_ADDR)
+#define DSP_DATA16_AVL (0xF + SB_BASE_ADDR)
+#define MIXER_REG (0x4 + SB_BASE_ADDR)
+#define MIXER_DATA (0x5 + SB_BASE_ADDR)
+#define OPL3_LEFT (0x0 + SB_BASE_ADDR)
+#define OPL3_RIGHT (0x2 + SB_BASE_ADDR)
+#define OPL3_BOTH (0x8 + SB_BASE_ADDR)
/* DSP Commands */
#define DMA_NR_OF_BUFFERS 2
#define DSP_MAX_SPEED 44100 /* Max sample speed in KHz */
#define DSP_MIN_SPEED 4000 /* Min sample speed in KHz */
-#define DSP_MAX_FRAGMENT_SIZE DMA_SIZE / DMA_NR_OF_BUFFERS /* Maximum fragment size */
+#define DSP_MAX_FRAGMENT_SIZE (DMA_SIZE / DMA_NR_OF_BUFFERS) /* Maximum fragment size */
#define DSP_MIN_FRAGMENT_SIZE 1024 /* Minimum fragment size */
#define DSP_NR_OF_BUFFERS 8
# programs, flags, etc.
CC = exec cc
-CFLAGS = -I$i $(CPROFILE)
+CFLAGS = -I.. -I$i $(CPROFILE)
LDFLAGS = -i
LIBS = -lsys -ltimers
Created: Dec 2005 by Philip Homburg
*/
-#include "../drivers.h"
+#include <drivers.h>
#include <ibm/pci.h>
#include <sys/vm_i386.h>
FORWARD _PROTOTYPE( void hw_init, (struct port *pp) );
FORWARD _PROTOTYPE( void map_regs, (struct port *pp, u32_t base) );
FORWARD _PROTOTYPE( void do_int, (struct port *pp) );
-FORWARD _PROTOTYPE( u8_t read_exca, (struct port *pp, int socket, int reg) );
FORWARD _PROTOTYPE( void do_outb, (port_t port, u8_t value) );
FORWARD _PROTOTYPE( u8_t do_inb, (port_t port) );
}
if (v32 == 0)
- panic("ti1225", "bad lagacy-mode base address 0x%x\n", v32);
+ panic("ti1225", "bad legacy-mode base address 0x%x\n", v32);
pp->p_exca_port= v32;
if (debug)
}
-PRIVATE u8_t read_exca(pp, socket, reg)
-struct port *pp;
-int socket;
-int reg;
-{
- u16_t port;
-
- port= pp->p_exca_port;
- if (port == 0)
- panic("ti1225", "read_exca: bad port", NO_NUM);
- do_outb(port, socket * 0x40 + reg);
- return do_inb(port+1);
-}
PRIVATE u8_t do_inb(port_t port)
{
# programs, flags, etc.
MAKE = exec make
CC = exec cc
-CPPFLAGS = -I../../kernel/arch/$(ARCH)/include -I$i
+CPPFLAGS = -I.. -I../.. -I../../kernel/arch/$(ARCH)/include -I$i
CFLAGS = $(CPPFLAGS)
LDFLAGS = -i
LIBS = -lsys -ltimers
* and the scrolling function worries about wrapping.
*/
-#include "../drivers.h"
+#include <drivers.h>
#include <termios.h>
#include <sys/ioctl.h>
#include <sys/vm.h>
#define TIMER_FREQ 1193182L /* clock frequency for timer in PC and AT */
/* Global variables used by the console driver and assembly support. */
-PUBLIC phys_bytes vid_size; /* 0x2000 for color or 0x0800 for mono */
-PUBLIC phys_bytes vid_base;
-PUBLIC unsigned vid_mask; /* 0x1FFF for color or 0x07FF for mono */
-PUBLIC unsigned blank_color = BLANK_COLOR; /* display code for blank */
+PRIVATE phys_bytes vid_size; /* 0x2000 for color or 0x0800 for mono */
+PRIVATE phys_bytes vid_base;
+PRIVATE unsigned vid_mask; /* 0x1FFF for color or 0x07FF for mono */
+PRIVATE unsigned blank_color = BLANK_COLOR; /* display code for blank */
/* Private variables used by the console driver. */
PRIVATE int vid_port; /* I/O port for accessing 6845 */
* console
*/
-char *console_memory = NULL;
-char *font_memory = NULL;
+PRIVATE char *console_memory = NULL;
+PRIVATE char *font_memory = NULL;
/* Per console data. */
typedef struct console {
/*===========================================================================*
* kputc *
*===========================================================================*/
-PUBLIC void kputc(c)
-int c;
+PUBLIC void kputc(int c)
{
/* Accumulate a single character for a kernel message. Send a notification
* the to output driver if an END_OF_KMESS is encountered.
* Feb 04, 1994 loadable keymaps (Marcus Hampel)
*/
-#include "../drivers.h"
+#include <drivers.h>
#include <sys/ioctl.h>
#include <sys/kbdio.h>
#include <sys/time.h>
#include <minix/com.h>
#include <minix/keymap.h>
#include "tty.h"
-#include "../../kernel/const.h"
-#include "../../kernel/config.h"
-#include "../../kernel/type.h"
-#include "../../kernel/proc.h"
+#include <kernel/const.h>
+#include <kernel/config.h>
+#include <kernel/type.h>
+#include <kernel/proc.h>
-u16_t keymap[NR_SCAN_CODES * MAP_COLS] = {
+PRIVATE u16_t keymap[NR_SCAN_CODES * MAP_COLS] = {
#include "keymaps/us-std.src"
};
-u16_t keymap_escaped[NR_SCAN_CODES * MAP_COLS] = {
+PRIVATE u16_t keymap_escaped[NR_SCAN_CODES * MAP_COLS] = {
#include "keymaps/us-std-esc.src"
};
-int irq_hook_id = -1;
-int aux_irq_hook_id = -1;
+PRIVATE int irq_hook_id = -1;
+PRIVATE int aux_irq_hook_id = -1;
/* Standard and AT keyboard. (PS/2 MCA implies AT throughout.) */
#define KEYBD 0x60 /* I/O port for keyboard data */
char obuf[RS_OBUFSIZE]; /* output buffer */
} rs232_t;
-PUBLIC rs232_t rs_lines[NR_RS_LINES];
+PRIVATE rs232_t rs_lines[NR_RS_LINES];
#if (MACHINE == IBM_PC)
/* 8250 base addresses. */
* Jul 13, 2004 support for function key observers (Jorrit N. Herder)
*/
-#include "../drivers.h"
+#include <drivers.h>
#include <termios.h>
#include <sys/ioc_tty.h>
#include <signal.h>
PUBLIC struct machine machine; /* kernel environment variables */
PUBLIC u32_t system_hz;
-extern PUBLIC unsigned info_location;
-extern PUBLIC phys_bytes vid_size; /* 0x2000 for color or 0x0800 for mono */
-extern PUBLIC phys_bytes vid_base;
-
/* SEF functions and variables. */
FORWARD _PROTOTYPE( void sef_local_startup, (void) );
FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
(*tp->tty_icancel)(tp, 0);
}
+/*===========================================================================*
+ * tty_devnop *
+ *===========================================================================*/
+PRIVATE int tty_devnop(tty_t *tp, int try)
+{
+ /* Some functions need not be implemented at the device level. */
+ return 0;
+}
+
/*===========================================================================*
* tty_init *
*===========================================================================*/
}
}
-/*===========================================================================*
- * tty_devnop *
- *===========================================================================*/
-PUBLIC int tty_devnop(tp, try)
-tty_t *tp;
-int try;
-{
- /* Some functions need not be implemented at the device level. */
- return 0;
-}
-
/*===========================================================================*
* do_select *
*===========================================================================*/
#define tty_reply(c, r, p, s) tty_reply_f(__FILE__, __LINE__, (c), (r), (p), (s))
_PROTOTYPE( void tty_reply_f, (char *f, int l, int code, int replyee, int proc_nr,
int status) );
-_PROTOTYPE( int tty_devnop, (struct tty *tp, int try) );
_PROTOTYPE( int select_try, (struct tty *tp, int ops) );
_PROTOTYPE( int select_retry, (struct tty *tp) );
_PROTOTYPE( void kb_init, (struct tty *tp) );
_PROTOTYPE( void kb_init_once, (void) );
_PROTOTYPE( int kbd_loadmap, (message *m, int safe) );
-_PROTOTYPE( void do_panic_dumps, (message *m) );
_PROTOTYPE( void do_fkey_ctl, (message *m) );
_PROTOTYPE( void kbd_interrupt, (message *m) );
_PROTOTYPE( void do_kbd, (message *m) );
+++ /dev/null
-/* Global variables. */
-
-/* The parameters of the call are kept here. */
-extern int who; /* caller's proc number */
-extern int callnr; /* system call number */
-extern int dont_reply; /* normally 0; set to 1 to inhibit reply */
-
#include <signal.h>
#include "proto.h"
-#include "glo.h"
#include <minix/endpoint.h>
/* Allocate space for the global variables. */
-endpoint_t who_e; /* caller's proc number */
-int callnr; /* system call number */
-int sys_panic; /* flag to indicate system-wide panic */
-
-extern int errno; /* error number set by system library */
+PRIVATE endpoint_t who_e; /* caller's proc number */
+PRIVATE int callnr; /* system call number */
/* Declare some local functions. */
FORWARD _PROTOTYPE(void exit_server, (void) );
_PROTOTYPE(int do_snapshot, (message *m_ptr));
_PROTOTYPE(int do_getsysinfo, (message *m_ptr));
_PROTOTYPE(int sef_cb_init_fresh, (int type, sef_init_info_t *info));
-_PROTOTYPE(int map_service, (struct rprocpub *rpub));
}
}
+/*===========================================================================*
+ * map_service *
+ *===========================================================================*/
+PRIVATE int map_service(struct rprocpub *rpub)
+{
+/* Map a new service by registering its label. */
+ struct data_store *dsp;
+
+ /* Allocate a new data slot. */
+ if((dsp = alloc_data_slot()) == NULL) {
+ return ENOMEM;
+ }
+
+ /* Set attributes. */
+ strcpy(dsp->key, rpub->label);
+ dsp->u.u32 = (u32_t) rpub->endpoint;
+ strcpy(dsp->owner, ds_getprocname(DS_PROC_NR));
+ dsp->flags = DSF_IN_USE | DSF_TYPE_LABEL;
+
+ /* Update subscribers having a matching subscription. */
+ update_subscribers(dsp, 1);
+
+ return(OK);
+}
+
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
return(OK);
}
-/*===========================================================================*
- * map_service *
- *===========================================================================*/
-PUBLIC int map_service(rpub)
-struct rprocpub *rpub;
-{
-/* Map a new service by registering its label. */
- struct data_store *dsp;
-
- /* Allocate a new data slot. */
- if((dsp = alloc_data_slot()) == NULL) {
- return ENOMEM;
- }
-
- /* Set attributes. */
- strcpy(dsp->key, rpub->label);
- dsp->u.u32 = (u32_t) rpub->endpoint;
- strcpy(dsp->owner, ds_getprocname(DS_PROC_NR));
- dsp->flags = DSF_IN_USE | DSF_TYPE_LABEL;
-
- /* Update subscribers having a matching subscription. */
- update_subscribers(dsp, 1);
-
- return(OK);
-}
-
/*===========================================================================*
* do_publish *
*===========================================================================*/