retire PUBLIC, PRIVATE and FORWARD

This commit is contained in:
Ben Gras
2012-03-25 20:25:53 +02:00
parent 6a73e85ad1
commit 7336a67dfe
603 changed files with 5776 additions and 5779 deletions

View File

@@ -5,11 +5,11 @@
#include "pci.h"
PUBLIC int acpi_enabled;
PUBLIC struct machine machine;
int acpi_enabled;
struct machine machine;
/* don't know where ACPI tables are, we may need to access any memory */
PRIVATE int init_mem_priv(void)
static int init_mem_priv(void)
{
struct mem_range mr;
@@ -19,7 +19,7 @@ PRIVATE int init_mem_priv(void)
return sys_privctl(SELF, SYS_PRIV_ADD_MEM, &mr);
}
PRIVATE void set_machine_mode(void)
static void set_machine_mode(void)
{
ACPI_OBJECT arg1;
ACPI_OBJECT_LIST args;
@@ -40,7 +40,7 @@ PRIVATE void set_machine_mode(void)
machine.apic_enabled ? "APIC" : "PIC");
}
PRIVATE ACPI_STATUS init_acpica(void)
static ACPI_STATUS init_acpica(void)
{
ACPI_STATUS status;
@@ -71,7 +71,7 @@ PRIVATE ACPI_STATUS init_acpica(void)
return AE_OK;
}
PUBLIC void init_acpi(void)
void init_acpi(void)
{
ACPI_STATUS acpi_err;
/* test conditions for acpi */
@@ -98,14 +98,14 @@ PUBLIC void init_acpi(void)
}
}
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
static int sef_cb_init_fresh(int type, sef_init_info_t *info)
{
init_acpi();
return OK;
}
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);

View File

@@ -124,7 +124,7 @@
extern struct machine machine;
PRIVATE u32_t pci_inb(u16_t port) {
static u32_t pci_inb(u16_t port) {
u32_t value;
int s;
if ((s=sys_inb(port, &value)) !=OK)
@@ -132,7 +132,7 @@ PRIVATE u32_t pci_inb(u16_t port) {
return value;
}
PRIVATE u32_t pci_inw(u16_t port) {
static u32_t pci_inw(u16_t port) {
u32_t value;
int s;
if ((s=sys_inw(port, &value)) !=OK)
@@ -140,7 +140,7 @@ PRIVATE u32_t pci_inw(u16_t port) {
return value;
}
PRIVATE u32_t pci_inl(u16_t port) {
static u32_t pci_inl(u16_t port) {
u32_t value;
int s;
if ((s=sys_inl(port, &value)) !=OK)
@@ -148,19 +148,19 @@ PRIVATE u32_t pci_inl(u16_t port) {
return value;
}
PRIVATE void pci_outb(u16_t port, u8_t value) {
static void pci_outb(u16_t port, u8_t value) {
int s;
if ((s=sys_outb(port, value)) !=OK)
printf("ACPI: warning, sys_outb failed: %d\n", s);
}
PRIVATE void pci_outw(u16_t port, u16_t value) {
static void pci_outw(u16_t port, u16_t value) {
int s;
if ((s=sys_outw(port, value)) !=OK)
printf("ACPI: warning, sys_outw failed: %d\n", s);
}
PRIVATE void pci_outl(u16_t port, u32_t value) {
static void pci_outl(u16_t port, u32_t value) {
int s;
if ((s=sys_outl(port, value)) !=OK)
printf("ACPI: warning, sys_outl failed: %d\n", s);
@@ -965,7 +965,7 @@ AcpiOsSignal (
*
*****************************************************************************/
PUBLIC ACPI_PHYSICAL_ADDRESS AcpiOsGetRootPointer (
ACPI_PHYSICAL_ADDRESS AcpiOsGetRootPointer (
void)
{
return machine.acpi_rsdp;

View File

@@ -20,14 +20,14 @@ struct pci_bridge {
struct pci_bridge * children[PCI_MAX_DEVICES];
};
PRIVATE struct pci_bridge pci_root_bridge;
static struct pci_bridge pci_root_bridge;
struct irq_resource {
struct pci_bridge * bridge;
ACPI_PCI_ROUTING_TABLE * tbl;
};
PRIVATE struct pci_bridge * find_bridge(struct pci_bridge * root,
static struct pci_bridge * find_bridge(struct pci_bridge * root,
int pbnr,
int dev,
int sbnr)
@@ -68,7 +68,7 @@ PRIVATE struct pci_bridge * find_bridge(struct pci_bridge * root,
return NULL;
}
PUBLIC void do_map_bridge(message *m)
void do_map_bridge(message *m)
{
int err = OK;
unsigned dev = ((struct acpi_map_bridge_req *)m)->device;
@@ -92,7 +92,7 @@ map_error:
}
#if 0
PRIVATE ACPI_STATUS device_get_int(ACPI_HANDLE handle,
static ACPI_STATUS device_get_int(ACPI_HANDLE handle,
char * name,
ACPI_INTEGER * val)
{
@@ -113,7 +113,7 @@ PRIVATE ACPI_STATUS device_get_int(ACPI_HANDLE handle,
}
#endif
PUBLIC void do_get_irq(message *m)
void do_get_irq(message *m)
{
struct pci_bridge * bridge;
int irq;
@@ -134,7 +134,7 @@ PUBLIC void do_get_irq(message *m)
((struct acpi_get_irq_resp *)m)->irq = irq;
}
PRIVATE void add_irq(struct pci_bridge * bridge,
static void add_irq(struct pci_bridge * bridge,
unsigned dev,
unsigned pin,
u8_t irq)
@@ -144,7 +144,7 @@ PRIVATE void add_irq(struct pci_bridge * bridge,
bridge->irqtable[dev * PCI_MAX_PINS + pin] = irq;
}
PRIVATE ACPI_STATUS get_irq_resource(ACPI_RESOURCE *res, void *context)
static ACPI_STATUS get_irq_resource(ACPI_RESOURCE *res, void *context)
{
struct irq_resource * ires = (struct irq_resource *) context;
@@ -165,7 +165,7 @@ PRIVATE ACPI_STATUS get_irq_resource(ACPI_RESOURCE *res, void *context)
return AE_OK;
}
PRIVATE ACPI_STATUS get_pci_irq_routing(struct pci_bridge * bridge)
static ACPI_STATUS get_pci_irq_routing(struct pci_bridge * bridge)
{
ACPI_STATUS status;
ACPI_BUFFER abuff;
@@ -230,7 +230,7 @@ PRIVATE ACPI_STATUS get_pci_irq_routing(struct pci_bridge * bridge)
return AE_OK;
}
PRIVATE void bridge_init_irqtable(struct pci_bridge * bridge)
static void bridge_init_irqtable(struct pci_bridge * bridge)
{
int i;
@@ -238,7 +238,7 @@ PRIVATE void bridge_init_irqtable(struct pci_bridge * bridge)
bridge->irqtable[i] = -1;
}
PRIVATE ACPI_STATUS add_pci_dev(ACPI_HANDLE handle,
static ACPI_STATUS add_pci_dev(ACPI_HANDLE handle,
UINT32 level,
void *context,
void **retval)
@@ -283,7 +283,7 @@ PRIVATE ACPI_STATUS add_pci_dev(ACPI_HANDLE handle,
return status;
}
PRIVATE ACPI_STATUS add_pci_root_dev(ACPI_HANDLE handle,
static ACPI_STATUS add_pci_root_dev(ACPI_HANDLE handle,
UINT32 level,
void *context,
void **retval)
@@ -311,7 +311,7 @@ PRIVATE ACPI_STATUS add_pci_root_dev(ACPI_HANDLE handle,
return status;
}
PUBLIC void pci_scan_devices(void)
void pci_scan_devices(void)
{
ACPI_STATUS status;

View File

@@ -112,7 +112,7 @@
#include "ahci.h"
/* Host Bus Adapter (HBA) state. */
PRIVATE struct {
static struct {
volatile u32_t *base; /* base address of memory-mapped registers */
size_t size; /* size of memory-mapped register area */
@@ -125,7 +125,7 @@ PRIVATE struct {
} hba_state;
/* Port state. */
PRIVATE struct port_state {
static struct port_state {
int state; /* port state */
unsigned int flags; /* port flags */
@@ -171,21 +171,21 @@ PRIVATE struct port_state {
} cmd_info[NR_CMDS];
} port_state[NR_PORTS];
PRIVATE int ahci_instance; /* driver instance number */
static int ahci_instance; /* driver instance number */
PRIVATE int ahci_verbose; /* verbosity level (0..4) */
static int ahci_verbose; /* verbosity level (0..4) */
/* Timeout values. These can be overridden with environment variables. */
PRIVATE long ahci_spinup_timeout = SPINUP_TIMEOUT;
PRIVATE long ahci_sig_timeout = SIG_TIMEOUT;
PRIVATE long ahci_sig_checks = NR_SIG_CHECKS;
PRIVATE long ahci_command_timeout = COMMAND_TIMEOUT;
PRIVATE long ahci_transfer_timeout = TRANSFER_TIMEOUT;
PRIVATE long ahci_flush_timeout = FLUSH_TIMEOUT;
static long ahci_spinup_timeout = SPINUP_TIMEOUT;
static long ahci_sig_timeout = SIG_TIMEOUT;
static long ahci_sig_checks = NR_SIG_CHECKS;
static long ahci_command_timeout = COMMAND_TIMEOUT;
static long ahci_transfer_timeout = TRANSFER_TIMEOUT;
static long ahci_flush_timeout = FLUSH_TIMEOUT;
PRIVATE int ahci_map[MAX_DRIVES]; /* device-to-port mapping */
static int ahci_map[MAX_DRIVES]; /* device-to-port mapping */
PRIVATE int ahci_exiting = FALSE; /* exit after last close? */
static int ahci_exiting = FALSE; /* exit after last close? */
#define BUILD_ARG(port, tag) (((port) << 8) | (tag))
#define GET_PORT(arg) ((arg) >> 8)
@@ -196,29 +196,29 @@ PRIVATE int ahci_exiting = FALSE; /* exit after last close? */
printf s; \
} while (0)
PRIVATE void port_set_cmd(struct port_state *ps, int cmd, cmd_fis_t *fis,
static void port_set_cmd(struct port_state *ps, int cmd, cmd_fis_t *fis,
u8_t packet[ATAPI_PACKET_SIZE], prd_t *prdt, int nr_prds, int write);
PRIVATE void port_issue(struct port_state *ps, int cmd, clock_t timeout);
PRIVATE int port_exec(struct port_state *ps, int cmd, clock_t timeout);
PRIVATE void port_timeout(struct timer *tp);
PRIVATE void port_disconnect(struct port_state *ps);
static void port_issue(struct port_state *ps, int cmd, clock_t timeout);
static int port_exec(struct port_state *ps, int cmd, clock_t timeout);
static void port_timeout(struct timer *tp);
static void port_disconnect(struct port_state *ps);
PRIVATE char *ahci_portname(struct port_state *ps);
PRIVATE int ahci_open(dev_t minor, int access);
PRIVATE int ahci_close(dev_t minor);
PRIVATE ssize_t ahci_transfer(dev_t minor, int do_write, u64_t position,
static char *ahci_portname(struct port_state *ps);
static int ahci_open(dev_t minor, int access);
static int ahci_close(dev_t minor);
static ssize_t ahci_transfer(dev_t minor, int do_write, u64_t position,
endpoint_t endpt, iovec_t *iovec, unsigned int count,
int flags);
PRIVATE struct device *ahci_part(dev_t minor);
PRIVATE void ahci_alarm(clock_t stamp);
PRIVATE int ahci_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
static struct device *ahci_part(dev_t minor);
static void ahci_alarm(clock_t stamp);
static int ahci_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
cp_grant_id_t grant);
PRIVATE void ahci_intr(unsigned int irqs);
PRIVATE int ahci_device(dev_t minor, device_id_t *id);
PRIVATE struct port_state *ahci_get_port(dev_t minor);
static void ahci_intr(unsigned int irqs);
static int ahci_device(dev_t minor, device_id_t *id);
static struct port_state *ahci_get_port(dev_t minor);
/* AHCI driver table. */
PRIVATE struct blockdriver ahci_dtab = {
static struct blockdriver ahci_dtab = {
BLOCKDRIVER_TYPE_DISK,
ahci_open,
ahci_close,
@@ -236,7 +236,7 @@ PRIVATE struct blockdriver ahci_dtab = {
/*===========================================================================*
* atapi_exec *
*===========================================================================*/
PRIVATE int atapi_exec(struct port_state *ps, int cmd,
static int atapi_exec(struct port_state *ps, int cmd,
u8_t packet[ATAPI_PACKET_SIZE], size_t size, int write)
{
/* Execute an ATAPI command. Return OK or error.
@@ -272,7 +272,7 @@ PRIVATE int atapi_exec(struct port_state *ps, int cmd,
/*===========================================================================*
* atapi_test_unit *
*===========================================================================*/
PRIVATE int atapi_test_unit(struct port_state *ps, int cmd)
static int atapi_test_unit(struct port_state *ps, int cmd)
{
/* Test whether the ATAPI device and medium are ready.
*/
@@ -287,7 +287,7 @@ PRIVATE int atapi_test_unit(struct port_state *ps, int cmd)
/*===========================================================================*
* atapi_request_sense *
*===========================================================================*/
PRIVATE int atapi_request_sense(struct port_state *ps, int cmd, int *sense)
static int atapi_request_sense(struct port_state *ps, int cmd, int *sense)
{
/* Request error (sense) information from an ATAPI device, and return
* the sense key. The additional sense codes are not used at this time.
@@ -316,7 +316,7 @@ PRIVATE int atapi_request_sense(struct port_state *ps, int cmd, int *sense)
/*===========================================================================*
* atapi_load_eject *
*===========================================================================*/
PRIVATE int atapi_load_eject(struct port_state *ps, int cmd, int load)
static int atapi_load_eject(struct port_state *ps, int cmd, int load)
{
/* Load or eject a medium in an ATAPI device.
*/
@@ -332,7 +332,7 @@ PRIVATE int atapi_load_eject(struct port_state *ps, int cmd, int load)
/*===========================================================================*
* atapi_read_capacity *
*===========================================================================*/
PRIVATE int atapi_read_capacity(struct port_state *ps, int cmd)
static int atapi_read_capacity(struct port_state *ps, int cmd)
{
/* Retrieve the LBA count and sector size of an ATAPI medium.
*/
@@ -372,7 +372,7 @@ PRIVATE int atapi_read_capacity(struct port_state *ps, int cmd)
/*===========================================================================*
* atapi_check_medium *
*===========================================================================*/
PRIVATE int atapi_check_medium(struct port_state *ps, int cmd)
static int atapi_check_medium(struct port_state *ps, int cmd)
{
/* Check whether a medium is present in a removable-media ATAPI device.
* If a new medium is detected, get its total and sector size. Return
@@ -407,7 +407,7 @@ PRIVATE int atapi_check_medium(struct port_state *ps, int cmd)
/*===========================================================================*
* atapi_id_check *
*===========================================================================*/
PRIVATE int atapi_id_check(struct port_state *ps, u16_t *buf)
static int atapi_id_check(struct port_state *ps, u16_t *buf)
{
/* Determine whether we support this ATAPI device based on the
* identification data it returned, and store some of its properties.
@@ -462,7 +462,7 @@ PRIVATE int atapi_id_check(struct port_state *ps, u16_t *buf)
/*===========================================================================*
* atapi_transfer *
*===========================================================================*/
PRIVATE int atapi_transfer(struct port_state *ps, int cmd, u64_t start_lba,
static int atapi_transfer(struct port_state *ps, int cmd, u64_t start_lba,
unsigned int count, int write, prd_t *prdt, int nr_prds)
{
/* Perform data transfer from or to an ATAPI device.
@@ -498,7 +498,7 @@ PRIVATE int atapi_transfer(struct port_state *ps, int cmd, u64_t start_lba,
/*===========================================================================*
* ata_id_check *
*===========================================================================*/
PRIVATE int ata_id_check(struct port_state *ps, u16_t *buf)
static int ata_id_check(struct port_state *ps, u16_t *buf)
{
/* Determine whether we support this ATA device based on the
* identification data it returned, and store some of its properties.
@@ -574,7 +574,7 @@ PRIVATE int ata_id_check(struct port_state *ps, u16_t *buf)
/*===========================================================================*
* ata_transfer *
*===========================================================================*/
PRIVATE int ata_transfer(struct port_state *ps, int cmd, u64_t start_lba,
static int ata_transfer(struct port_state *ps, int cmd, u64_t start_lba,
unsigned int count, int write, int force, prd_t *prdt, int nr_prds)
{
/* Perform data transfer from or to an ATA device.
@@ -624,7 +624,7 @@ PRIVATE int ata_transfer(struct port_state *ps, int cmd, u64_t start_lba,
/*===========================================================================*
* gen_identify *
*===========================================================================*/
PRIVATE int gen_identify(struct port_state *ps, int blocking)
static int gen_identify(struct port_state *ps, int blocking)
{
/* Identify an ATA or ATAPI device. If the blocking flag is set, block
* until the command has completed; otherwise return immediately.
@@ -657,7 +657,7 @@ PRIVATE int gen_identify(struct port_state *ps, int blocking)
/*===========================================================================*
* gen_flush_wcache *
*===========================================================================*/
PRIVATE int gen_flush_wcache(struct port_state *ps)
static int gen_flush_wcache(struct port_state *ps)
{
/* Flush the device's write cache.
*/
@@ -690,7 +690,7 @@ PRIVATE int gen_flush_wcache(struct port_state *ps)
/*===========================================================================*
* gen_get_wcache *
*===========================================================================*/
PRIVATE int gen_get_wcache(struct port_state *ps, int *val)
static int gen_get_wcache(struct port_state *ps, int *val)
{
/* Retrieve the status of the device's write cache.
*/
@@ -713,7 +713,7 @@ PRIVATE int gen_get_wcache(struct port_state *ps, int *val)
/*===========================================================================*
* gen_set_wcache *
*===========================================================================*/
PRIVATE int gen_set_wcache(struct port_state *ps, int enable)
static int gen_set_wcache(struct port_state *ps, int enable)
{
/* Enable or disable the device's write cache.
*/
@@ -744,7 +744,7 @@ PRIVATE int gen_set_wcache(struct port_state *ps, int enable)
/*===========================================================================*
* ct_set_fis *
*===========================================================================*/
PRIVATE vir_bytes ct_set_fis(u8_t *ct, cmd_fis_t *fis, unsigned int tag)
static vir_bytes ct_set_fis(u8_t *ct, cmd_fis_t *fis, unsigned int tag)
{
/* Fill in the Frame Information Structure part of a command table,
* and return the resulting FIS size (in bytes). We only support the
@@ -782,7 +782,7 @@ PRIVATE vir_bytes ct_set_fis(u8_t *ct, cmd_fis_t *fis, unsigned int tag)
/*===========================================================================*
* ct_set_packet *
*===========================================================================*/
PRIVATE void ct_set_packet(u8_t *ct, u8_t packet[ATAPI_PACKET_SIZE])
static void ct_set_packet(u8_t *ct, u8_t packet[ATAPI_PACKET_SIZE])
{
/* Fill in the packet part of a command table.
*/
@@ -793,7 +793,7 @@ PRIVATE void ct_set_packet(u8_t *ct, u8_t packet[ATAPI_PACKET_SIZE])
/*===========================================================================*
* ct_set_prdt *
*===========================================================================*/
PRIVATE void ct_set_prdt(u8_t *ct, prd_t *prdt, int nr_prds)
static void ct_set_prdt(u8_t *ct, prd_t *prdt, int nr_prds)
{
/* Fill in the PRDT part of a command table.
*/
@@ -813,7 +813,7 @@ PRIVATE void ct_set_prdt(u8_t *ct, prd_t *prdt, int nr_prds)
/*===========================================================================*
* port_set_cmd *
*===========================================================================*/
PRIVATE void port_set_cmd(struct port_state *ps, int cmd, cmd_fis_t *fis,
static void port_set_cmd(struct port_state *ps, int cmd, cmd_fis_t *fis,
u8_t packet[ATAPI_PACKET_SIZE], prd_t *prdt, int nr_prds, int write)
{
/* Prepare the given command for execution, by constructing a command
@@ -868,7 +868,7 @@ PRIVATE void port_set_cmd(struct port_state *ps, int cmd, cmd_fis_t *fis,
/*===========================================================================*
* port_finish_cmd *
*===========================================================================*/
PRIVATE void port_finish_cmd(struct port_state *ps, int cmd, int result)
static void port_finish_cmd(struct port_state *ps, int cmd, int result)
{
/* Finish a command that has either succeeded or failed.
*/
@@ -895,7 +895,7 @@ PRIVATE void port_finish_cmd(struct port_state *ps, int cmd, int result)
/*===========================================================================*
* port_fail_cmds *
*===========================================================================*/
PRIVATE void port_fail_cmds(struct port_state *ps)
static void port_fail_cmds(struct port_state *ps)
{
/* Fail all ongoing commands for a device.
*/
@@ -909,7 +909,7 @@ PRIVATE void port_fail_cmds(struct port_state *ps)
/*===========================================================================*
* port_check_cmds *
*===========================================================================*/
PRIVATE void port_check_cmds(struct port_state *ps)
static void port_check_cmds(struct port_state *ps)
{
/* Check what commands have completed, and finish them.
*/
@@ -933,7 +933,7 @@ PRIVATE void port_check_cmds(struct port_state *ps)
/*===========================================================================*
* port_find_cmd *
*===========================================================================*/
PRIVATE int port_find_cmd(struct port_state *ps)
static int port_find_cmd(struct port_state *ps)
{
/* Find a free command tag to queue the current request.
*/
@@ -954,7 +954,7 @@ PRIVATE int port_find_cmd(struct port_state *ps)
/*===========================================================================*
* port_get_padbuf *
*===========================================================================*/
PRIVATE int port_get_padbuf(struct port_state *ps, size_t size)
static int port_get_padbuf(struct port_state *ps, size_t size)
{
/* Make available a temporary buffer for use by this port. Enlarge the
* previous buffer if applicable and necessary, potentially changing
@@ -987,7 +987,7 @@ PRIVATE int port_get_padbuf(struct port_state *ps, size_t size)
/*===========================================================================*
* sum_iovec *
*===========================================================================*/
PRIVATE int sum_iovec(struct port_state *ps, endpoint_t endpt,
static int sum_iovec(struct port_state *ps, endpoint_t endpt,
iovec_s_t *iovec, int nr_req, vir_bytes *total)
{
/* Retrieve the total size of the given I/O vector. Check for alignment
@@ -1024,7 +1024,7 @@ PRIVATE int sum_iovec(struct port_state *ps, endpoint_t endpt,
/*===========================================================================*
* setup_prdt *
*===========================================================================*/
PRIVATE int setup_prdt(struct port_state *ps, endpoint_t endpt,
static int setup_prdt(struct port_state *ps, endpoint_t endpt,
iovec_s_t *iovec, int nr_req, vir_bytes size, vir_bytes lead,
int write, prd_t *prdt)
{
@@ -1107,7 +1107,7 @@ PRIVATE int setup_prdt(struct port_state *ps, endpoint_t endpt,
/*===========================================================================*
* port_transfer *
*===========================================================================*/
PRIVATE ssize_t port_transfer(struct port_state *ps, u64_t pos, u64_t eof,
static ssize_t port_transfer(struct port_state *ps, u64_t pos, u64_t eof,
endpoint_t endpt, iovec_s_t *iovec, int nr_req, int write, int flags)
{
/* Perform an I/O transfer on a port.
@@ -1189,7 +1189,7 @@ PRIVATE ssize_t port_transfer(struct port_state *ps, u64_t pos, u64_t eof,
/*===========================================================================*
* port_start *
*===========================================================================*/
PRIVATE void port_start(struct port_state *ps)
static void port_start(struct port_state *ps)
{
/* Start the given port, allowing for the execution of commands and the
* transfer of data on that port.
@@ -1214,7 +1214,7 @@ PRIVATE void port_start(struct port_state *ps)
/*===========================================================================*
* port_restart *
*===========================================================================*/
PRIVATE void port_restart(struct port_state *ps)
static void port_restart(struct port_state *ps)
{
/* Restart a port after a fatal error has occurred.
*/
@@ -1267,7 +1267,7 @@ PRIVATE void port_restart(struct port_state *ps)
/*===========================================================================*
* port_stop *
*===========================================================================*/
PRIVATE void port_stop(struct port_state *ps)
static void port_stop(struct port_state *ps)
{
/* Stop the given port, if not already stopped.
*/
@@ -1309,7 +1309,7 @@ PRIVATE void port_stop(struct port_state *ps)
/*===========================================================================*
* port_sig_check *
*===========================================================================*/
PRIVATE void port_sig_check(struct port_state *ps)
static void port_sig_check(struct port_state *ps)
{
/* Check whether the device's signature has become available yet, and
* if so, start identifying the device.
@@ -1393,7 +1393,7 @@ PRIVATE void port_sig_check(struct port_state *ps)
/*===========================================================================*
* print_string *
*===========================================================================*/
PRIVATE void print_string(u16_t *buf, int start, int end)
static void print_string(u16_t *buf, int start, int end)
{
/* Print a string that is stored as little-endian words and padded with
* trailing spaces.
@@ -1414,7 +1414,7 @@ PRIVATE void print_string(u16_t *buf, int start, int end)
/*===========================================================================*
* port_id_check *
*===========================================================================*/
PRIVATE void port_id_check(struct port_state *ps, int success)
static void port_id_check(struct port_state *ps, int success)
{
/* The device identification command has either completed or timed out.
* Decide whether this device is usable or not, and store some of its
@@ -1483,7 +1483,7 @@ PRIVATE void port_id_check(struct port_state *ps, int success)
/*===========================================================================*
* port_connect *
*===========================================================================*/
PRIVATE void port_connect(struct port_state *ps)
static void port_connect(struct port_state *ps)
{
/* A device has been found to be attached to this port. Start the port,
* and do timed polling for its signature to become available.
@@ -1508,7 +1508,7 @@ PRIVATE void port_connect(struct port_state *ps)
/*===========================================================================*
* port_disconnect *
*===========================================================================*/
PRIVATE void port_disconnect(struct port_state *ps)
static void port_disconnect(struct port_state *ps)
{
/* The device has detached from this port. Stop the port if necessary.
*/
@@ -1538,7 +1538,7 @@ PRIVATE void port_disconnect(struct port_state *ps)
/*===========================================================================*
* port_intr *
*===========================================================================*/
PRIVATE void port_intr(struct port_state *ps)
static void port_intr(struct port_state *ps)
{
/* Process an interrupt on this port.
*/
@@ -1619,7 +1619,7 @@ PRIVATE void port_intr(struct port_state *ps)
/*===========================================================================*
* port_timeout *
*===========================================================================*/
PRIVATE void port_timeout(struct timer *tp)
static void port_timeout(struct timer *tp)
{
/* A timeout has occurred on this port. Figure out what the timeout is
* for, and take appropriate action.
@@ -1705,7 +1705,7 @@ PRIVATE void port_timeout(struct timer *tp)
/*===========================================================================*
* port_wait *
*===========================================================================*/
PRIVATE void port_wait(struct port_state *ps)
static void port_wait(struct port_state *ps)
{
/* Suspend the current thread until the given port is no longer busy,
* due to either command completion or timeout.
@@ -1722,7 +1722,7 @@ PRIVATE void port_wait(struct port_state *ps)
/*===========================================================================*
* port_issue *
*===========================================================================*/
PRIVATE void port_issue(struct port_state *ps, int cmd, clock_t timeout)
static void port_issue(struct port_state *ps, int cmd, clock_t timeout)
{
/* Issue a command to the port, and set a timer to trigger a timeout
* if the command takes too long to complete.
@@ -1751,7 +1751,7 @@ PRIVATE void port_issue(struct port_state *ps, int cmd, clock_t timeout)
/*===========================================================================*
* port_exec *
*===========================================================================*/
PRIVATE int port_exec(struct port_state *ps, int cmd, clock_t timeout)
static int port_exec(struct port_state *ps, int cmd, clock_t timeout)
{
/* Execute a command on a port, wait for the command to complete or for
* a timeout, and return whether the command succeeded or not.
@@ -1789,7 +1789,7 @@ PRIVATE int port_exec(struct port_state *ps, int cmd, clock_t timeout)
/*===========================================================================*
* port_alloc *
*===========================================================================*/
PRIVATE void port_alloc(struct port_state *ps)
static void port_alloc(struct port_state *ps)
{
/* Allocate memory for the given port. We try to cram everything into
* one 4K-page in order to limit memory usage as much as possible.
@@ -1854,7 +1854,7 @@ PRIVATE void port_alloc(struct port_state *ps)
/*===========================================================================*
* port_free *
*===========================================================================*/
PRIVATE void port_free(struct port_state *ps)
static void port_free(struct port_state *ps)
{
/* Free previously allocated memory for the given port.
*/
@@ -1874,7 +1874,7 @@ PRIVATE void port_free(struct port_state *ps)
/*===========================================================================*
* port_init *
*===========================================================================*/
PRIVATE void port_init(struct port_state *ps)
static void port_init(struct port_state *ps)
{
/* Initialize the given port.
*/
@@ -1918,7 +1918,7 @@ PRIVATE void port_init(struct port_state *ps)
/*===========================================================================*
* ahci_probe *
*===========================================================================*/
PRIVATE int ahci_probe(int skip)
static int ahci_probe(int skip)
{
/* Find a matching PCI device.
*/
@@ -1945,7 +1945,7 @@ PRIVATE int ahci_probe(int skip)
/*===========================================================================*
* ahci_reset *
*===========================================================================*/
PRIVATE void ahci_reset(void)
static void ahci_reset(void)
{
/* Reset the HBA. Do not enable AHCI mode afterwards.
*/
@@ -1967,7 +1967,7 @@ PRIVATE void ahci_reset(void)
/*===========================================================================*
* ahci_init *
*===========================================================================*/
PRIVATE void ahci_init(int devind)
static void ahci_init(int devind)
{
/* Initialize the device.
*/
@@ -2048,7 +2048,7 @@ PRIVATE void ahci_init(int devind)
/*===========================================================================*
* ahci_stop *
*===========================================================================*/
PRIVATE void ahci_stop(void)
static void ahci_stop(void)
{
/* Disable AHCI, and clean up resources to the extent possible.
*/
@@ -2078,7 +2078,7 @@ PRIVATE void ahci_stop(void)
/*===========================================================================*
* ahci_alarm *
*===========================================================================*/
PRIVATE void ahci_alarm(clock_t stamp)
static void ahci_alarm(clock_t stamp)
{
/* Process an alarm.
*/
@@ -2090,7 +2090,7 @@ PRIVATE void ahci_alarm(clock_t stamp)
/*===========================================================================*
* ahci_intr *
*===========================================================================*/
PRIVATE void ahci_intr(unsigned int UNUSED(irqs))
static void ahci_intr(unsigned int UNUSED(irqs))
{
/* Process an interrupt.
*/
@@ -2127,7 +2127,7 @@ PRIVATE void ahci_intr(unsigned int UNUSED(irqs))
/*===========================================================================*
* ahci_get_var *
*===========================================================================*/
PRIVATE void ahci_get_var(char *name, long *v, int timeout)
static void ahci_get_var(char *name, long *v, int timeout)
{
/* Retrieve an environment variable, and optionall adjust it to the
* scale that we are using internally.
@@ -2144,7 +2144,7 @@ PRIVATE void ahci_get_var(char *name, long *v, int timeout)
/*===========================================================================*
* ahci_get_params *
*===========================================================================*/
PRIVATE void ahci_get_params(void)
static void ahci_get_params(void)
{
/* Retrieve and parse parameters passed to this driver, except the
* device-to-port mapping, which has to be parsed later.
@@ -2173,7 +2173,7 @@ PRIVATE void ahci_get_params(void)
/*===========================================================================*
* ahci_set_mapping *
*===========================================================================*/
PRIVATE void ahci_set_mapping(void)
static void ahci_set_mapping(void)
{
/* Construct a mapping from device nodes to port numbers.
*/
@@ -2226,7 +2226,7 @@ PRIVATE void ahci_set_mapping(void)
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the driver.
*/
@@ -2256,7 +2256,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
/* In case of a termination signal, shut down this driver.
*/
@@ -2282,7 +2282,7 @@ PRIVATE void sef_cb_signal_handler(int signo)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup(void)
static void sef_local_startup(void)
{
/* Set callbacks and initialize the System Event Framework (SEF).
*/
@@ -2301,7 +2301,7 @@ PRIVATE void sef_local_startup(void)
/*===========================================================================*
* ahci_portname *
*===========================================================================*/
PRIVATE char *ahci_portname(struct port_state *ps)
static char *ahci_portname(struct port_state *ps)
{
/* Return a printable name for the given port. Whenever we can, print a
* "Dx" device number rather than a "Pxx" port number, because the user
@@ -2328,7 +2328,7 @@ PRIVATE char *ahci_portname(struct port_state *ps)
/*===========================================================================*
* ahci_map_minor *
*===========================================================================*/
PRIVATE struct port_state *ahci_map_minor(dev_t minor, struct device **dvp)
static struct port_state *ahci_map_minor(dev_t minor, struct device **dvp)
{
/* Map a minor device number to a port and a pointer to the partition's
* device structure. Return NULL if this minor device number does not
@@ -2364,7 +2364,7 @@ PRIVATE struct port_state *ahci_map_minor(dev_t minor, struct device **dvp)
/*===========================================================================*
* ahci_part *
*===========================================================================*/
PRIVATE struct device *ahci_part(dev_t minor)
static struct device *ahci_part(dev_t minor)
{
/* Return a pointer to the partition information structure of the given
* minor device.
@@ -2380,7 +2380,7 @@ PRIVATE struct device *ahci_part(dev_t minor)
/*===========================================================================*
* ahci_open *
*===========================================================================*/
PRIVATE int ahci_open(dev_t minor, int access)
static int ahci_open(dev_t minor, int access)
{
/* Open a device.
*/
@@ -2450,7 +2450,7 @@ PRIVATE int ahci_open(dev_t minor, int access)
/*===========================================================================*
* ahci_close *
*===========================================================================*/
PRIVATE int ahci_close(dev_t minor)
static int ahci_close(dev_t minor)
{
/* Close a device.
*/
@@ -2506,7 +2506,7 @@ PRIVATE int ahci_close(dev_t minor)
/*===========================================================================*
* ahci_transfer *
*===========================================================================*/
PRIVATE ssize_t ahci_transfer(dev_t minor, int do_write, u64_t position,
static ssize_t ahci_transfer(dev_t minor, int do_write, u64_t position,
endpoint_t endpt, iovec_t *iovec, unsigned int count, int flags)
{
/* Perform data transfer on the selected device.
@@ -2541,7 +2541,7 @@ PRIVATE ssize_t ahci_transfer(dev_t minor, int do_write, u64_t position,
/*===========================================================================*
* ahci_ioctl *
*===========================================================================*/
PRIVATE int ahci_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
static int ahci_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
cp_grant_id_t grant)
{
/* Process I/O control requests.
@@ -2598,7 +2598,7 @@ PRIVATE int ahci_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
/*===========================================================================*
* ahci_device *
*===========================================================================*/
PRIVATE int ahci_device(dev_t minor, device_id_t *id)
static int ahci_device(dev_t minor, device_id_t *id)
{
/* Map a minor device number to a device ID.
*/
@@ -2616,7 +2616,7 @@ PRIVATE int ahci_device(dev_t minor, device_id_t *id)
/*===========================================================================*
* ahci_get_port *
*===========================================================================*/
PRIVATE struct port_state *ahci_get_port(dev_t minor)
static struct port_state *ahci_get_port(dev_t minor)
{
/* Get the port structure associated with the given minor device.
* Called only from worker threads, so the minor device is already
@@ -2634,7 +2634,7 @@ PRIVATE struct port_state *ahci_get_port(dev_t minor)
/*===========================================================================*
* main *
*===========================================================================*/
PUBLIC int main(int argc, char **argv)
int main(int argc, char **argv)
{
/* Driver task.
*/

View File

@@ -59,9 +59,9 @@ static void del_range(phys_bytes busaddr, phys_bytes size);
static void report_exceptions(void);
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
FORWARD void sef_cb_signal_handler(int signo);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_cb_signal_handler(int signo);
int main(void)
{
@@ -92,7 +92,7 @@ int main(void)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -113,7 +113,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize the amddev driver. */
int r, n_maps, n_domains, revision;
@@ -157,7 +157,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
int r;
endpoint_t proc_e;

View File

@@ -44,29 +44,29 @@ struct command {
};
/* Timeouts and max retries. */
PRIVATE int timeout_usecs = DEF_TIMEOUT_USECS;
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;
static int timeout_usecs = DEF_TIMEOUT_USECS;
static int max_errors = MAX_ERRORS;
static long w_standard_timeouts = 0;
static long w_pci_debug = 0;
static long w_instance = 0;
static long disable_dma = 0;
static long atapi_debug = 0;
static long w_identify_wakeup_ticks;
static long wakeup_ticks;
static long w_atapi_dma;
PRIVATE int w_testing = 0;
PRIVATE int w_silent = 0;
static int w_testing = 0;
static int w_silent = 0;
PRIVATE int w_next_drive = 0;
static int w_next_drive = 0;
PRIVATE u32_t system_hz;
static 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
* the fixed locations, whether present or not.
*/
PRIVATE struct wini { /* main drive struct, one entry per drive */
static struct wini { /* main drive struct, one entry per drive */
unsigned state; /* drive state: deaf, initialized, dead */
unsigned short w_status; /* device status register */
unsigned base_cmd; /* command base register */
@@ -92,19 +92,19 @@ PRIVATE struct wini { /* main drive struct, one entry per drive */
struct device subpart[SUB_PER_DRIVE]; /* subpartitions */
} wini[MAX_DRIVES], *w_wn;
PRIVATE int w_device = -1;
static int w_device = -1;
PUBLIC int w_command; /* current command in execution */
PRIVATE int w_drive; /* selected drive */
PRIVATE struct device *w_dv; /* device's base and size */
int w_command; /* current command in execution */
static int w_drive; /* selected drive */
static struct device *w_dv; /* device's base and size */
PRIVATE u8_t *tmp_buf;
static u8_t *tmp_buf;
#define ATA_DMA_SECTORS 64
#define ATA_DMA_BUF_SIZE (ATA_DMA_SECTORS*SECTOR_SIZE)
PRIVATE char *dma_buf;
PRIVATE phys_bytes dma_buf_phys;
static char *dma_buf;
static phys_bytes dma_buf_phys;
#define N_PRDTE 1024 /* Should be enough for large requests */
@@ -117,13 +117,13 @@ struct prdte
};
#define PRDT_BYTES (sizeof(struct prdte) * N_PRDTE)
PRIVATE struct prdte *prdt;
PRIVATE phys_bytes prdt_phys;
static struct prdte *prdt;
static phys_bytes prdt_phys;
#define PRDTE_FL_EOT 0x80 /* End of table */
/* IDE devices we trust are IDE devices. */
PRIVATE struct quirk
static struct quirk
{
int pci_class, pci_subclass, pci_interface;
u16_t vendor;
@@ -136,58 +136,58 @@ PRIVATE struct quirk
{ 0, 0, 0, 0, 0 } /* end of list */
};
FORWARD void init_params(void);
FORWARD void init_drive(struct wini *w, int base_cmd, int base_ctl, int
static void init_params(void);
static void init_drive(struct wini *w, int base_cmd, int base_ctl, int
base_dma, int irq, int ack, int hook, int drive);
FORWARD void init_params_pci(int);
FORWARD int w_do_open(dev_t minor, int access);
FORWARD struct device *w_prepare(dev_t dev);
FORWARD struct device *w_part(dev_t minor);
FORWARD int w_identify(void);
FORWARD char *w_name(void);
FORWARD int w_specify(void);
FORWARD int w_io_test(void);
FORWARD ssize_t w_transfer(dev_t minor, int do_write, u64_t position,
static void init_params_pci(int);
static int w_do_open(dev_t minor, int access);
static struct device *w_prepare(dev_t dev);
static struct device *w_part(dev_t minor);
static int w_identify(void);
static char *w_name(void);
static int w_specify(void);
static int w_io_test(void);
static ssize_t w_transfer(dev_t minor, int do_write, u64_t position,
endpoint_t proc_nr, iovec_t *iov, unsigned int nr_req, int flags);
FORWARD int com_out(struct command *cmd);
FORWARD int com_out_ext(struct command *cmd);
FORWARD int setup_dma(unsigned *sizep, endpoint_t proc_nr, iovec_t *iov,
static int com_out(struct command *cmd);
static int com_out_ext(struct command *cmd);
static int setup_dma(unsigned *sizep, endpoint_t proc_nr, iovec_t *iov,
size_t addr_offset, int do_write);
FORWARD void w_need_reset(void);
FORWARD void ack_irqs(unsigned int);
FORWARD int w_do_close(dev_t minor);
FORWARD int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
static void w_need_reset(void);
static void ack_irqs(unsigned int);
static int w_do_close(dev_t minor);
static int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
cp_grant_id_t grant);
FORWARD void w_hw_int(unsigned int irqs);
FORWARD int com_simple(struct command *cmd);
FORWARD void w_timeout(void);
FORWARD int w_reset(void);
FORWARD void w_intr_wait(void);
FORWARD int at_intr_wait(void);
FORWARD int w_waitfor(int mask, int value);
FORWARD int w_waitfor_dma(int mask, int value);
FORWARD void w_geometry(dev_t minor, struct partition *entry);
static void w_hw_int(unsigned int irqs);
static int com_simple(struct command *cmd);
static void w_timeout(void);
static int w_reset(void);
static void w_intr_wait(void);
static int at_intr_wait(void);
static int w_waitfor(int mask, int value);
static int w_waitfor_dma(int mask, int value);
static void w_geometry(dev_t minor, struct partition *entry);
#if ENABLE_ATAPI
FORWARD int atapi_sendpacket(u8_t *packet, unsigned cnt, int do_dma);
FORWARD int atapi_intr_wait(int dma, size_t max);
FORWARD int atapi_open(void);
FORWARD void atapi_close(void);
FORWARD int atapi_transfer(int do_write, u64_t position, endpoint_t
static int atapi_sendpacket(u8_t *packet, unsigned cnt, int do_dma);
static int atapi_intr_wait(int dma, size_t max);
static int atapi_open(void);
static void atapi_close(void);
static int atapi_transfer(int do_write, u64_t position, endpoint_t
endpt, iovec_t *iov, unsigned int nr_req);
#endif
#define sys_voutb(out, n) at_voutb((out), (n))
FORWARD int at_voutb(pvb_pair_t *, int n);
static int at_voutb(pvb_pair_t *, int n);
#define sys_vinb(in, n) at_vinb((in), (n))
FORWARD int at_vinb(pvb_pair_t *, int n);
static int at_vinb(pvb_pair_t *, int n);
#undef sys_outb
#undef sys_inb
#undef sys_outl
FORWARD int at_out(int line, u32_t port, u32_t value, char *typename,
static int at_out(int line, u32_t port, u32_t value, char *typename,
int type);
FORWARD int at_in(int line, u32_t port, u32_t *value, char *typename,
static int at_in(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)
@@ -195,7 +195,7 @@ FORWARD int at_in(int line, u32_t port, u32_t *value, char *typename,
#define sys_outl(p, v) at_out(__LINE__, (p), (v), "outl", _DIO_LONG)
/* Entry points to this driver. */
PRIVATE struct blockdriver w_dtab = {
static struct blockdriver w_dtab = {
BLOCKDRIVER_TYPE_DISK,/* handle partition requests */
w_do_open, /* open or mount request, initialize device */
w_do_close, /* release device */
@@ -211,8 +211,8 @@ PRIVATE struct blockdriver w_dtab = {
};
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
EXTERN int sef_cb_lu_prepare(int state);
EXTERN int sef_cb_lu_state_isvalid(int state);
EXTERN void sef_cb_lu_state_dump(int state);
@@ -220,7 +220,7 @@ EXTERN void sef_cb_lu_state_dump(int state);
/*===========================================================================*
* at_winchester_task *
*===========================================================================*/
PUBLIC int main(int argc, char *argv[])
int main(int argc, char *argv[])
{
/* SEF local startup. */
env_setargs(argc, argv);
@@ -235,7 +235,7 @@ PUBLIC int main(int argc, char *argv[])
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup(void)
static void sef_local_startup(void)
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -253,7 +253,7 @@ PRIVATE void sef_local_startup(void)
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the at_wini driver. */
system_hz = sys_hz();
@@ -276,7 +276,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
/*===========================================================================*
* init_params *
*===========================================================================*/
PRIVATE void init_params(void)
static void init_params(void)
{
/* This routine is called at startup to initialize the drive parameters. */
@@ -376,7 +376,7 @@ PRIVATE void init_params(void)
/*===========================================================================*
* init_drive *
*===========================================================================*/
PRIVATE void init_drive(struct wini *w, int base_cmd, int base_ctl,
static void init_drive(struct wini *w, int base_cmd, int base_ctl,
int base_dma, int irq, int ack, int hook, int drive)
{
w->state = 0;
@@ -396,7 +396,7 @@ PRIVATE void init_drive(struct wini *w, int base_cmd, int base_ctl,
w->dma = 0;
}
PRIVATE int quirkmatch(struct quirk *table, u8_t bcr, u8_t scr, u8_t interface, u16_t vid, u16_t did) {
static int quirkmatch(struct quirk *table, u8_t bcr, u8_t scr, u8_t interface, u16_t vid, u16_t did) {
while(table->vendor) {
if(table->vendor == vid && table->device == did &&
table->pci_class == bcr &&
@@ -414,7 +414,7 @@ PRIVATE int quirkmatch(struct quirk *table, u8_t bcr, u8_t scr, u8_t interface,
/*===========================================================================*
* init_params_pci *
*===========================================================================*/
PRIVATE void init_params_pci(int skip)
static void init_params_pci(int skip)
{
int i, r, devind, drive, pci_compat = 0;
int irq, irq_hook;
@@ -570,7 +570,7 @@ PRIVATE void init_params_pci(int skip)
/*===========================================================================*
* w_do_open *
*===========================================================================*/
PRIVATE int w_do_open(dev_t minor, int access)
static int w_do_open(dev_t minor, int access)
{
/* Device open: Initialize the controller and read the partition table. */
@@ -639,7 +639,7 @@ PRIVATE int w_do_open(dev_t minor, int access)
/*===========================================================================*
* w_prepare *
*===========================================================================*/
PRIVATE struct device *w_prepare(dev_t device)
static struct device *w_prepare(dev_t device)
{
/* Prepare for I/O on a device. */
w_device = (int) device;
@@ -663,7 +663,7 @@ PRIVATE struct device *w_prepare(dev_t device)
/*===========================================================================*
* w_part *
*===========================================================================*/
PRIVATE struct device *w_part(dev_t device)
static struct device *w_part(dev_t device)
{
/* Return a pointer to the partition information of the given minor device. */
@@ -681,7 +681,7 @@ PRIVATE struct device *w_part(dev_t device)
/*===========================================================================*
* check_dma *
*===========================================================================*/
PRIVATE void
static void
check_dma(struct wini *wn)
{
u32_t dma_status, dma_base;
@@ -764,7 +764,7 @@ check_dma(struct wini *wn)
/*===========================================================================*
* w_identify *
*===========================================================================*/
PRIVATE int w_identify(void)
static int w_identify(void)
{
/* Find out if a device exists, if it is an old AT disk, or a newer ATA
* drive, a removable media device, etc.
@@ -916,7 +916,7 @@ PRIVATE int w_identify(void)
/*===========================================================================*
* w_name *
*===========================================================================*/
PRIVATE char *w_name(void)
static char *w_name(void)
{
/* Return a name for the current device. */
static char name[] = "AT0-D0";
@@ -929,7 +929,7 @@ PRIVATE char *w_name(void)
/*===========================================================================*
* w_io_test *
*===========================================================================*/
PRIVATE int w_io_test(void)
static int w_io_test(void)
{
int save_dev;
int save_timeout, save_errors, save_wakeup;
@@ -987,7 +987,7 @@ PRIVATE int w_io_test(void)
/*===========================================================================*
* w_specify *
*===========================================================================*/
PRIVATE int w_specify(void)
static int w_specify(void)
{
/* Routine to initialize the drive after boot or when a reset is needed. */
@@ -1026,7 +1026,7 @@ PRIVATE int w_specify(void)
/*===========================================================================*
* do_transfer *
*===========================================================================*/
PRIVATE int do_transfer(const struct wini *wn, unsigned int precomp,
static int do_transfer(const struct wini *wn, unsigned int precomp,
unsigned int count, unsigned int sector,
unsigned int do_write, int do_dma)
{
@@ -1098,7 +1098,7 @@ PRIVATE int do_transfer(const struct wini *wn, unsigned int precomp,
return com_out(&cmd);
}
PRIVATE void stop_dma(const struct wini *wn)
static void stop_dma(const struct wini *wn)
{
int r;
@@ -1107,7 +1107,7 @@ PRIVATE void stop_dma(const struct wini *wn)
if (r != 0) panic("stop_dma: sys_outb failed: %d", r);
}
PRIVATE void start_dma(const struct wini *wn, int do_write)
static void start_dma(const struct wini *wn, int do_write)
{
u32_t v;
int r;
@@ -1123,7 +1123,7 @@ PRIVATE void start_dma(const struct wini *wn, int do_write)
if (r != 0) panic("start_dma: sys_outb failed: %d", r);
}
PRIVATE int error_dma(const struct wini *wn)
static int error_dma(const struct wini *wn)
{
int r;
u32_t v;
@@ -1158,7 +1158,7 @@ PRIVATE int error_dma(const struct wini *wn)
/*===========================================================================*
* w_transfer *
*===========================================================================*/
PRIVATE ssize_t w_transfer(
static ssize_t w_transfer(
dev_t minor, /* minor device to perform the transfer on */
int do_write, /* read or write? */
u64_t position, /* offset on device to read or write */
@@ -1382,7 +1382,7 @@ PRIVATE ssize_t w_transfer(
/*===========================================================================*
* com_out *
*===========================================================================*/
PRIVATE int com_out(cmd)
static int com_out(cmd)
struct command *cmd; /* Command block */
{
/* Output the command block to the winchester controller and return status */
@@ -1433,7 +1433,7 @@ struct command *cmd; /* Command block */
/*===========================================================================*
* com_out_ext *
*===========================================================================*/
PRIVATE int com_out_ext(cmd)
static int com_out_ext(cmd)
struct command *cmd; /* Command block */
{
/* Output the command block to the winchester controller and return status */
@@ -1487,7 +1487,7 @@ struct command *cmd; /* Command block */
/*===========================================================================*
* setup_dma *
*===========================================================================*/
PRIVATE int setup_dma(
static int setup_dma(
unsigned *sizep,
endpoint_t proc_nr,
iovec_t *iov,
@@ -1611,7 +1611,7 @@ PRIVATE int setup_dma(
/*===========================================================================*
* w_need_reset *
*===========================================================================*/
PRIVATE void w_need_reset(void)
static void w_need_reset(void)
{
/* The controller needs to be reset. */
struct wini *wn;
@@ -1627,7 +1627,7 @@ PRIVATE void w_need_reset(void)
/*===========================================================================*
* w_do_close *
*===========================================================================*/
PRIVATE int w_do_close(dev_t minor)
static int w_do_close(dev_t minor)
{
/* Device close: Release a device. */
if (w_prepare(minor) == NULL)
@@ -1642,7 +1642,7 @@ PRIVATE int w_do_close(dev_t minor)
/*===========================================================================*
* com_simple *
*===========================================================================*/
PRIVATE int com_simple(cmd)
static int com_simple(cmd)
struct command *cmd; /* Command block */
{
/* A simple controller command, only one interrupt and no data-out phase. */
@@ -1658,7 +1658,7 @@ struct command *cmd; /* Command block */
/*===========================================================================*
* w_timeout *
*===========================================================================*/
PRIVATE void w_timeout(void)
static void w_timeout(void)
{
struct wini *wn = w_wn;
@@ -1691,7 +1691,7 @@ PRIVATE void w_timeout(void)
/*===========================================================================*
* w_reset *
*===========================================================================*/
PRIVATE int w_reset(void)
static int w_reset(void)
{
/* Issue a reset to the controller. This is done after any catastrophe,
* like the controller refusing to respond.
@@ -1737,7 +1737,7 @@ PRIVATE int w_reset(void)
/*===========================================================================*
* w_intr_wait *
*===========================================================================*/
PRIVATE void w_intr_wait(void)
static void w_intr_wait(void)
{
/* Wait for a task completion interrupt. */
@@ -1794,7 +1794,7 @@ PRIVATE void w_intr_wait(void)
/*===========================================================================*
* at_intr_wait *
*===========================================================================*/
PRIVATE int at_intr_wait(void)
static int at_intr_wait(void)
{
/* Wait for an interrupt, study the status bits and return error/success. */
int r, s;
@@ -1819,7 +1819,7 @@ PRIVATE int at_intr_wait(void)
/*===========================================================================*
* w_waitfor *
*===========================================================================*/
PRIVATE int w_waitfor(mask, value)
static int w_waitfor(mask, value)
int mask; /* status mask */
int value; /* required status */
{
@@ -1845,7 +1845,7 @@ int value; /* required status */
/*===========================================================================*
* w_waitfor_dma *
*===========================================================================*/
PRIVATE int w_waitfor_dma(mask, value)
static int w_waitfor_dma(mask, value)
int mask; /* status mask */
int value; /* required status */
{
@@ -1869,7 +1869,7 @@ int value; /* required status */
/*===========================================================================*
* w_geometry *
*===========================================================================*/
PRIVATE void w_geometry(dev_t minor, struct partition *entry)
static void w_geometry(dev_t minor, struct partition *entry)
{
struct wini *wn;
@@ -1892,7 +1892,7 @@ PRIVATE void w_geometry(dev_t minor, struct partition *entry)
/*===========================================================================*
* atapi_open *
*===========================================================================*/
PRIVATE int atapi_open(void)
static int atapi_open(void)
{
/* Should load and lock the device and obtain its size. For now just set the
* size of the device to something big. What is really needed is a generic
@@ -1905,12 +1905,12 @@ PRIVATE int atapi_open(void)
/*===========================================================================*
* atapi_close *
*===========================================================================*/
PRIVATE void atapi_close(void)
static void atapi_close(void)
{
/* Should unlock the device. For now do nothing. (XXX) */
}
PRIVATE void sense_request(void)
static void sense_request(void)
{
int r, i;
static u8_t sense[100], packet[ATAPI_PACKETSIZE];
@@ -1943,7 +1943,7 @@ PRIVATE void sense_request(void)
/*===========================================================================*
* atapi_transfer *
*===========================================================================*/
PRIVATE int atapi_transfer(
static int atapi_transfer(
int do_write, /* read or write? */
u64_t position, /* offset on device to read or write */
endpoint_t proc_nr, /* process doing the request */
@@ -2141,7 +2141,7 @@ PRIVATE int atapi_transfer(
/*===========================================================================*
* atapi_sendpacket *
*===========================================================================*/
PRIVATE int atapi_sendpacket(packet, cnt, do_dma)
static int atapi_sendpacket(packet, cnt, do_dma)
u8_t *packet;
unsigned cnt;
int do_dma;
@@ -2204,7 +2204,7 @@ int do_dma;
/*===========================================================================*
* w_ioctl *
*===========================================================================*/
PRIVATE int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
static int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
cp_grant_id_t grant)
{
int r, timeout, prev, count;
@@ -2285,7 +2285,7 @@ PRIVATE int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
/*===========================================================================*
* w_hw_int *
*===========================================================================*/
PRIVATE void w_hw_int(unsigned int irqs)
static void w_hw_int(unsigned int irqs)
{
/* Leftover interrupt(s) received; ack it/them. */
ack_irqs(irqs);
@@ -2295,7 +2295,7 @@ PRIVATE void w_hw_int(unsigned int irqs)
/*===========================================================================*
* ack_irqs *
*===========================================================================*/
PRIVATE void ack_irqs(unsigned int irqs)
static void ack_irqs(unsigned int irqs)
{
unsigned int drive;
u32_t w_status;
@@ -2323,7 +2323,7 @@ PRIVATE void ack_irqs(unsigned int irqs)
#define STSTR(a) if (status & STATUS_ ## a) { strcat(str, #a); strcat(str, " "); }
#define ERRSTR(a) if (e & ERROR_ ## a) { strcat(str, #a); strcat(str, " "); }
PRIVATE char *strstatus(int status)
static char *strstatus(int status)
{
static char str[200];
str[0] = '\0';
@@ -2338,7 +2338,7 @@ PRIVATE char *strstatus(int status)
return str;
}
PRIVATE char *strerr(int e)
static char *strerr(int e)
{
static char str[200];
str[0] = '\0';
@@ -2358,7 +2358,7 @@ PRIVATE char *strerr(int e)
/*===========================================================================*
* atapi_intr_wait *
*===========================================================================*/
PRIVATE int atapi_intr_wait(int UNUSED(do_dma), size_t UNUSED(max))
static int atapi_intr_wait(int UNUSED(do_dma), size_t UNUSED(max))
{
/* Wait for an interrupt and study the results. Returns a number of bytes
* that need to be transferred, or an error code.
@@ -2431,7 +2431,7 @@ PRIVATE int atapi_intr_wait(int UNUSED(do_dma), size_t UNUSED(max))
#undef sys_voutb
#undef sys_vinb
PRIVATE int at_voutb(pvb_pair_t *pvb, int n)
static int at_voutb(pvb_pair_t *pvb, int n)
{
int s, i;
if ((s=sys_voutb(pvb,n)) == OK)
@@ -2442,7 +2442,7 @@ PRIVATE int at_voutb(pvb_pair_t *pvb, int n)
panic("sys_voutb failed");
}
PRIVATE int at_vinb(pvb_pair_t *pvb, int n)
static int at_vinb(pvb_pair_t *pvb, int n)
{
int s, i;
if ((s=sys_vinb(pvb,n)) == OK)
@@ -2453,7 +2453,7 @@ PRIVATE int at_vinb(pvb_pair_t *pvb, int n)
panic("sys_vinb failed");
}
PRIVATE int at_out(int line, u32_t port, u32_t value, char *typename, int type)
static int at_out(int line, u32_t port, u32_t value, char *typename, int type)
{
int s;
s = sys_out(port, value, type);
@@ -2465,7 +2465,7 @@ PRIVATE int at_out(int line, u32_t port, u32_t value, char *typename, int type)
}
PRIVATE int at_in(int line, u32_t port, u32_t *value, char *typename, int type)
static int at_in(int line, u32_t port, u32_t *value, char *typename, int type)
{
int s;
s = sys_in(port, value, type);

View File

@@ -19,7 +19,7 @@ EXTERN int w_command;
/*===========================================================================*
* sef_cb_lu_prepare *
*===========================================================================*/
PUBLIC int sef_cb_lu_prepare(int state)
int sef_cb_lu_prepare(int state)
{
int is_ready;
@@ -49,7 +49,7 @@ PUBLIC int sef_cb_lu_prepare(int state)
/*===========================================================================*
* sef_cb_lu_state_isvalid *
*===========================================================================*/
PUBLIC int sef_cb_lu_state_isvalid(int state)
int sef_cb_lu_state_isvalid(int state)
{
return SEF_LU_STATE_IS_STANDARD(state) || AT_STATE_IS_CUSTOM(state);
}
@@ -57,7 +57,7 @@ PUBLIC int sef_cb_lu_state_isvalid(int state)
/*===========================================================================*
* sef_cb_lu_state_dump *
*===========================================================================*/
PUBLIC void sef_cb_lu_state_dump(int state)
void sef_cb_lu_state_dump(int state)
{
sef_lu_dprint("at_wini: live update state = %d\n", state);
sef_lu_dprint("at_wini: w_command = 0x%02X\n", w_command);

View File

@@ -32,7 +32,7 @@ typedef struct {
u8_t data[ATL2_RXD_SIZE - sizeof(u32_t) * 2];
} rxd_t;
PRIVATE struct {
static struct {
int devind; /* PCI device index */
int irq; /* IRQ number */
int hook_id; /* IRQ hook ID */
@@ -82,14 +82,14 @@ PRIVATE struct {
#define ATL2_ALIGN_32(n) (((n) + 3) & ~3)
PRIVATE iovec_s_t iovec[NR_IOREQS];
static iovec_s_t iovec[NR_IOREQS];
PRIVATE int instance;
static int instance;
/*===========================================================================*
* atl2_read_vpd *
*===========================================================================*/
PRIVATE int atl2_read_vpd(int index, u32_t *res)
static int atl2_read_vpd(int index, u32_t *res)
{
/* Read a value from the VPD register area.
*/
@@ -123,7 +123,7 @@ PRIVATE int atl2_read_vpd(int index, u32_t *res)
/*===========================================================================*
* atl2_get_vpd_hwaddr *
*===========================================================================*/
PRIVATE int atl2_get_vpd_hwaddr(void)
static int atl2_get_vpd_hwaddr(void)
{
/* Read the MAC address from the EEPROM, using the Vital Product Data
* register interface.
@@ -176,7 +176,7 @@ PRIVATE int atl2_get_vpd_hwaddr(void)
/*===========================================================================*
* atl2_get_hwaddr *
*===========================================================================*/
PRIVATE void atl2_get_hwaddr(void)
static void atl2_get_hwaddr(void)
{
/* Get the MAC address of the card. First try the EEPROM; if that
* fails, just use whatever the card was already set to.
@@ -196,7 +196,7 @@ PRIVATE void atl2_get_hwaddr(void)
/*===========================================================================*
* atl2_read_mdio *
*===========================================================================*/
PRIVATE int atl2_read_mdio(int addr, u16_t *res)
static int atl2_read_mdio(int addr, u16_t *res)
{
/* Read a MII PHY register using MDIO.
*/
@@ -227,7 +227,7 @@ PRIVATE int atl2_read_mdio(int addr, u16_t *res)
/*===========================================================================*
* atl2_alloc_dma *
*===========================================================================*/
PRIVATE int atl2_alloc_dma(void)
static int atl2_alloc_dma(void)
{
/* Allocate DMA ring buffers.
*/
@@ -263,7 +263,7 @@ PRIVATE int atl2_alloc_dma(void)
/*===========================================================================*
* atl2_stop *
*===========================================================================*/
PRIVATE int atl2_stop(void)
static int atl2_stop(void)
{
/* Stop the device.
*/
@@ -299,7 +299,7 @@ PRIVATE int atl2_stop(void)
/*===========================================================================*
* atl2_reset *
*===========================================================================*/
PRIVATE int atl2_reset(void)
static int atl2_reset(void)
{
/* Reset the device to a known good state.
*/
@@ -334,7 +334,7 @@ PRIVATE int atl2_reset(void)
/*===========================================================================*
* atl2_set_mode *
*===========================================================================*/
PRIVATE void atl2_set_mode(void)
static void atl2_set_mode(void)
{
/* Reconfigure the device's promiscuity, multicast, and broadcast mode
* settings.
@@ -357,7 +357,7 @@ PRIVATE void atl2_set_mode(void)
/*===========================================================================*
* atl2_setup *
*===========================================================================*/
PRIVATE int atl2_setup(void)
static int atl2_setup(void)
{
/* Set up the device for normal operation.
*/
@@ -457,7 +457,7 @@ PRIVATE int atl2_setup(void)
/*===========================================================================*
* atl2_probe *
*===========================================================================*/
PRIVATE int atl2_probe(int skip)
static int atl2_probe(int skip)
{
/* Find a matching PCI device.
*/
@@ -490,7 +490,7 @@ PRIVATE int atl2_probe(int skip)
/*===========================================================================*
* atl2_init *
*===========================================================================*/
PRIVATE void atl2_init(int devind)
static void atl2_init(int devind)
{
/* Initialize the device.
*/
@@ -537,7 +537,7 @@ PRIVATE void atl2_init(int devind)
/*===========================================================================*
* atl2_tx_stat *
*===========================================================================*/
PRIVATE void atl2_tx_stat(u32_t stat)
static void atl2_tx_stat(u32_t stat)
{
/* Update statistics for packet transmission.
*/
@@ -564,7 +564,7 @@ PRIVATE void atl2_tx_stat(u32_t stat)
/*===========================================================================*
* atl2_rx_stat *
*===========================================================================*/
PRIVATE void atl2_rx_stat(u32_t stat)
static void atl2_rx_stat(u32_t stat)
{
/* Update statistics for packet receipt.
*/
@@ -587,7 +587,7 @@ PRIVATE void atl2_rx_stat(u32_t stat)
/*===========================================================================*
* atl2_tx_advance *
*===========================================================================*/
PRIVATE int atl2_tx_advance(void)
static int atl2_tx_advance(void)
{
/* Advance the TxD/TxS tails by as many sent packets as found.
*/
@@ -642,7 +642,7 @@ PRIVATE int atl2_tx_advance(void)
/*===========================================================================*
* atl2_rx_advance *
*===========================================================================*/
PRIVATE void atl2_rx_advance(int next)
static void atl2_rx_advance(int next)
{
/* Advance the RxD tail by as many failed receipts as possible, and
* see if there is an actual packet left to receive. If 'next' is set,
@@ -710,7 +710,7 @@ PRIVATE void atl2_rx_advance(int next)
/*===========================================================================*
* atl2_reply *
*===========================================================================*/
PRIVATE void atl2_reply(void)
static void atl2_reply(void)
{
/* Send a task reply to Inet.
*/
@@ -740,7 +740,7 @@ PRIVATE void atl2_reply(void)
/*===========================================================================*
* atl2_readv *
*===========================================================================*/
PRIVATE void atl2_readv(const message *m, int from_int)
static void atl2_readv(const message *m, int from_int)
{
/* Read packet data.
*/
@@ -835,7 +835,7 @@ suspend:
/*===========================================================================*
* atl2_writev *
*===========================================================================*/
PRIVATE void atl2_writev(const message *m, int from_int)
static void atl2_writev(const message *m, int from_int)
{
/* Write packet data.
*/
@@ -959,7 +959,7 @@ suspend:
/*===========================================================================*
* atl2_intr *
*===========================================================================*/
PRIVATE void atl2_intr(const message *UNUSED(m))
static void atl2_intr(const message *UNUSED(m))
{
/* Interrupt received.
*/
@@ -1014,7 +1014,7 @@ PRIVATE void atl2_intr(const message *UNUSED(m))
/*===========================================================================*
* atl2_conf *
*===========================================================================*/
PRIVATE void atl2_conf(message *m)
static void atl2_conf(message *m)
{
/* Configure the mode of the card.
*/
@@ -1044,7 +1044,7 @@ PRIVATE void atl2_conf(message *m)
/*===========================================================================*
* atl2_getstat *
*===========================================================================*/
PRIVATE void atl2_getstat(message *m)
static void atl2_getstat(message *m)
{
/* Copy out statistics.
*/
@@ -1062,7 +1062,7 @@ PRIVATE void atl2_getstat(message *m)
/*===========================================================================*
* atl2_dump_link *
*===========================================================================*/
PRIVATE void atl2_dump_link(void)
static void atl2_dump_link(void)
{
/* Dump link status.
*/
@@ -1099,7 +1099,7 @@ PRIVATE void atl2_dump_link(void)
/*===========================================================================*
* atl2_dump *
*===========================================================================*/
PRIVATE void atl2_dump(void)
static void atl2_dump(void)
{
/* Dump statistics.
*/
@@ -1143,7 +1143,7 @@ PRIVATE void atl2_dump(void)
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize the atl2 driver.
*/
@@ -1184,7 +1184,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
/* In case of a termination signal, shut down this driver.
* Stop the device, and deallocate resources as proof of concept.
@@ -1214,7 +1214,7 @@ PRIVATE void sef_cb_signal_handler(int signo)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup(void)
static void sef_local_startup(void)
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);

View File

@@ -26,15 +26,15 @@
#define MUTE 0x80
FORWARD int ak4531_write(u8_t address, u8_t data);
FORWARD int ak4531_finished(void);
FORWARD int set_volume(struct volume_level *level, int cmd_left, int
static int ak4531_write(u8_t address, u8_t data);
static int ak4531_finished(void);
static int set_volume(struct volume_level *level, int cmd_left, int
cmd_right, int max_level);
PRIVATE u16_t base_address;
PRIVATE u16_t status_register;
PRIVATE u16_t status_bit;
PRIVATE u16_t poll_address;
static u16_t base_address;
static u16_t status_register;
static u16_t status_bit;
static u16_t poll_address;
u8_t mixer_values[0x20] = {
0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* 0x00 - 0x07 */
@@ -53,7 +53,7 @@ u8_t mixer_values[0x20] = {
PRIVATE int ak4531_finished(void) {
static int ak4531_finished(void) {
int i;
u16_t cstat;
for (i = 0; i < 0x40000; i++) {
@@ -66,7 +66,7 @@ PRIVATE int ak4531_finished(void) {
}
PRIVATE int ak4531_write (u8_t address, u8_t data) {
static int ak4531_write (u8_t address, u8_t data) {
u16_t to_be_written;
@@ -80,7 +80,7 @@ PRIVATE int ak4531_write (u8_t address, u8_t data) {
}
PUBLIC int ak4531_init(u16_t base, u16_t status_reg, u16_t bit,
int ak4531_init(u16_t base, u16_t status_reg, u16_t bit,
u16_t poll) {
int i;
@@ -107,7 +107,7 @@ PUBLIC int ak4531_init(u16_t base, u16_t status_reg, u16_t bit,
}
PUBLIC int ak4531_get_set_volume(struct volume_level *level, int flag) {
int ak4531_get_set_volume(struct volume_level *level, int flag) {
int cmd_left, cmd_right, max_level;
max_level = 0x1f;
@@ -160,7 +160,7 @@ PUBLIC int ak4531_get_set_volume(struct volume_level *level, int flag) {
}
PRIVATE int set_volume(struct volume_level *level, int cmd_left, int cmd_right,
static int set_volume(struct volume_level *level, int cmd_left, int cmd_right,
int max_level) {
if(level->right < 0) level->right = 0;

View File

@@ -28,32 +28,32 @@
/* prototypes of private functions */
FORWARD int detect_hw(void);
FORWARD int disable_int(int sub_dev);
FORWARD int set_stereo(u32_t stereo, int sub_dev);
FORWARD int set_bits(u32_t nr_of_bits, int sub_dev);
FORWARD int set_sample_rate(u32_t rate, int sub_dev);
FORWARD int set_sign(u32_t val, int sub_dev);
FORWARD int get_max_frag_size(u32_t * val, int *len, int sub_dev);
FORWARD int set_frag_size(u32_t fragment_size, int sub_dev);
FORWARD int set_int_cnt(int sub_dev);
FORWARD int free_buf(u32_t *val, int *len, int sub_dev);
FORWARD int get_samples_in_buf(u32_t *val, int *len, int sub_dev);
FORWARD int get_set_volume(struct volume_level *level, int *len, int
static int detect_hw(void);
static int disable_int(int sub_dev);
static int set_stereo(u32_t stereo, int sub_dev);
static int set_bits(u32_t nr_of_bits, int sub_dev);
static int set_sample_rate(u32_t rate, int sub_dev);
static int set_sign(u32_t val, int sub_dev);
static int get_max_frag_size(u32_t * val, int *len, int sub_dev);
static int set_frag_size(u32_t fragment_size, int sub_dev);
static int set_int_cnt(int sub_dev);
static int free_buf(u32_t *val, int *len, int sub_dev);
static int get_samples_in_buf(u32_t *val, int *len, int sub_dev);
static int get_set_volume(struct volume_level *level, int *len, int
sub_dev, int flag);
FORWARD int reset(int sub_dev);
static int reset(int sub_dev);
DEV_STRUCT dev;
aud_sub_dev_conf_t aud_conf[4];
PUBLIC sub_dev_t sub_dev[4];
PUBLIC special_file_t special_file[4];
PUBLIC drv_t drv;
sub_dev_t sub_dev[4];
special_file_t special_file[4];
drv_t drv;
PUBLIC int drv_init(void) {
int drv_init(void) {
drv.DriverName = DRIVER_NAME;
drv.NrOfSubDevices = 4;
drv.NrOfSpecialFiles = 4;
@@ -106,7 +106,7 @@ PUBLIC int drv_init(void) {
}
PUBLIC int drv_init_hw (void) {
int drv_init_hw (void) {
u16_t i, j;
u16_t chip_sel_ctrl_reg;
@@ -167,7 +167,7 @@ PUBLIC int drv_init_hw (void) {
}
PRIVATE int detect_hw(void) {
static int detect_hw(void) {
u32_t device;
int devind;
u16_t v_id, d_id;
@@ -210,7 +210,7 @@ PRIVATE int detect_hw(void) {
}
PRIVATE int reset(int chan) {
static int reset(int chan) {
drv_stop(chan);
sub_dev[chan].OutOfData = 1;
@@ -455,7 +455,7 @@ int drv_resume(int sub_dev) {
}
PRIVATE int set_bits(u32_t nr_of_bits, int sub_dev) {
static int set_bits(u32_t nr_of_bits, int sub_dev) {
/* set format bits for specified channel. */
u16_t size_16_bit, ser_interface;
@@ -479,7 +479,7 @@ PRIVATE int set_bits(u32_t nr_of_bits, int sub_dev) {
}
PRIVATE int set_stereo(u32_t stereo, int sub_dev) {
static int set_stereo(u32_t stereo, int sub_dev) {
/* set format bits for specified channel. */
u16_t stereo_bit, ser_interface;
@@ -501,12 +501,12 @@ PRIVATE int set_stereo(u32_t stereo, int sub_dev) {
}
PRIVATE int set_sign(u32_t UNUSED(val), int UNUSED(sub_dev)) {
static int set_sign(u32_t UNUSED(val), int UNUSED(sub_dev)) {
return OK;
}
PRIVATE int set_frag_size(u32_t fragment_size, int sub_dev_nr) {
static int set_frag_size(u32_t fragment_size, int sub_dev_nr) {
if (fragment_size > (sub_dev[sub_dev_nr].DmaSize /
sub_dev[sub_dev_nr].NrOfDmaFragments) ||
fragment_size < sub_dev[sub_dev_nr].MinFragmentSize) {
@@ -518,7 +518,7 @@ PRIVATE int set_frag_size(u32_t fragment_size, int sub_dev_nr) {
}
PRIVATE int set_sample_rate(u32_t rate, int sub_dev) {
static int set_sample_rate(u32_t rate, int sub_dev) {
/* currently only 44.1kHz */
u32_t controlRegister;
@@ -536,7 +536,7 @@ PRIVATE int set_sample_rate(u32_t rate, int sub_dev) {
}
PRIVATE int set_int_cnt(int chan) {
static int set_int_cnt(int chan) {
/* Write interrupt count for specified channel.
After <DspFragmentSize> bytes, an interrupt will be generated */
@@ -573,7 +573,7 @@ PRIVATE int set_int_cnt(int chan) {
}
PRIVATE int get_max_frag_size(u32_t * val, int * len, int sub_dev_nr) {
static int get_max_frag_size(u32_t * val, int * len, int sub_dev_nr) {
*len = sizeof(*val);
*val = (sub_dev[sub_dev_nr].DmaSize /
sub_dev[sub_dev_nr].NrOfDmaFragments);
@@ -581,7 +581,7 @@ PRIVATE int get_max_frag_size(u32_t * val, int * len, int sub_dev_nr) {
}
PRIVATE int disable_int(int chan) {
static int disable_int(int chan) {
u16_t ser_interface, int_en_bit;
switch(chan) {
@@ -597,7 +597,7 @@ PRIVATE int disable_int(int chan) {
}
PRIVATE int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) {
static int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) {
u16_t samp_ct_reg;
u16_t curr_samp_ct_reg;
u16_t curr_samp_ct; /* counts back from SAMP_CT till 0 */
@@ -629,7 +629,7 @@ PRIVATE int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) {
/* returns 1 if there are free buffers */
PRIVATE int free_buf (u32_t *val, int *len, int sub_dev_nr) {
static int free_buf (u32_t *val, int *len, int sub_dev_nr) {
*len = sizeof(*val);
if (sub_dev[sub_dev_nr].BufLength ==
sub_dev[sub_dev_nr].NrOfExtraBuffers) {
@@ -642,7 +642,7 @@ PRIVATE int free_buf (u32_t *val, int *len, int sub_dev_nr) {
}
PRIVATE int get_set_volume(struct volume_level *level, int *len, int sub_dev,
static int get_set_volume(struct volume_level *level, int *len, int sub_dev,
int flag) {
*len = sizeof(struct volume_level);
if (sub_dev == MIXER) {

View File

@@ -14,7 +14,7 @@
/*===========================================================================*
* helper functions for I/O *
*===========================================================================*/
PUBLIC u32_t pci_inb(u16_t port) {
u32_t pci_inb(u16_t port) {
u32_t value;
int s;
if ((s=sys_inb(port, &value)) !=OK)
@@ -23,7 +23,7 @@ PUBLIC u32_t pci_inb(u16_t port) {
}
PUBLIC u32_t pci_inw(u16_t port) {
u32_t pci_inw(u16_t port) {
u32_t value;
int s;
if ((s=sys_inw(port, &value)) !=OK)
@@ -32,7 +32,7 @@ PUBLIC u32_t pci_inw(u16_t port) {
}
PUBLIC u32_t pci_inl(u16_t port) {
u32_t pci_inl(u16_t port) {
u32_t value;
int s;
if ((s=sys_inl(port, &value)) !=OK)
@@ -41,21 +41,21 @@ PUBLIC u32_t pci_inl(u16_t port) {
}
PUBLIC void pci_outb(u16_t port, u8_t value) {
void pci_outb(u16_t port, u8_t value) {
int s;
if ((s=sys_outb(port, value)) !=OK)
printf("%s: warning, sys_outb failed: %d\n", DRIVER_NAME, s);
}
PUBLIC void pci_outw(u16_t port, u16_t value) {
void pci_outw(u16_t port, u16_t value) {
int s;
if ((s=sys_outw(port, value)) !=OK)
printf("%s: warning, sys_outw failed: %d\n", DRIVER_NAME, s);
}
PUBLIC void pci_outl(u16_t port, u32_t value) {
void pci_outl(u16_t port, u32_t value) {
int s;
if ((s=sys_outl(port, value)) !=OK)
printf("%s: warning, sys_outl failed: %d\n", DRIVER_NAME, s);

View File

@@ -6,15 +6,15 @@
/* AC97 Mixer and Mode control function prototypes */
FORWARD int AC97_write(const DEV_STRUCT * pCC, u16_t wAddr, u16_t
static int AC97_write(const DEV_STRUCT * pCC, u16_t wAddr, u16_t
wData);
FORWARD int AC97_write_unsynced(const DEV_STRUCT * pCC, u16_t wAddr,
static int AC97_write_unsynced(const DEV_STRUCT * pCC, u16_t wAddr,
u16_t wData);
FORWARD int AC97_read_unsynced(const DEV_STRUCT * pCC, u16_t wAddr,
static int AC97_read_unsynced(const DEV_STRUCT * pCC, u16_t wAddr,
u16_t *data);
FORWARD void set_nice_volume(void);
FORWARD int AC97_get_volume(struct volume_level *level);
FORWARD int AC97_set_volume(const struct volume_level *level);
static void set_nice_volume(void);
static int AC97_get_volume(struct volume_level *level);
static int AC97_set_volume(const struct volume_level *level);
@@ -56,7 +56,7 @@ static DEV_STRUCT *dev;
#if 0
PRIVATE void set_src_sync_state (int state)
static void set_src_sync_state (int state)
{
if (state < 0)
SrcSyncState = SRC_UNSYNCED;
@@ -68,7 +68,7 @@ PRIVATE void set_src_sync_state (int state)
#endif
PRIVATE int AC97_write (const DEV_STRUCT * pCC, u16_t wAddr, u16_t wData)
static int AC97_write (const DEV_STRUCT * pCC, u16_t wAddr, u16_t wData)
{
u32_t dtemp, i;
u16_t wBaseAddr = pCC->base;
@@ -133,7 +133,7 @@ u16_t wBaseAddr = pCC->base;
#if 0
PRIVATE int AC97_read (const DEV_STRUCT * pCC, u16_t wAddr, u16_t *data)
static int AC97_read (const DEV_STRUCT * pCC, u16_t wAddr, u16_t *data)
{
u32_t dtemp, i;
u16_t base = pCC->base;
@@ -207,7 +207,7 @@ u16_t base = pCC->base;
#endif
PRIVATE int AC97_write_unsynced (const DEV_STRUCT * pCC, u16_t wAddr,
static int AC97_write_unsynced (const DEV_STRUCT * pCC, u16_t wAddr,
u16_t wData)
{
/* wait for WIP to go away */
@@ -220,7 +220,7 @@ PRIVATE int AC97_write_unsynced (const DEV_STRUCT * pCC, u16_t wAddr,
}
PRIVATE int AC97_read_unsynced (const DEV_STRUCT * pCC, u16_t wAddr,
static int AC97_read_unsynced (const DEV_STRUCT * pCC, u16_t wAddr,
u16_t *data)
{
u32_t dtemp;
@@ -309,7 +309,7 @@ int AC97_init( DEV_STRUCT * pCC ) {
}
PRIVATE void set_nice_volume(void) {
static void set_nice_volume(void) {
/* goofy code to set the DAC1 channel to an audibe volume
to be able to test it without using the mixer */
@@ -340,7 +340,7 @@ PRIVATE void set_nice_volume(void) {
}
PRIVATE int get_volume(u8_t *left, u8_t *right, int cmd) {
static int get_volume(u8_t *left, u8_t *right, int cmd) {
u16_t value;
AC97_read_unsynced(dev, (u16_t)cmd, &value);
@@ -352,7 +352,7 @@ PRIVATE int get_volume(u8_t *left, u8_t *right, int cmd) {
}
PRIVATE int set_volume(int left, int right, int cmd) {
static int set_volume(int left, int right, int cmd) {
u16_t waarde;
waarde = (u16_t)((left<<8)|right);
@@ -393,7 +393,7 @@ int AC97_get_set_volume(struct volume_level *level, int flag) {
}
PRIVATE int AC97_get_volume(struct volume_level *level) {
static int AC97_get_volume(struct volume_level *level) {
int cmd;
u8_t left;
u8_t right;
@@ -453,7 +453,7 @@ PRIVATE int AC97_get_volume(struct volume_level *level) {
}
PRIVATE int AC97_set_volume(const struct volume_level *level) {
static int AC97_set_volume(const struct volume_level *level) {
int cmd;
int left;
int right;

View File

@@ -34,32 +34,32 @@
/* prototypes of private functions */
FORWARD int detect_hw(void);
FORWARD int disable_int(int sub_dev);
FORWARD int set_stereo(u32_t stereo, int sub_dev);
FORWARD int set_bits(u32_t nr_of_bits, int sub_dev);
FORWARD int set_sample_rate(u32_t rate, int sub_dev);
FORWARD int set_sign(u32_t val, int sub_dev);
FORWARD int get_max_frag_size(u32_t * val, int *len, int sub_dev);
FORWARD int set_frag_size(u32_t fragment_size, int sub_dev);
FORWARD int set_int_cnt(int sub_dev);
FORWARD int free_buf(u32_t *val, int *len, int sub_dev);
FORWARD int get_samples_in_buf(u32_t *val, int *len, int sub_dev);
FORWARD int get_set_volume(struct volume_level *level, int *len, int
static int detect_hw(void);
static int disable_int(int sub_dev);
static int set_stereo(u32_t stereo, int sub_dev);
static int set_bits(u32_t nr_of_bits, int sub_dev);
static int set_sample_rate(u32_t rate, int sub_dev);
static int set_sign(u32_t val, int sub_dev);
static int get_max_frag_size(u32_t * val, int *len, int sub_dev);
static int set_frag_size(u32_t fragment_size, int sub_dev);
static int set_int_cnt(int sub_dev);
static int free_buf(u32_t *val, int *len, int sub_dev);
static int get_samples_in_buf(u32_t *val, int *len, int sub_dev);
static int get_set_volume(struct volume_level *level, int *len, int
sub_dev, int flag);
FORWARD int reset(int sub_dev);
static int reset(int sub_dev);
DEV_STRUCT dev;
aud_sub_dev_conf_t aud_conf[4];
PUBLIC sub_dev_t sub_dev[4];
PUBLIC special_file_t special_file[4];
PUBLIC drv_t drv;
sub_dev_t sub_dev[4];
special_file_t special_file[4];
drv_t drv;
PUBLIC int drv_init(void) {
int drv_init(void) {
drv.DriverName = DRIVER_NAME;
drv.NrOfSubDevices = 4;
drv.NrOfSpecialFiles = 4;
@@ -112,7 +112,7 @@ PUBLIC int drv_init(void) {
}
PUBLIC int drv_init_hw (void) {
int drv_init_hw (void) {
u16_t i, j;
/* First, detect the hardware */
@@ -169,7 +169,7 @@ PUBLIC int drv_init_hw (void) {
}
PRIVATE int detect_hw(void) {
static int detect_hw(void) {
u32_t device;
int devind;
u16_t v_id, d_id;
@@ -212,7 +212,7 @@ PRIVATE int detect_hw(void) {
}
PRIVATE int reset(int chan) {
static int reset(int chan) {
drv_stop(chan);
sub_dev[chan].OutOfData = 1;
@@ -456,7 +456,7 @@ int drv_resume(int sub_dev) {
}
PRIVATE int set_bits(u32_t nr_of_bits, int sub_dev) {
static int set_bits(u32_t nr_of_bits, int sub_dev) {
/* set format bits for specified channel. */
u16_t size_16_bit, ser_interface;
@@ -480,7 +480,7 @@ PRIVATE int set_bits(u32_t nr_of_bits, int sub_dev) {
}
PRIVATE int set_stereo(u32_t stereo, int sub_dev) {
static int set_stereo(u32_t stereo, int sub_dev) {
/* set format bits for specified channel. */
u16_t stereo_bit, ser_interface;
@@ -502,12 +502,12 @@ PRIVATE int set_stereo(u32_t stereo, int sub_dev) {
}
PRIVATE int set_sign(u32_t UNUSED(val), int UNUSED(sub_dev)) {
static int set_sign(u32_t UNUSED(val), int UNUSED(sub_dev)) {
return OK;
}
PRIVATE int set_frag_size(u32_t fragment_size, int sub_dev_nr) {
static int set_frag_size(u32_t fragment_size, int sub_dev_nr) {
if (fragment_size > (sub_dev[sub_dev_nr].DmaSize /
sub_dev[sub_dev_nr].NrOfDmaFragments) ||
fragment_size < sub_dev[sub_dev_nr].MinFragmentSize) {
@@ -519,7 +519,7 @@ PRIVATE int set_frag_size(u32_t fragment_size, int sub_dev_nr) {
}
PRIVATE int set_sample_rate(u32_t rate, int sub_dev) {
static int set_sample_rate(u32_t rate, int sub_dev) {
u32_t src_base_reg;
if (rate > MAX_RATE || rate < MIN_RATE) {
@@ -538,7 +538,7 @@ PRIVATE int set_sample_rate(u32_t rate, int sub_dev) {
}
PRIVATE int set_int_cnt(int chan) {
static int set_int_cnt(int chan) {
/* Write interrupt count for specified channel.
After <DspFragmentSize> bytes, an interrupt will be generated */
@@ -575,7 +575,7 @@ PRIVATE int set_int_cnt(int chan) {
}
PRIVATE int get_max_frag_size(u32_t * val, int * len, int sub_dev_nr) {
static int get_max_frag_size(u32_t * val, int * len, int sub_dev_nr) {
*len = sizeof(*val);
*val = (sub_dev[sub_dev_nr].DmaSize /
sub_dev[sub_dev_nr].NrOfDmaFragments);
@@ -583,7 +583,7 @@ PRIVATE int get_max_frag_size(u32_t * val, int * len, int sub_dev_nr) {
}
PRIVATE int disable_int(int chan) {
static int disable_int(int chan) {
u16_t ser_interface, int_en_bit;
switch(chan) {
@@ -599,7 +599,7 @@ PRIVATE int disable_int(int chan) {
}
PRIVATE int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) {
static int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) {
u16_t samp_ct_reg;
u16_t curr_samp_ct_reg;
u16_t curr_samp_ct; /* counts back from SAMP_CT till 0 */
@@ -631,7 +631,7 @@ PRIVATE int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) {
/* returns 1 if there are free buffers */
PRIVATE int free_buf (u32_t *val, int *len, int sub_dev_nr) {
static int free_buf (u32_t *val, int *len, int sub_dev_nr) {
*len = sizeof(*val);
if (sub_dev[sub_dev_nr].BufLength ==
sub_dev[sub_dev_nr].NrOfExtraBuffers) {
@@ -644,7 +644,7 @@ PRIVATE int free_buf (u32_t *val, int *len, int sub_dev_nr) {
}
PRIVATE int get_set_volume(struct volume_level *level, int *len, int sub_dev,
static int get_set_volume(struct volume_level *level, int *len, int sub_dev,
int flag) {
*len = sizeof(struct volume_level);
if (sub_dev == MIXER) {

View File

@@ -14,7 +14,7 @@
/*===========================================================================*
* helper functions for I/O *
*===========================================================================*/
PUBLIC u32_t pci_inb(u16_t port) {
u32_t pci_inb(u16_t port) {
u32_t value;
int s;
if ((s=sys_inb(port, &value)) !=OK)
@@ -23,7 +23,7 @@ PUBLIC u32_t pci_inb(u16_t port) {
}
PUBLIC u32_t pci_inw(u16_t port) {
u32_t pci_inw(u16_t port) {
u32_t value;
int s;
if ((s=sys_inw(port, &value)) !=OK)
@@ -32,7 +32,7 @@ PUBLIC u32_t pci_inw(u16_t port) {
}
PUBLIC u32_t pci_inl(u16_t port) {
u32_t pci_inl(u16_t port) {
u32_t value;
int s;
if ((s=sys_inl(port, &value)) !=OK)
@@ -41,21 +41,21 @@ PUBLIC u32_t pci_inl(u16_t port) {
}
PUBLIC void pci_outb(u16_t port, u8_t value) {
void pci_outb(u16_t port, u8_t value) {
int s;
if ((s=sys_outb(port, value)) !=OK)
printf("%s: warning, sys_outb failed: %d\n", DRIVER_NAME, s);
}
PUBLIC void pci_outw(u16_t port, u16_t value) {
void pci_outw(u16_t port, u16_t value) {
int s;
if ((s=sys_outw(port, value)) !=OK)
printf("%s: warning, sys_outw failed: %d\n", DRIVER_NAME, s);
}
PUBLIC void pci_outl(u16_t port, u32_t value) {
void pci_outl(u16_t port, u32_t value) {
int s;
if ((s=sys_outl(port, value)) !=OK)
printf("%s: warning, sys_outl failed: %d\n", DRIVER_NAME, s);

View File

@@ -34,9 +34,9 @@
FORWARD int src_reg_read(const DEV_STRUCT * DSP, u16_t reg, u16_t
static int src_reg_read(const DEV_STRUCT * DSP, u16_t reg, u16_t
*data);
FORWARD int src_reg_write(const DEV_STRUCT * DSP, u16_t reg, u16_t val);
static int src_reg_write(const DEV_STRUCT * DSP, u16_t reg, u16_t val);
int src_init ( DEV_STRUCT * DSP ) {
@@ -103,7 +103,7 @@ int src_init ( DEV_STRUCT * DSP ) {
}
PRIVATE int src_reg_read(const DEV_STRUCT * DSP, u16_t reg, u16_t *data) {
static int src_reg_read(const DEV_STRUCT * DSP, u16_t reg, u16_t *data) {
u32_t dtemp;
/* wait for ready */
@@ -129,7 +129,7 @@ PRIVATE int src_reg_read(const DEV_STRUCT * DSP, u16_t reg, u16_t *data) {
}
PRIVATE int src_reg_write(const DEV_STRUCT * DSP, u16_t reg, u16_t val) {
static int src_reg_write(const DEV_STRUCT * DSP, u16_t reg, u16_t val) {
u32_t dtemp;
/* wait for ready */

View File

@@ -3,10 +3,10 @@
FORWARD int get_set_volume(struct volume_level *level, int flag);
FORWARD int get_set_input(struct inout_ctrl *input, int flag, int
static int get_set_volume(struct volume_level *level, int flag);
static int get_set_input(struct inout_ctrl *input, int flag, int
channel);
FORWARD int get_set_output(struct inout_ctrl *output, int flag);
static int get_set_output(struct inout_ctrl *output, int flag);
@@ -14,7 +14,7 @@ FORWARD int get_set_output(struct inout_ctrl *output, int flag);
/*=========================================================================*
* mixer_ioctl
*=========================================================================*/
PUBLIC int mixer_ioctl(int request, void *val, int *UNUSED(len)) {
int mixer_ioctl(int request, void *val, int *UNUSED(len)) {
int status;
switch(request) {
@@ -36,7 +36,7 @@ PUBLIC int mixer_ioctl(int request, void *val, int *UNUSED(len)) {
/*=========================================================================*
* mixer_init
*=========================================================================*/
PUBLIC int mixer_init() {
int mixer_init() {
/* Try to detect the mixer by writing to MIXER_DAC_LEVEL if the
* value written can be read back the mixer is there
*/
@@ -60,7 +60,7 @@ PUBLIC int mixer_init() {
/*=========================================================================*
* get_set_volume *
*=========================================================================*/
PRIVATE int get_set_volume(struct volume_level *level, int flag) {
static int get_set_volume(struct volume_level *level, int flag) {
int cmd_left, cmd_right, shift, max_level;
shift = 3;
@@ -133,7 +133,7 @@ PRIVATE int get_set_volume(struct volume_level *level, int flag) {
/*=========================================================================*
* get_set_input *
*=========================================================================*/
PRIVATE int get_set_input(struct inout_ctrl *input, int flag, int channel) {
static int get_set_input(struct inout_ctrl *input, int flag, int channel) {
int input_cmd, input_mask, mask, del_mask, shift;
input_cmd = (channel == 0 ? MIXER_IN_LEFT : MIXER_IN_RIGHT);
@@ -187,7 +187,7 @@ PRIVATE int get_set_input(struct inout_ctrl *input, int flag, int channel) {
/*=========================================================================*
* get_set_output *
*=========================================================================*/
PRIVATE int get_set_output(struct inout_ctrl *output, int flag) {
static int get_set_output(struct inout_ctrl *output, int flag) {
int output_mask, mask, del_mask, shift;
mask = mixer_get(MIXER_OUTPUT_CTRL);
@@ -233,7 +233,7 @@ PRIVATE int get_set_output(struct inout_ctrl *output, int flag) {
PUBLIC int mixer_set(int reg, int data) {
int mixer_set(int reg, int data) {
int i;
sb16_outb(MIXER_REG, reg);
@@ -245,7 +245,7 @@ PUBLIC int mixer_set(int reg, int data) {
PUBLIC int mixer_get(int reg) {
int mixer_get(int reg) {
int i;
sb16_outb(MIXER_REG, reg);

View File

@@ -11,34 +11,34 @@
#include "mixer.h"
FORWARD void dsp_dma_setup(phys_bytes address, int count, int sub_dev);
static void dsp_dma_setup(phys_bytes address, int count, int sub_dev);
FORWARD int dsp_ioctl(int request, void *val, int *len);
FORWARD int dsp_set_size(unsigned int size);
FORWARD int dsp_set_speed(unsigned int speed);
FORWARD int dsp_set_stereo(unsigned int stereo);
FORWARD int dsp_set_bits(unsigned int bits);
FORWARD int dsp_set_sign(unsigned int sign);
FORWARD int dsp_get_max_frag_size(u32_t *val, int *len);
static int dsp_ioctl(int request, void *val, int *len);
static int dsp_set_size(unsigned int size);
static int dsp_set_speed(unsigned int speed);
static int dsp_set_stereo(unsigned int stereo);
static int dsp_set_bits(unsigned int bits);
static int dsp_set_sign(unsigned int sign);
static int dsp_get_max_frag_size(u32_t *val, int *len);
PRIVATE unsigned int DspStereo = DEFAULT_STEREO;
PRIVATE unsigned int DspSpeed = DEFAULT_SPEED;
PRIVATE unsigned int DspBits = DEFAULT_BITS;
PRIVATE unsigned int DspSign = DEFAULT_SIGN;
PRIVATE unsigned int DspFragmentSize;
static unsigned int DspStereo = DEFAULT_STEREO;
static unsigned int DspSpeed = DEFAULT_SPEED;
static unsigned int DspBits = DEFAULT_BITS;
static unsigned int DspSign = DEFAULT_SIGN;
static unsigned int DspFragmentSize;
PRIVATE phys_bytes DmaPhys;
PRIVATE int running = FALSE;
static phys_bytes DmaPhys;
static int running = FALSE;
PUBLIC sub_dev_t sub_dev[2];
PUBLIC special_file_t special_file[3];
PUBLIC drv_t drv;
sub_dev_t sub_dev[2];
special_file_t special_file[3];
drv_t drv;
PUBLIC int drv_init(void) {
int drv_init(void) {
drv.DriverName = "SB16";
drv.NrOfSubDevices = 2;
drv.NrOfSpecialFiles = 3;
@@ -72,7 +72,7 @@ PUBLIC int drv_init(void) {
}
PUBLIC int drv_init_hw(void) {
int drv_init_hw(void) {
int i;
int DspVersion[2];
Dprint(("drv_init_hw():\n"));
@@ -114,7 +114,7 @@ PUBLIC int drv_init_hw(void) {
PUBLIC int drv_reset(void) {
int drv_reset(void) {
int i;
Dprint(("drv_reset():\n"));
@@ -131,7 +131,7 @@ PUBLIC int drv_reset(void) {
PUBLIC int drv_start(int channel, int DmaMode) {
int drv_start(int channel, int DmaMode) {
Dprint(("drv_start():\n"));
drv_reset();
@@ -178,7 +178,7 @@ PUBLIC int drv_start(int channel, int DmaMode) {
PUBLIC int drv_stop(int sub_dev) {
int drv_stop(int sub_dev) {
if(running) {
Dprint(("drv_stop():\n"));
dsp_command((DspBits == 8 ? DSP_CMD_DMA8HALT : DSP_CMD_DMA16HALT));
@@ -190,7 +190,7 @@ PUBLIC int drv_stop(int sub_dev) {
PUBLIC int drv_set_dma(u32_t dma, u32_t UNUSED(length), int UNUSED(chan)) {
int drv_set_dma(u32_t dma, u32_t UNUSED(length), int UNUSED(chan)) {
Dprint(("drv_set_dma():\n"));
DmaPhys = dma;
return OK;
@@ -198,7 +198,7 @@ PUBLIC int drv_set_dma(u32_t dma, u32_t UNUSED(length), int UNUSED(chan)) {
PUBLIC int drv_reenable_int(int UNUSED(chan)) {
int drv_reenable_int(int UNUSED(chan)) {
Dprint(("drv_reenable_int()\n"));
sb16_inb((DspBits == 8 ? DSP_DATA_AVL : DSP_DATA16_AVL));
return OK;
@@ -206,33 +206,33 @@ PUBLIC int drv_reenable_int(int UNUSED(chan)) {
PUBLIC int drv_int_sum(void) {
int drv_int_sum(void) {
return mixer_get(MIXER_IRQ_STATUS) & 0x0F;
}
PUBLIC int drv_int(int sub_dev) {
int drv_int(int sub_dev) {
return sub_dev == AUDIO && mixer_get(MIXER_IRQ_STATUS) & 0x03;
}
PUBLIC int drv_pause(int chan) {
int drv_pause(int chan) {
drv_stop(chan);
return OK;
}
PUBLIC int drv_resume(int UNUSED(chan)) {
int drv_resume(int UNUSED(chan)) {
dsp_command((DspBits == 8 ? DSP_CMD_DMA8CONT : DSP_CMD_DMA16CONT));
return OK;
}
PUBLIC int drv_io_ctl(int request, void *val, int *len, int sub_dev) {
int drv_io_ctl(int request, void *val, int *len, int sub_dev) {
Dprint(("dsp_ioctl: got ioctl %d, argument: %d sub_dev: %d\n", request, val, sub_dev));
if(sub_dev == AUDIO) {
@@ -246,7 +246,7 @@ PUBLIC int drv_io_ctl(int request, void *val, int *len, int sub_dev) {
PUBLIC int drv_get_irq(char *irq) {
int drv_get_irq(char *irq) {
Dprint(("drv_get_irq():\n"));
*irq = SB_IRQ;
return OK;
@@ -254,7 +254,7 @@ PUBLIC int drv_get_irq(char *irq) {
PUBLIC int drv_get_frag_size(u32_t *frag_size, int UNUSED(sub_dev)) {
int drv_get_frag_size(u32_t *frag_size, int UNUSED(sub_dev)) {
Dprint(("drv_get_frag_size():\n"));
*frag_size = DspFragmentSize;
return OK;
@@ -262,7 +262,7 @@ PUBLIC int drv_get_frag_size(u32_t *frag_size, int UNUSED(sub_dev)) {
PRIVATE int dsp_ioctl(int request, void *val, int *len) {
static int dsp_ioctl(int request, void *val, int *len) {
int status;
switch(request) {
@@ -281,7 +281,7 @@ PRIVATE int dsp_ioctl(int request, void *val, int *len) {
PRIVATE void dsp_dma_setup(phys_bytes address, int count, int DmaMode) {
static void dsp_dma_setup(phys_bytes address, int count, int DmaMode) {
pvb_pair_t pvb[9];
Dprint(("Setting up %d bit DMA\n", DspBits));
@@ -326,7 +326,7 @@ PRIVATE void dsp_dma_setup(phys_bytes address, int count, int DmaMode) {
PRIVATE int dsp_set_size(unsigned int size) {
static int dsp_set_size(unsigned int size) {
Dprint(("dsp_set_size(): set fragment size to %u\n", size));
/* Sanity checks */
@@ -341,7 +341,7 @@ PRIVATE int dsp_set_size(unsigned int size) {
PRIVATE int dsp_set_speed(unsigned int speed) {
static int dsp_set_speed(unsigned int speed) {
Dprint(("sb16: setting speed to %u, stereo = %d\n", speed, DspStereo));
if(speed < DSP_MIN_SPEED || speed > DSP_MAX_SPEED) {
@@ -369,7 +369,7 @@ PRIVATE int dsp_set_speed(unsigned int speed) {
PRIVATE int dsp_set_stereo(unsigned int stereo) {
static int dsp_set_stereo(unsigned int stereo) {
if(stereo) {
DspStereo = 1;
} else {
@@ -381,7 +381,7 @@ PRIVATE int dsp_set_stereo(unsigned int stereo) {
PRIVATE int dsp_set_bits(unsigned int bits) {
static int dsp_set_bits(unsigned int bits) {
/* Sanity checks */
if(bits != 8 && bits != 16) {
return EINVAL;
@@ -394,7 +394,7 @@ PRIVATE int dsp_set_bits(unsigned int bits) {
PRIVATE int dsp_set_sign(unsigned int sign) {
static int dsp_set_sign(unsigned int sign) {
Dprint(("sb16: set sign to %u\n", sign));
DspSign = (sign > 0 ? 1 : 0);
@@ -404,7 +404,7 @@ PRIVATE int dsp_set_sign(unsigned int sign) {
PRIVATE int dsp_get_max_frag_size(u32_t *val, int *len) {
static int dsp_get_max_frag_size(u32_t *val, int *len) {
*len = sizeof(*val);
*val = sub_dev[AUDIO].DmaSize / sub_dev[AUDIO].NrOfDmaFragments;
return OK;
@@ -412,7 +412,7 @@ PRIVATE int dsp_get_max_frag_size(u32_t *val, int *len) {
PUBLIC int dsp_command(int value) {
int dsp_command(int value) {
int i;
for (i = 0; i < SB_TIMEOUT; i++) {
@@ -428,7 +428,7 @@ PUBLIC int dsp_command(int value) {
PUBLIC int sb16_inb(int port) {
int sb16_inb(int port) {
int s;
u32_t value;
@@ -440,7 +440,7 @@ PUBLIC int sb16_inb(int port) {
PUBLIC void sb16_outb(int port, int value) {
void sb16_outb(int port, int value) {
int s;
if ((s=sys_outb(port, value)) != OK)

View File

@@ -36,7 +36,7 @@
#define NR_SUBDEVS (MAX_DRIVES * SUB_PER_DRIVE)
/* Variables. */
PRIVATE struct wini { /* main drive struct, one entry per drive */
static struct wini { /* main drive struct, one entry per drive */
unsigned cylinders; /* number of cylinders */
unsigned heads; /* number of heads */
unsigned sectors; /* number of sectors per track */
@@ -48,27 +48,27 @@ PRIVATE struct wini { /* main drive struct, one entry per drive */
struct device subpart[SUB_PER_DRIVE]; /* subpartitions */
} wini[MAX_DRIVES], *w_wn;
PRIVATE int w_drive; /* selected drive */
PRIVATE struct device *w_dv; /* device's base and size */
PRIVATE char *bios_buf_v;
PRIVATE phys_bytes bios_buf_phys;
PRIVATE int remap_first = 0; /* Remap drives for CD HD emulation */
static int w_drive; /* selected drive */
static struct device *w_dv; /* device's base and size */
static char *bios_buf_v;
static phys_bytes bios_buf_phys;
static int remap_first = 0; /* Remap drives for CD HD emulation */
#define BIOSBUF 16384
int main(void);
FORWARD struct device *w_prepare(dev_t device);
FORWARD struct device *w_part(dev_t minor);
FORWARD ssize_t w_transfer(dev_t minor, int do_write, u64_t position,
static struct device *w_prepare(dev_t device);
static struct device *w_part(dev_t minor);
static ssize_t w_transfer(dev_t minor, int do_write, u64_t position,
endpoint_t endpt, iovec_t *iov, unsigned int nr_req, int flags);
FORWARD int w_do_open(dev_t minor, int access);
FORWARD int w_do_close(dev_t minor);
FORWARD void w_init(void);
FORWARD void w_geometry(dev_t minor, struct partition *entry);
FORWARD int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
static int w_do_open(dev_t minor, int access);
static int w_do_close(dev_t minor);
static void w_init(void);
static void w_geometry(dev_t minor, struct partition *entry);
static int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
cp_grant_id_t grant);
/* Entry points to this driver. */
PRIVATE struct blockdriver w_dtab = {
static struct blockdriver w_dtab = {
BLOCKDRIVER_TYPE_DISK, /* handle partition requests */
w_do_open, /* open or mount request, initialize device */
w_do_close, /* release device */
@@ -84,13 +84,13 @@ PRIVATE struct blockdriver w_dtab = {
};
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
/*===========================================================================*
* bios_winchester_task *
*===========================================================================*/
PUBLIC int main(void)
int main(void)
{
/* SEF local startup. */
sef_local_startup();
@@ -104,7 +104,7 @@ PUBLIC int main(void)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup(void)
static void sef_local_startup(void)
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -121,7 +121,7 @@ PRIVATE void sef_local_startup(void)
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the bios_wini driver. */
long v;
@@ -139,7 +139,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
/*===========================================================================*
* w_prepare *
*===========================================================================*/
PRIVATE struct device *w_prepare(dev_t device)
static struct device *w_prepare(dev_t device)
{
/* Prepare for I/O on a device. */
@@ -163,7 +163,7 @@ PRIVATE struct device *w_prepare(dev_t device)
/*===========================================================================*
* w_part *
*===========================================================================*/
PRIVATE struct device *w_part(dev_t minor)
static struct device *w_part(dev_t minor)
{
/* Return a pointer to the partition information of the given minor device. */
@@ -173,7 +173,7 @@ PRIVATE struct device *w_part(dev_t minor)
/*===========================================================================*
* w_transfer *
*===========================================================================*/
PRIVATE ssize_t w_transfer(
static ssize_t w_transfer(
dev_t minor, /* minor device number */
int do_write, /* read or write? */
u64_t pos64, /* offset on device to read or write */
@@ -356,7 +356,7 @@ PRIVATE ssize_t w_transfer(
/*============================================================================*
* w_do_open *
*============================================================================*/
PRIVATE int w_do_open(dev_t minor, int UNUSED(access))
static int w_do_open(dev_t minor, int UNUSED(access))
{
/* Device open: Initialize the controller and read the partition table. */
@@ -376,7 +376,7 @@ PRIVATE int w_do_open(dev_t minor, int UNUSED(access))
/*============================================================================*
* w_do_close *
*============================================================================*/
PRIVATE int w_do_close(dev_t minor)
static int w_do_close(dev_t minor)
{
/* Device close: Release a device. */
@@ -388,7 +388,7 @@ PRIVATE int w_do_close(dev_t minor)
/*===========================================================================*
* w_init *
*===========================================================================*/
PRIVATE void w_init(void)
static void w_init(void)
{
/* This routine is called at startup to initialize the drive parameters. */
@@ -498,7 +498,7 @@ PRIVATE void w_init(void)
/*============================================================================*
* w_geometry *
*============================================================================*/
PRIVATE void w_geometry(dev_t minor, struct partition *entry)
static void w_geometry(dev_t minor, struct partition *entry)
{
if (w_prepare(minor) == NULL) return;
@@ -510,7 +510,7 @@ PRIVATE void w_geometry(dev_t minor, struct partition *entry)
/*============================================================================*
* w_ioctl *
*============================================================================*/
PRIVATE int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
static int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
cp_grant_id_t grant)
{
int count;

View File

@@ -26,28 +26,28 @@
#include "dec21140A.h"
PRIVATE u32_t io_inl(u16_t);
PRIVATE void io_outl(u16_t, u32_t);
PRIVATE void do_conf(const message *);
PRIVATE void do_get_stat_s(message *);
PRIVATE void do_interrupt(const dpeth_t *);
PRIVATE void do_reply(dpeth_t *);
PRIVATE void do_vread_s(const message *, int);
PRIVATE void do_watchdog(void *);
static u32_t io_inl(u16_t);
static void io_outl(u16_t, u32_t);
static void do_conf(const message *);
static void do_get_stat_s(message *);
static void do_interrupt(const dpeth_t *);
static void do_reply(dpeth_t *);
static void do_vread_s(const message *, int);
static void do_watchdog(void *);
PRIVATE void de_update_conf(dpeth_t *);
PRIVATE int de_probe(dpeth_t *, int skip);
PRIVATE void de_conf_addr(dpeth_t *);
PRIVATE void de_first_init(dpeth_t *);
PRIVATE void de_reset(const dpeth_t *);
PRIVATE void de_hw_conf(const dpeth_t *);
PRIVATE void de_start(const dpeth_t *);
PRIVATE void de_setup_frame(const dpeth_t *);
PRIVATE u16_t de_read_rom(const dpeth_t *, u8_t, u8_t);
PRIVATE int de_calc_iov_size(iovec_dat_s_t *);
PRIVATE void de_next_iov(iovec_dat_s_t *);
PRIVATE void do_vwrite_s(const message *, int);
PRIVATE void de_get_userdata_s(int, cp_grant_id_t, vir_bytes, int, void
static void de_update_conf(dpeth_t *);
static int de_probe(dpeth_t *, int skip);
static void de_conf_addr(dpeth_t *);
static void de_first_init(dpeth_t *);
static void de_reset(const dpeth_t *);
static void de_hw_conf(const dpeth_t *);
static void de_start(const dpeth_t *);
static void de_setup_frame(const dpeth_t *);
static u16_t de_read_rom(const dpeth_t *, u8_t, u8_t);
static int de_calc_iov_size(iovec_dat_s_t *);
static void de_next_iov(iovec_dat_s_t *);
static void do_vwrite_s(const message *, int);
static void de_get_userdata_s(int, cp_grant_id_t, vir_bytes, int, void
*);
/* Error messages */
@@ -60,12 +60,12 @@ static char str_StatErrMsg[] = "Unable to send stats";
static char str_AlignErrMsg[] = "Bad align of buffer/descriptor";
static char str_DevName[] = "dec21140A:eth#?";
PRIVATE dpeth_t de_state;
PRIVATE int de_instance;
static dpeth_t de_state;
static int de_instance;
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
/*===========================================================================*
* main *
@@ -126,7 +126,7 @@ int main(int argc, char *argv[])
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -147,7 +147,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the DEC 21140A driver. */
int fkeys, sfkeys;
@@ -169,7 +169,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
return OK;
}
PRIVATE void do_get_stat_s(message * mp)
static void do_get_stat_s(message * mp)
{
int rc;
dpeth_t *dep;
@@ -188,7 +188,7 @@ PRIVATE void do_get_stat_s(message * mp)
return;
}
PRIVATE void do_conf(const message * mp)
static void do_conf(const message * mp)
{
int r;
dpeth_t *dep;
@@ -257,7 +257,7 @@ PRIVATE void do_conf(const message * mp)
return;
}
PRIVATE void do_reply(dpeth_t * dep)
static void do_reply(dpeth_t * dep)
{
message reply;
int r, flags = DL_NOFLAGS;
@@ -279,13 +279,13 @@ PRIVATE void do_reply(dpeth_t * dep)
return;
}
PRIVATE void do_watchdog(void *UNUSED(message))
static void do_watchdog(void *UNUSED(message))
{
/* nothing here yet */
return;
}
PRIVATE int de_probe(dpeth_t *dep, int skip)
static int de_probe(dpeth_t *dep, int skip)
{
int i, r, devind;
u16_t vid, did, temp16;
@@ -345,7 +345,7 @@ PRIVATE int de_probe(dpeth_t *dep, int skip)
return TRUE;
}
PRIVATE u16_t de_read_rom(const dpeth_t *dep, u8_t addr, u8_t nbAddrBits){
static u16_t de_read_rom(const dpeth_t *dep, u8_t addr, u8_t nbAddrBits){
u16_t retVal = 0;
int i;
u32_t csr = 0;
@@ -421,7 +421,7 @@ static void de_update_conf(dpeth_t * dep)
return;
}
PRIVATE void do_vread_s(const message * mp, int from_int)
static void do_vread_s(const message * mp, int from_int)
{
u8_t *buffer;
u32_t size;
@@ -552,7 +552,7 @@ PRIVATE void do_vread_s(const message * mp, int from_int)
return;
}
PRIVATE void de_conf_addr(dpeth_t * dep)
static void de_conf_addr(dpeth_t * dep)
{
static char ea_fmt[] = "x:x:x:x:x:x";
char ea_key[16];
@@ -574,7 +574,7 @@ PRIVATE void de_conf_addr(dpeth_t * dep)
return;
}
PRIVATE void de_first_init(dpeth_t *dep)
static void de_first_init(dpeth_t *dep)
{
int i,j,r;
vir_bytes descr_vir = (vir_bytes)dep->sendrecv_descr_buf;
@@ -666,7 +666,7 @@ PRIVATE void de_first_init(dpeth_t *dep)
sys_irqenable(&dep->de_hook);
}
PRIVATE void do_interrupt(const dpeth_t *dep){
static void do_interrupt(const dpeth_t *dep){
u32_t val;
val = io_inl(CSR_ADDR(dep, CSR5));
@@ -687,11 +687,11 @@ PRIVATE void do_interrupt(const dpeth_t *dep){
return;
}
PRIVATE void de_reset(const dpeth_t *dep){
static void de_reset(const dpeth_t *dep){
io_outl(CSR_ADDR(dep, CSR0), CSR0_SWR);
}
PRIVATE void de_hw_conf(const dpeth_t *dep){
static void de_hw_conf(const dpeth_t *dep){
u32_t val;
/* CSR0 - global host bus prop */
@@ -716,13 +716,13 @@ PRIVATE void de_hw_conf(const dpeth_t *dep){
io_outl(CSR_ADDR(dep, CSR6), val);
}
PRIVATE void de_start(const dpeth_t *dep){
static void de_start(const dpeth_t *dep){
u32_t val;
val = io_inl(CSR_ADDR(dep, CSR6)) | CSR6_ST | CSR6_SR;
io_outl(CSR_ADDR(dep, CSR6), val);
}
PRIVATE void de_setup_frame(const dpeth_t *dep){
static void de_setup_frame(const dpeth_t *dep){
int i;
u32_t val;
@@ -756,7 +756,7 @@ PRIVATE void de_setup_frame(const dpeth_t *dep){
return;
}
PRIVATE int de_calc_iov_size(iovec_dat_s_t * iovp){
static int de_calc_iov_size(iovec_dat_s_t * iovp){
int size, ix;
size = ix = 0;
@@ -770,7 +770,7 @@ PRIVATE int de_calc_iov_size(iovec_dat_s_t * iovp){
return size;
}
PRIVATE void de_get_userdata_s(int user_proc, cp_grant_id_t grant,
static void de_get_userdata_s(int user_proc, cp_grant_id_t grant,
vir_bytes offset, int count, void *loc_addr){
int rc;
vir_bytes len;
@@ -782,7 +782,7 @@ PRIVATE void de_get_userdata_s(int user_proc, cp_grant_id_t grant,
return;
}
PRIVATE void de_next_iov(iovec_dat_s_t * iovp){
static void de_next_iov(iovec_dat_s_t * iovp){
iovp->iod_iovec_s -= IOVEC_NR;
iovp->iod_iovec_offset += IOVEC_NR * sizeof(iovec_t);
@@ -791,7 +791,7 @@ PRIVATE void de_next_iov(iovec_dat_s_t * iovp){
return;
}
PRIVATE void do_vwrite_s(const message * mp, int from_int){
static void do_vwrite_s(const message * mp, int from_int){
static u8_t setupDone = 0;
int size, r, bytes, ix, totalsize;
dpeth_t *dep;
@@ -881,19 +881,19 @@ PRIVATE void do_vwrite_s(const message * mp, int from_int){
do_reply(dep);
}
PRIVATE void warning(const char *type, int err){
static void warning(const char *type, int err){
printf("Warning: %s sys_%s failed (%d)\n", str_DevName, type, err);
return;
}
PRIVATE u32_t io_inl(u16_t port){
static u32_t io_inl(u16_t port){
u32_t value;
int rc;
if ((rc = sys_inl(port, &value)) != OK) warning("inl", rc);
return value;
}
PRIVATE void io_outl(u16_t port, u32_t value){
static void io_outl(u16_t port, u32_t value){
int rc;
if ((rc = sys_outl(port, value)) != OK) warning("outl", rc);
return;

View File

@@ -44,7 +44,7 @@ typedef struct dp_conf
} dp_conf_t;
#define DP_CONF_NR 4
PRIVATE dp_conf_t dp_conf[DP_CONF_NR]= /* Card addresses */
static dp_conf_t dp_conf[DP_CONF_NR]= /* Card addresses */
{
/* I/O port, IRQ, Buffer address. */
{ 0x280, 3, 0xD0000, },
@@ -124,11 +124,11 @@ static void do_vir_insw(port_t port, int proc, vir_bytes buf, size_t
size);
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
FORWARD void sef_cb_signal_handler(int signo);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_cb_signal_handler(int signo);
PRIVATE void handle_hw_intr(void)
static void handle_hw_intr(void)
{
int r, irq;
dpeth_t *dep;
@@ -202,7 +202,7 @@ int main(int argc, char *argv[])
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -223,7 +223,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the dp8390 driver. */
dpeth_t *dep;
@@ -253,7 +253,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
/* Only check for termination signal, ignore anything else. */
if (signo != SIGTERM) return;

View File

@@ -29,10 +29,10 @@ extern u32_t system_hz;
typedef int(*testf_t) (dpeth_t *dep, int pos, u8_t *pat);
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 };
static u8_t pat0[]= { 0x00, 0x00, 0x00, 0x00 };
static u8_t pat1[]= { 0xFF, 0xFF, 0xFF, 0xFF };
static u8_t pat2[]= { 0xA5, 0x5A, 0x69, 0x96 };
static u8_t pat3[]= { 0x96, 0x69, 0x5A, 0xA5 };
static int test_8(dpeth_t *dep, int pos, u8_t *pat);
static int test_16(dpeth_t *dep, int pos, u8_t *pat);

View File

@@ -30,7 +30,7 @@ static void set_ee_word(dpeth_t *dep, int a, u16_t w);
static void ee_wds(dpeth_t *dep);
#endif
PUBLIC int rtl_probe(dep, skip)
int rtl_probe(dep, skip)
struct dpeth *dep;
int skip;
{

View File

@@ -384,7 +384,7 @@ static void el1_init(dpeth_t * dep)
** Name: int el1_probe(dpeth_t *dep)
** Function: Checks for presence of the board.
*/
PUBLIC int el1_probe(dpeth_t * dep)
int el1_probe(dpeth_t * dep)
{
int ix;

View File

@@ -555,7 +555,7 @@ static void el3_write_id(port_t port)
** Name: int el3_probe(dpeth_t *dep)
** Function: Checks for presence of the board.
*/
PUBLIC int el3_probe(dpeth_t * dep)
int el3_probe(dpeth_t * dep)
{
port_t id_port;

View File

@@ -25,7 +25,7 @@ static void warning(const char *type, int err)
** Name: unsigned int inb(unsigned short int port);
** Function: Reads a byte from specified i/o port.
*/
PUBLIC unsigned int inb(unsigned short port)
unsigned int inb(unsigned short port)
{
u32_t value;
int rc;
@@ -38,7 +38,7 @@ PUBLIC unsigned int inb(unsigned short port)
** Name: unsigned int inw(unsigned short int port);
** Function: Reads a word from specified i/o port.
*/
PUBLIC unsigned int inw(unsigned short port)
unsigned int inw(unsigned short port)
{
u32_t value;
int rc;
@@ -51,7 +51,7 @@ PUBLIC unsigned int inw(unsigned short port)
** Name: unsigned int insb(unsigned short int port, int proc_nr, void *buffer, int count);
** Function: Reads a sequence of bytes from specified i/o port to user space buffer.
*/
PUBLIC void insb(unsigned short int port, endpoint_t proc_nr,
void insb(unsigned short int port, endpoint_t proc_nr,
void *buffer, int count)
{
int rc;
@@ -66,7 +66,7 @@ PUBLIC void insb(unsigned short int port, endpoint_t proc_nr,
** Name: void outb(unsigned short int port, unsigned long value);
** Function: Writes a byte to specified i/o port.
*/
PUBLIC void outb(unsigned short port, unsigned long value)
void outb(unsigned short port, unsigned long value)
{
int rc;
@@ -78,7 +78,7 @@ PUBLIC void outb(unsigned short port, unsigned long value)
** Name: void outw(unsigned short int port, unsigned long value);
** Function: Writes a word to specified i/o port.
*/
PUBLIC void outw(unsigned short port, unsigned long value)
void outw(unsigned short port, unsigned long value)
{
int rc;
@@ -90,7 +90,7 @@ PUBLIC void outw(unsigned short port, unsigned long value)
** Name: void outsb(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 outsb(unsigned short port, endpoint_t proc_nr, void *buffer, int count)
void outsb(unsigned short port, endpoint_t proc_nr, void *buffer, int count)
{
int rc;

View File

@@ -312,7 +312,7 @@ static void do_init(const message * mp)
** Name: void dp_next_iovec(iovec_dat_t *iovp)
** Function: Retrieves data from next iovec element.
*/
PUBLIC void dp_next_iovec(iovec_dat_s_t * iovp)
void dp_next_iovec(iovec_dat_s_t * iovp)
{
iovp->iod_iovec_s -= IOVEC_NR;
@@ -470,7 +470,7 @@ static void do_watchdog(const void *UNUSED(message))
return;
}
PRIVATE void handle_hw_intr(void)
static void handle_hw_intr(void)
{
dpeth_t *dep;
@@ -488,15 +488,15 @@ PRIVATE void handle_hw_intr(void)
}
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
FORWARD void sef_cb_signal_handler(int signo);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_cb_signal_handler(int signo);
/*
** Name: int dpeth_task(void)
** Function: Main entry for dp task
*/
PUBLIC int main(int argc, char **argv)
int main(int argc, char **argv)
{
message m;
int ipc_status;
@@ -560,7 +560,7 @@ PUBLIC int main(int argc, char **argv)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -581,7 +581,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the dpeth driver. */
int fkeys, sfkeys;
@@ -605,7 +605,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
/* Only check for termination signal, ignore anything else. */
if (signo != SIGTERM) return;

View File

@@ -101,7 +101,7 @@ static void ne_init(dpeth_t * dep)
** Note that the NE1000 is an 8bit card and has a memory
** region distict from the 16bit NE2000.
*/
PUBLIC int ne_probe(dpeth_t * dep)
int ne_probe(dpeth_t * dep)
{
int ix, wd, loc1, loc2;
char EPROM[32];

View File

@@ -21,7 +21,7 @@ static char tx_rx_buff[8192];
** Name: void *alloc_buff(dpeth_t *dep, int size)
** Function: Allocates a buffer from the common pool.
*/
PUBLIC void *alloc_buff(dpeth_t *dep, int size)
void *alloc_buff(dpeth_t *dep, int size)
{
m_hdr_t *ptr, *wrk = allocptr;
int units = ((size + sizeof(m_hdr_t) - 1) / sizeof(m_hdr_t)) + 1;
@@ -52,7 +52,7 @@ PUBLIC void *alloc_buff(dpeth_t *dep, int size)
** Name: void free_buff(dpeth_t *dep, void *blk)
** Function: Returns a buffer to the common pool.
*/
PUBLIC void free_buff(dpeth_t *dep, void *blk)
void free_buff(dpeth_t *dep, void *blk)
{
m_hdr_t *wrk, *ptr = (m_hdr_t *) blk - 1;
@@ -80,7 +80,7 @@ PUBLIC void free_buff(dpeth_t *dep, void *blk)
** Name: void init_buff(dpeth_t *dep, buff_t **tx_buff)
** Function: Initalizes driver data structures.
*/
PUBLIC void init_buff(dpeth_t *dep, buff_t **tx_buff)
void init_buff(dpeth_t *dep, buff_t **tx_buff)
{
/* Initializes buffer pool */
@@ -105,7 +105,7 @@ PUBLIC void init_buff(dpeth_t *dep, buff_t **tx_buff)
** Name: void mem2user(dpeth_t *dep, buff_t *rxbuff);
** Function: Copies a packet from local buffer to user area.
*/
PUBLIC void mem2user(dpeth_t *dep, buff_t *rxbuff)
void mem2user(dpeth_t *dep, buff_t *rxbuff)
{
int bytes, ix = 0;
iovec_dat_s_t *iovp = &dep->de_read_iovec;
@@ -137,7 +137,7 @@ PUBLIC void mem2user(dpeth_t *dep, buff_t *rxbuff)
** Name: void user2mem(dpeth_t *dep, buff_t *txbuff)
** Function: Copies a packet from user area to local buffer.
*/
PUBLIC void user2mem(dpeth_t *dep, buff_t *txbuff)
void user2mem(dpeth_t *dep, buff_t *txbuff)
{
int bytes, ix = 0;
iovec_dat_s_t *iovp = &dep->de_write_iovec;

View File

@@ -21,37 +21,37 @@
#include "e1000_reg.h"
#include "e1000_pci.h"
PRIVATE int e1000_instance;
PRIVATE e1000_t e1000_state;
static int e1000_instance;
static e1000_t e1000_state;
PRIVATE void e1000_init(message *mp);
PRIVATE void e1000_init_pci(void);
PRIVATE int e1000_probe(e1000_t *e, int skip);
PRIVATE int e1000_init_hw(e1000_t *e);
PRIVATE void e1000_init_addr(e1000_t *e);
PRIVATE void e1000_init_buf(e1000_t *e);
PRIVATE void e1000_reset_hw(e1000_t *e);
PRIVATE void e1000_writev_s(message *mp, int from_int);
PRIVATE void e1000_readv_s(message *mp, int from_int);
PRIVATE void e1000_getstat_s(message *mp);
PRIVATE void e1000_interrupt(message *mp);
PRIVATE int e1000_link_changed(e1000_t *e);
PRIVATE void e1000_stop(e1000_t *e);
PRIVATE uint32_t e1000_reg_read(e1000_t *e, uint32_t reg);
PRIVATE void e1000_reg_write(e1000_t *e, uint32_t reg, uint32_t value);
PRIVATE void e1000_reg_set(e1000_t *e, uint32_t reg, uint32_t value);
PRIVATE void e1000_reg_unset(e1000_t *e, uint32_t reg, uint32_t value);
PRIVATE u16_t eeprom_eerd(void *e, int reg);
PRIVATE u16_t eeprom_ich(void *e, int reg);
PRIVATE int eeprom_ich_init(e1000_t *e);
PRIVATE int eeprom_ich_cycle(const e1000_t *e, u32_t timeout);
PRIVATE void reply(e1000_t *e);
PRIVATE void mess_reply(message *req, message *reply);
static void e1000_init(message *mp);
static void e1000_init_pci(void);
static int e1000_probe(e1000_t *e, int skip);
static int e1000_init_hw(e1000_t *e);
static void e1000_init_addr(e1000_t *e);
static void e1000_init_buf(e1000_t *e);
static void e1000_reset_hw(e1000_t *e);
static void e1000_writev_s(message *mp, int from_int);
static void e1000_readv_s(message *mp, int from_int);
static void e1000_getstat_s(message *mp);
static void e1000_interrupt(message *mp);
static int e1000_link_changed(e1000_t *e);
static void e1000_stop(e1000_t *e);
static uint32_t e1000_reg_read(e1000_t *e, uint32_t reg);
static void e1000_reg_write(e1000_t *e, uint32_t reg, uint32_t value);
static void e1000_reg_set(e1000_t *e, uint32_t reg, uint32_t value);
static void e1000_reg_unset(e1000_t *e, uint32_t reg, uint32_t value);
static u16_t eeprom_eerd(void *e, int reg);
static u16_t eeprom_ich(void *e, int reg);
static int eeprom_ich_init(e1000_t *e);
static int eeprom_ich_cycle(const e1000_t *e, u32_t timeout);
static void reply(e1000_t *e);
static void mess_reply(message *req, message *reply);
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
FORWARD void sef_cb_signal_handler(int signo);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_cb_signal_handler(int signo);
/*===========================================================================*
* main *
@@ -104,7 +104,7 @@ int main(int argc, char *argv[])
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -125,7 +125,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize the e1000 driver. */
long v;
@@ -153,7 +153,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
e1000_t *e;
e = &e1000_state;
@@ -169,7 +169,7 @@ PRIVATE void sef_cb_signal_handler(int signo)
/*===========================================================================*
* e1000_init *
*===========================================================================*/
PRIVATE void e1000_init(message *mp)
static void e1000_init(message *mp)
{
static int first_time = 1;
message reply_mess;
@@ -203,7 +203,7 @@ PRIVATE void e1000_init(message *mp)
/*===========================================================================*
* e1000_int_pci *
*===========================================================================*/
PRIVATE void e1000_init_pci()
static void e1000_init_pci()
{
e1000_t *e;
@@ -220,7 +220,7 @@ PRIVATE void e1000_init_pci()
/*===========================================================================*
* e1000_probe *
*===========================================================================*/
PRIVATE int e1000_probe(e1000_t *e, int skip)
static int e1000_probe(e1000_t *e, int skip)
{
int r, devind, ioflag;
u16_t vid, did, cr;
@@ -359,7 +359,7 @@ PRIVATE int e1000_probe(e1000_t *e, int skip)
/*===========================================================================*
* e1000_init_hw *
*===========================================================================*/
PRIVATE int e1000_init_hw(e)
static int e1000_init_hw(e)
e1000_t *e;
{
int r, i;
@@ -424,7 +424,7 @@ e1000_t *e;
/*===========================================================================*
* e1000_init_addr *
*===========================================================================*/
PRIVATE void e1000_init_addr(e)
static void e1000_init_addr(e)
e1000_t *e;
{
static char eakey[]= E1000_ENVVAR "#_EA";
@@ -474,7 +474,7 @@ e1000_t *e;
/*===========================================================================*
* e1000_init_buf *
*===========================================================================*/
PRIVATE void e1000_init_buf(e)
static void e1000_init_buf(e)
e1000_t *e;
{
phys_bytes rx_desc_p, rx_buff_p;
@@ -570,7 +570,7 @@ e1000_t *e;
/*===========================================================================*
* e1000_reset_hw *
*===========================================================================*/
PRIVATE void e1000_reset_hw(e)
static void e1000_reset_hw(e)
e1000_t *e;
{
/* Assert a Device Reset signal. */
@@ -583,7 +583,7 @@ e1000_t *e;
/*===========================================================================*
* e1000_writev_s *
*===========================================================================*/
PRIVATE void e1000_writev_s(mp, from_int)
static void e1000_writev_s(mp, from_int)
message *mp;
int from_int;
{
@@ -676,7 +676,7 @@ int from_int;
/*===========================================================================*
* e1000_readv_s *
*===========================================================================*/
PRIVATE void e1000_readv_s(mp, from_int)
static void e1000_readv_s(mp, from_int)
message *mp;
int from_int;
{
@@ -765,7 +765,7 @@ int from_int;
/*===========================================================================*
* e1000_getstat_s *
*===========================================================================*/
PRIVATE void e1000_getstat_s(mp)
static void e1000_getstat_s(mp)
message *mp;
{
int r;
@@ -800,7 +800,7 @@ message *mp;
/*===========================================================================*
* e1000_interrupt *
*===========================================================================*/
PRIVATE void e1000_interrupt(mp)
static void e1000_interrupt(mp)
message *mp;
{
e1000_t *e;
@@ -837,7 +837,7 @@ message *mp;
/*===========================================================================*
* e1000_link_changed *
*===========================================================================*/
PRIVATE int e1000_link_changed(e)
static int e1000_link_changed(e)
e1000_t *e;
{
E1000_DEBUG(4, ("%s: link_changed()\n", e->name));
@@ -847,7 +847,7 @@ e1000_t *e;
/*===========================================================================*
* e1000_stop *
*===========================================================================*/
PRIVATE void e1000_stop(e)
static void e1000_stop(e)
e1000_t *e;
{
E1000_DEBUG(3, ("%s: stop()\n", e->name));
@@ -860,7 +860,7 @@ e1000_t *e;
/*===========================================================================*
* e1000_reg_read *
*===========================================================================*/
PRIVATE uint32_t e1000_reg_read(e, reg)
static uint32_t e1000_reg_read(e, reg)
e1000_t *e;
uint32_t reg;
{
@@ -879,7 +879,7 @@ uint32_t reg;
/*===========================================================================*
* e1000_reg_write *
*===========================================================================*/
PRIVATE void e1000_reg_write(e, reg, value)
static void e1000_reg_write(e, reg, value)
e1000_t *e;
uint32_t reg;
uint32_t value;
@@ -894,7 +894,7 @@ uint32_t value;
/*===========================================================================*
* e1000_reg_set *
*===========================================================================*/
PRIVATE void e1000_reg_set(e, reg, value)
static void e1000_reg_set(e, reg, value)
e1000_t *e;
uint32_t reg;
uint32_t value;
@@ -911,7 +911,7 @@ uint32_t value;
/*===========================================================================*
* e1000_reg_unset *
*===========================================================================*/
PRIVATE void e1000_reg_unset(e, reg, value)
static void e1000_reg_unset(e, reg, value)
e1000_t *e;
uint32_t reg;
uint32_t value;
@@ -929,7 +929,7 @@ uint32_t value;
/*===========================================================================*
* eeprom_eerd *
*===========================================================================*/
PRIVATE u16_t eeprom_eerd(v, reg)
static u16_t eeprom_eerd(v, reg)
void *v;
int reg;
{
@@ -949,7 +949,7 @@ int reg;
/*===========================================================================*
* eeprom_ich_init *
*===========================================================================*/
PRIVATE int eeprom_ich_init(e)
static int eeprom_ich_init(e)
e1000_t *e;
{
union ich8_hws_flash_status hsfsts;
@@ -1029,7 +1029,7 @@ out:
/*===========================================================================*
* eeprom_ich_cycle *
*===========================================================================*/
PRIVATE int eeprom_ich_cycle(const e1000_t *e, u32_t timeout)
static int eeprom_ich_cycle(const e1000_t *e, u32_t timeout)
{
union ich8_hws_flash_ctrl hsflctl;
union ich8_hws_flash_status hsfsts;
@@ -1062,7 +1062,7 @@ PRIVATE int eeprom_ich_cycle(const e1000_t *e, u32_t timeout)
/*===========================================================================*
* eeprom_ich *
*===========================================================================*/
PRIVATE u16_t eeprom_ich(v, reg)
static u16_t eeprom_ich(v, reg)
void *v;
int reg;
{
@@ -1144,7 +1144,7 @@ out:
/*===========================================================================*
* reply *
*===========================================================================*/
PRIVATE void reply(e)
static void reply(e)
e1000_t *e;
{
message msg;
@@ -1192,7 +1192,7 @@ e1000_t *e;
/*===========================================================================*
* mess_reply *
*===========================================================================*/
PRIVATE void mess_reply(req, reply_mess)
static void mess_reply(req, reply_mess)
message *req;
message *reply_mess;
{

View File

@@ -7,7 +7,7 @@
/*===========================================================================*
* get_rand *
*===========================================================================*/
PRIVATE u32_t get_rand(u32_t max)
static u32_t get_rand(u32_t max)
{
/* Las Vegas algorithm for getting a random number in the range from
* 0 to max, inclusive.
@@ -35,7 +35,7 @@ PRIVATE u32_t get_rand(u32_t max)
/*===========================================================================*
* get_range *
*===========================================================================*/
PRIVATE size_t get_range(struct fbd_rule *rule, u64_t pos, size_t *size,
static size_t get_range(struct fbd_rule *rule, u64_t pos, size_t *size,
u64_t *skip)
{
/* Compute the range within the given request range that is affected
@@ -82,7 +82,7 @@ PRIVATE size_t get_range(struct fbd_rule *rule, u64_t pos, size_t *size,
/*===========================================================================*
* limit_range *
*===========================================================================*/
PRIVATE void limit_range(iovec_t *iov, unsigned *count, size_t size)
static void limit_range(iovec_t *iov, unsigned *count, size_t size)
{
/* Limit the given vector to the given size.
*/
@@ -104,7 +104,7 @@ PRIVATE void limit_range(iovec_t *iov, unsigned *count, size_t size)
/*===========================================================================*
* action_io_corrupt *
*===========================================================================*/
PRIVATE void action_io_corrupt(struct fbd_rule *rule, char *buf, size_t size,
static void action_io_corrupt(struct fbd_rule *rule, char *buf, size_t size,
u64_t pos, int UNUSED(flag))
{
u64_t skip;
@@ -151,7 +151,7 @@ PRIVATE void action_io_corrupt(struct fbd_rule *rule, char *buf, size_t size,
/*===========================================================================*
* action_pre_error *
*===========================================================================*/
PRIVATE void action_pre_error(struct fbd_rule *rule, iovec_t *iov,
static void action_pre_error(struct fbd_rule *rule, iovec_t *iov,
unsigned *count, size_t *size, u64_t *pos)
{
/* Limit the request to the part that precedes the matched range. */
@@ -163,7 +163,7 @@ PRIVATE void action_pre_error(struct fbd_rule *rule, iovec_t *iov,
/*===========================================================================*
* action_post_error *
*===========================================================================*/
PRIVATE void action_post_error(struct fbd_rule *rule, size_t UNUSED(osize),
static void action_post_error(struct fbd_rule *rule, size_t UNUSED(osize),
int *result)
{
/* Upon success of the first part, return the specified error code. */
@@ -174,7 +174,7 @@ PRIVATE void action_post_error(struct fbd_rule *rule, size_t UNUSED(osize),
/*===========================================================================*
* action_pre_misdir *
*===========================================================================*/
PRIVATE void action_pre_misdir(struct fbd_rule *rule, iovec_t *UNUSED(iov),
static void action_pre_misdir(struct fbd_rule *rule, iovec_t *UNUSED(iov),
unsigned *UNUSED(count), size_t *UNUSED(size), u64_t *pos)
{
/* Randomize the request position to fall within the range (and have
@@ -201,7 +201,7 @@ PRIVATE void action_pre_misdir(struct fbd_rule *rule, iovec_t *UNUSED(iov),
/*===========================================================================*
* action_pre_losttorn *
*===========================================================================*/
PRIVATE void action_pre_losttorn(struct fbd_rule *rule, iovec_t *iov,
static void action_pre_losttorn(struct fbd_rule *rule, iovec_t *iov,
unsigned *count, size_t *size, u64_t *UNUSED(pos))
{
if (*size > rule->params.losttorn.lead)
@@ -213,7 +213,7 @@ PRIVATE void action_pre_losttorn(struct fbd_rule *rule, iovec_t *iov,
/*===========================================================================*
* action_post_losttorn *
*===========================================================================*/
PRIVATE void action_post_losttorn(struct fbd_rule *UNUSED(rule), size_t osize,
static void action_post_losttorn(struct fbd_rule *UNUSED(rule), size_t osize,
int *result)
{
/* On success, pretend full completion. */
@@ -226,7 +226,7 @@ PRIVATE void action_post_losttorn(struct fbd_rule *UNUSED(rule), size_t osize,
/*===========================================================================*
* action_mask *
*===========================================================================*/
PUBLIC int action_mask(struct fbd_rule *rule)
int action_mask(struct fbd_rule *rule)
{
/* Return the hook mask for the given rule's action type. */
@@ -244,7 +244,7 @@ PUBLIC int action_mask(struct fbd_rule *rule)
/*===========================================================================*
* action_pre_hook *
*===========================================================================*/
PUBLIC void action_pre_hook(struct fbd_rule *rule, iovec_t *iov,
void action_pre_hook(struct fbd_rule *rule, iovec_t *iov,
unsigned *count, size_t *size, u64_t *pos)
{
switch (rule->action) {
@@ -268,7 +268,7 @@ PUBLIC void action_pre_hook(struct fbd_rule *rule, iovec_t *iov,
/*===========================================================================*
* action_io_hook *
*===========================================================================*/
PUBLIC void action_io_hook(struct fbd_rule *rule, char *buf, size_t size,
void action_io_hook(struct fbd_rule *rule, char *buf, size_t size,
u64_t pos, int flag)
{
switch (rule->action) {
@@ -284,7 +284,7 @@ PUBLIC void action_io_hook(struct fbd_rule *rule, char *buf, size_t size,
/*===========================================================================*
* action_post_hook *
*===========================================================================*/
PUBLIC void action_post_hook(struct fbd_rule *rule, size_t osize, int *result)
void action_post_hook(struct fbd_rule *rule, size_t osize, int *result)
{
switch (rule->action) {
case FBD_ACTION_ERROR:

View File

@@ -15,22 +15,22 @@
#define BUF_SIZE (NR_IOREQS * CLICK_SIZE) /* 256k */
/* Function declarations. */
PRIVATE int fbd_open(dev_t minor, int access);
PRIVATE int fbd_close(dev_t minor);
PRIVATE int fbd_transfer(dev_t minor, int do_write, u64_t position,
static int fbd_open(dev_t minor, int access);
static int fbd_close(dev_t minor);
static int fbd_transfer(dev_t minor, int do_write, u64_t position,
endpoint_t endpt, iovec_t *iov, unsigned int nr_req, int flags);
PRIVATE int fbd_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
static int fbd_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
cp_grant_id_t grant);
/* Variables. */
PRIVATE char *fbd_buf; /* scratch buffer */
static char *fbd_buf; /* scratch buffer */
PRIVATE char driver_label[32] = ""; /* driver DS label */
PRIVATE dev_t driver_minor = -1; /* driver's partition minor to use */
PRIVATE endpoint_t driver_endpt; /* driver endpoint */
static char driver_label[32] = ""; /* driver DS label */
static dev_t driver_minor = -1; /* driver's partition minor to use */
static endpoint_t driver_endpt; /* driver endpoint */
/* Entry points to this driver. */
PRIVATE struct blockdriver fbd_dtab = {
static struct blockdriver fbd_dtab = {
BLOCKDRIVER_TYPE_OTHER, /* do not handle partition requests */
fbd_open, /* open or mount request, initialize device */
fbd_close, /* release device */
@@ -46,7 +46,7 @@ PRIVATE struct blockdriver fbd_dtab = {
};
/* Options supported by this driver. */
PRIVATE struct optset optset_table[] = {
static struct optset optset_table[] = {
{ "label", OPT_STRING, driver_label, sizeof(driver_label) },
{ "minor", OPT_INT, &driver_minor, 10 },
{ NULL, 0, NULL, 0 }
@@ -55,7 +55,7 @@ PRIVATE struct optset optset_table[] = {
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
clock_t uptime;
int r;
@@ -97,7 +97,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
/* Terminate immediately upon receiving a SIGTERM. */
if (signo != SIGTERM) return;
@@ -115,7 +115,7 @@ PRIVATE void sef_cb_signal_handler(int signo)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup(void)
static void sef_local_startup(void)
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -132,7 +132,7 @@ PRIVATE void sef_local_startup(void)
/*===========================================================================*
* main *
*===========================================================================*/
PUBLIC int main(int argc, char **argv)
int main(int argc, char **argv)
{
/* SEF local startup. */
env_setargs(argc, argv);
@@ -147,7 +147,7 @@ PUBLIC int main(int argc, char **argv)
/*===========================================================================*
* fbd_open *
*===========================================================================*/
PRIVATE int fbd_open(dev_t UNUSED(minor), int access)
static int fbd_open(dev_t UNUSED(minor), int access)
{
/* Open a device. */
message m;
@@ -172,7 +172,7 @@ PRIVATE int fbd_open(dev_t UNUSED(minor), int access)
/*===========================================================================*
* fbd_close *
*===========================================================================*/
PRIVATE int fbd_close(dev_t UNUSED(minor))
static int fbd_close(dev_t UNUSED(minor))
{
/* Close a device. */
message m;
@@ -196,7 +196,7 @@ PRIVATE int fbd_close(dev_t UNUSED(minor))
/*===========================================================================*
* fbd_ioctl *
*===========================================================================*/
PRIVATE int fbd_ioctl(dev_t UNUSED(minor), unsigned int request,
static int fbd_ioctl(dev_t UNUSED(minor), unsigned int request,
endpoint_t endpt, cp_grant_id_t grant)
{
/* Handle an I/O control request. */
@@ -238,7 +238,7 @@ PRIVATE int fbd_ioctl(dev_t UNUSED(minor), unsigned int request,
/*===========================================================================*
* fbd_transfer_direct *
*===========================================================================*/
PRIVATE ssize_t fbd_transfer_direct(int do_write, u64_t position,
static ssize_t fbd_transfer_direct(int do_write, u64_t position,
endpoint_t endpt, iovec_t *iov, unsigned int count, int flags)
{
/* Forward the entire transfer request, without any intervention. */
@@ -284,7 +284,7 @@ PRIVATE ssize_t fbd_transfer_direct(int do_write, u64_t position,
/*===========================================================================*
* fbd_transfer_copy *
*===========================================================================*/
PRIVATE ssize_t fbd_transfer_copy(int do_write, u64_t position,
static ssize_t fbd_transfer_copy(int do_write, u64_t position,
endpoint_t endpt, iovec_t *iov, unsigned int count, size_t size,
int flags)
{
@@ -406,7 +406,7 @@ PRIVATE ssize_t fbd_transfer_copy(int do_write, u64_t position,
/*===========================================================================*
* fbd_transfer *
*===========================================================================*/
PRIVATE int fbd_transfer(dev_t UNUSED(minor), int do_write, u64_t position,
static int fbd_transfer(dev_t UNUSED(minor), int do_write, u64_t position,
endpoint_t endpt, iovec_t *iov, unsigned int nr_req, int flags)
{
/* Transfer data from or to the device. */

View File

@@ -5,14 +5,14 @@
#include "action.h"
#include "rule.h"
PRIVATE struct fbd_rule rules[MAX_RULES];
PRIVATE struct fbd_rule *matches[MAX_RULES];
PRIVATE int nr_matches;
static struct fbd_rule rules[MAX_RULES];
static struct fbd_rule *matches[MAX_RULES];
static int nr_matches;
/*===========================================================================*
* rule_ctl *
*===========================================================================*/
PUBLIC int rule_ctl(int request, endpoint_t endpt, cp_grant_id_t grant)
int rule_ctl(int request, endpoint_t endpt, cp_grant_id_t grant)
{
/* Handle an I/O control request regarding rules. */
fbd_rulenum_t i;
@@ -86,7 +86,7 @@ PUBLIC int rule_ctl(int request, endpoint_t endpt, cp_grant_id_t grant)
/*===========================================================================*
* rule_match *
*===========================================================================*/
PRIVATE int rule_match(struct fbd_rule *rule, u64_t pos, size_t size, int flag)
static int rule_match(struct fbd_rule *rule, u64_t pos, size_t size, int flag)
{
/* Check whether the given rule matches the given parameters. As side
* effect, update counters in the rule as appropriate.
@@ -113,7 +113,7 @@ PRIVATE int rule_match(struct fbd_rule *rule, u64_t pos, size_t size, int flag)
/*===========================================================================*
* rule_find *
*===========================================================================*/
PUBLIC int rule_find(u64_t pos, size_t size, int flag)
int rule_find(u64_t pos, size_t size, int flag)
{
/* Find all matching rules, and return a hook mask. */
struct fbd_rule *rule;
@@ -150,7 +150,7 @@ PUBLIC int rule_find(u64_t pos, size_t size, int flag)
/*===========================================================================*
* rule_pre_hook *
*===========================================================================*/
PUBLIC void rule_pre_hook(iovec_t *iov, unsigned *count, size_t *size,
void rule_pre_hook(iovec_t *iov, unsigned *count, size_t *size,
u64_t *pos)
{
int i;
@@ -163,7 +163,7 @@ PUBLIC void rule_pre_hook(iovec_t *iov, unsigned *count, size_t *size,
/*===========================================================================*
* rule_io_hook *
*===========================================================================*/
PUBLIC void rule_io_hook(char *buf, size_t size, u64_t pos, int flag)
void rule_io_hook(char *buf, size_t size, u64_t pos, int flag)
{
int i;
@@ -175,7 +175,7 @@ PUBLIC void rule_io_hook(char *buf, size_t size, u64_t pos, int flag)
/*===========================================================================*
* rule_post_hook *
*===========================================================================*/
PUBLIC void rule_post_hook(size_t osize, int *result)
void rule_post_hook(size_t osize, int *result)
{
int i;

View File

@@ -864,7 +864,7 @@ static int paired_grant(char *buf1, char *buf2, int request,
/*===========================================================================*
* single_revoke *
*===========================================================================*/
PRIVATE void single_revoke(cp_grant_id_t gid,
static void single_revoke(cp_grant_id_t gid,
const iovec_s_t vector[NR_IOREQS], int count)
{
/* Revoke all grants associated with a request to a single driver.

View File

@@ -35,7 +35,7 @@ char BACKUP_LABEL[LABEL_SIZE] = ""; /* backup disk driver label */
int MAIN_MINOR = -1; /* main partition minor nr */
int BACKUP_MINOR = -1; /* backup partition minor nr */
PRIVATE struct optset optset_table[] = {
static struct optset optset_table[] = {
{ "label0", OPT_STRING, MAIN_LABEL, LABEL_SIZE },
{ "label1", OPT_STRING, BACKUP_LABEL, LABEL_SIZE },
{ "minor0", OPT_INT, &MAIN_MINOR, 10 },
@@ -73,9 +73,9 @@ static cp_grant_id_t grant_id; /* BDEV_GRANT */
static char *buf_array, *buffer; /* contiguous buffer */
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
FORWARD void sef_cb_signal_handler(int signo);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_cb_signal_handler(int signo);
/*===========================================================================*
* carry *
@@ -425,7 +425,7 @@ int main(int argc, char *argv[])
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup(void)
static void sef_local_startup(void)
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -443,7 +443,7 @@ PRIVATE void sef_local_startup(void)
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the filter driver. */
int r;
@@ -476,7 +476,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
/* Only check for termination signal, ignore anything else. */
if (signo != SIGTERM) return;

View File

@@ -158,7 +158,7 @@
*
* 3 720K 1.44M 9 80 300 RPM 250 kbps PS/2, et al.
*/
PRIVATE struct density {
static struct density {
u8_t secpt; /* sectors per track */
u8_t cyls; /* tracks per side */
u8_t steps; /* steps per cylinder (2 = double step) */
@@ -187,7 +187,7 @@ PRIVATE struct density {
#define b(d) (1 << (d)) /* bit for density d. */
PRIVATE struct test_order {
static struct test_order {
u8_t t_density; /* floppy/drive type */
u8_t t_class; /* limit drive to this class of densities */
} test_order[NT-1] = {
@@ -203,7 +203,7 @@ PRIVATE struct test_order {
};
/* Variables. */
PRIVATE struct floppy { /* main drive struct, one entry per drive */
static struct floppy { /* main drive struct, one entry per drive */
unsigned fl_curcyl; /* current cylinder */
unsigned fl_hardcyl; /* hardware cylinder, as opposed to: */
unsigned fl_cylinder; /* cylinder number addressed */
@@ -217,54 +217,54 @@ PRIVATE struct floppy { /* main drive struct, one entry per drive */
struct device fl_part[NR_PARTITIONS]; /* partition's base & size */
} floppy[NR_DRIVES];
PRIVATE int irq_hook_id; /* id of irq hook at the kernel */
PUBLIC int motor_status; /* bitmap of current motor status */
PRIVATE int need_reset; /* set to 1 when controller must be reset */
PUBLIC unsigned f_drive; /* selected drive */
PRIVATE unsigned f_device; /* selected minor device */
PRIVATE struct floppy *f_fp; /* current drive */
PRIVATE struct density *f_dp; /* current density parameters */
PRIVATE struct density *prev_dp;/* previous density parameters */
PRIVATE unsigned f_sectors; /* equal to f_dp->secpt (needed a lot) */
PUBLIC u16_t f_busy; /* BSY_IDLE, BSY_IO, BSY_WAKEN */
PRIVATE struct device *f_dv; /* device's base and size */
PRIVATE struct disk_parameter_s fmt_param; /* parameters for format */
PRIVATE u8_t f_results[MAX_RESULTS];/* the controller can give lots of output */
static int irq_hook_id; /* id of irq hook at the kernel */
int motor_status; /* bitmap of current motor status */
static int need_reset; /* set to 1 when controller must be reset */
unsigned f_drive; /* selected drive */
static unsigned f_device; /* selected minor device */
static struct floppy *f_fp; /* current drive */
static struct density *f_dp; /* current density parameters */
static struct density *prev_dp;/* previous density parameters */
static unsigned f_sectors; /* equal to f_dp->secpt (needed a lot) */
u16_t f_busy; /* BSY_IDLE, BSY_IO, BSY_WAKEN */
static struct device *f_dv; /* device's base and size */
static struct disk_parameter_s fmt_param; /* parameters for format */
static u8_t f_results[MAX_RESULTS];/* the controller can give lots of output */
/* The floppy uses various timers. These are managed by the floppy driver
* itself, because only a single synchronous alarm is available per process.
* Besides the 'f_tmr_timeout' timer below, the floppy structure for each
* floppy disk drive contains a 'fl_tmr_stop' timer.
*/
PRIVATE timer_t f_tmr_timeout; /* timer for various timeouts */
PRIVATE u32_t system_hz; /* system clock frequency */
FORWARD void f_expire_tmrs(clock_t stamp);
FORWARD void stop_motor(timer_t *tp);
FORWARD void f_timeout(timer_t *tp);
static timer_t f_tmr_timeout; /* timer for various timeouts */
static u32_t system_hz; /* system clock frequency */
static void f_expire_tmrs(clock_t stamp);
static void stop_motor(timer_t *tp);
static void f_timeout(timer_t *tp);
FORWARD struct device *f_prepare(dev_t device);
FORWARD struct device *f_part(dev_t minor);
FORWARD void f_cleanup(void);
FORWARD ssize_t f_transfer(dev_t minor, int do_write, u64_t position,
static struct device *f_prepare(dev_t device);
static struct device *f_part(dev_t minor);
static void f_cleanup(void);
static ssize_t f_transfer(dev_t minor, int do_write, u64_t position,
endpoint_t proc_nr, iovec_t *iov, unsigned int nr_req, int flags);
FORWARD int dma_setup(int do_write);
FORWARD void start_motor(void);
FORWARD int seek(void);
FORWARD int fdc_transfer(int do_write);
FORWARD int fdc_results(void);
FORWARD int fdc_command(const u8_t *cmd, int len);
FORWARD void fdc_out(int val);
FORWARD int recalibrate(void);
FORWARD void f_reset(void);
FORWARD int f_intr_wait(void);
FORWARD int read_id(void);
FORWARD int f_do_open(dev_t minor, int access);
FORWARD int f_do_close(dev_t minor);
FORWARD int test_read(int density);
FORWARD void f_geometry(dev_t minor, struct partition *entry);
static int dma_setup(int do_write);
static void start_motor(void);
static int seek(void);
static int fdc_transfer(int do_write);
static int fdc_results(void);
static int fdc_command(const u8_t *cmd, int len);
static void fdc_out(int val);
static int recalibrate(void);
static void f_reset(void);
static int f_intr_wait(void);
static int read_id(void);
static int f_do_open(dev_t minor, int access);
static int f_do_close(dev_t minor);
static int test_read(int density);
static void f_geometry(dev_t minor, struct partition *entry);
/* Entry points to this driver. */
PRIVATE struct blockdriver f_dtab = {
static struct blockdriver f_dtab = {
BLOCKDRIVER_TYPE_DISK, /* handle partition requests */
f_do_open, /* open or mount request, sense type of diskette */
f_do_close, /* nothing on a close */
@@ -283,18 +283,18 @@ static char *floppy_buf;
static phys_bytes floppy_buf_phys;
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
FORWARD void sef_cb_signal_handler(int signo);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_cb_signal_handler(int signo);
EXTERN int sef_cb_lu_prepare(int state);
EXTERN int sef_cb_lu_state_isvalid(int state);
EXTERN void sef_cb_lu_state_dump(int state);
PUBLIC int last_was_write;
int last_was_write;
/*===========================================================================*
* floppy_task *
*===========================================================================*/
PUBLIC int main(void)
int main(void)
{
/* SEF local startup. */
sef_local_startup();
@@ -308,7 +308,7 @@ PUBLIC int main(void)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup(void)
static void sef_local_startup(void)
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -329,7 +329,7 @@ PRIVATE void sef_local_startup(void)
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the floppy driver. */
struct floppy *fp;
@@ -369,7 +369,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
int s;
@@ -385,7 +385,7 @@ PRIVATE void sef_cb_signal_handler(int signo)
/*===========================================================================*
* f_expire_tmrs *
*===========================================================================*/
PRIVATE void f_expire_tmrs(clock_t stamp)
static void f_expire_tmrs(clock_t stamp)
{
/* A synchronous alarm message was received. Call the watchdog function for
* each expired timer, if any.
@@ -397,7 +397,7 @@ PRIVATE void f_expire_tmrs(clock_t stamp)
/*===========================================================================*
* f_prepare *
*===========================================================================*/
PRIVATE struct device *f_prepare(dev_t device)
static struct device *f_prepare(dev_t device)
{
/* Prepare for I/O on a device. */
@@ -424,7 +424,7 @@ PRIVATE struct device *f_prepare(dev_t device)
/*===========================================================================*
* f_part *
*===========================================================================*/
PRIVATE struct device *f_part(dev_t minor)
static struct device *f_part(dev_t minor)
{
/* Return a pointer to the partition information of the given minor device. */
@@ -434,7 +434,7 @@ PRIVATE struct device *f_part(dev_t minor)
/*===========================================================================*
* f_cleanup *
*===========================================================================*/
PRIVATE void f_cleanup(void)
static void f_cleanup(void)
{
/* Start a timer to turn the motor off in a few seconds. */
set_timer(&f_fp->fl_tmr_stop, MOTOR_OFF, stop_motor, f_drive);
@@ -446,7 +446,7 @@ PRIVATE void f_cleanup(void)
/*===========================================================================*
* f_transfer *
*===========================================================================*/
PRIVATE ssize_t f_transfer(
static ssize_t f_transfer(
dev_t minor, /* minor device number */
int do_write, /* read or write? */
u64_t pos64, /* offset on device to read or write */
@@ -690,7 +690,7 @@ PRIVATE ssize_t f_transfer(
/*===========================================================================*
* dma_setup *
*===========================================================================*/
PRIVATE int dma_setup(int do_write)
static int dma_setup(int do_write)
{
/* The IBM PC can perform DMA operations by using the DMA chip. To use it,
* the DMA (Direct Memory Access) chip is loaded with the 20-bit memory address
@@ -734,7 +734,7 @@ PRIVATE int dma_setup(int do_write)
/*===========================================================================*
* start_motor *
*===========================================================================*/
PRIVATE void start_motor(void)
static void start_motor(void)
{
/* Control of the floppy disk motors is a big pain. If a motor is off, you
* have to turn it on first, which takes 1/2 second. You can't leave it on
@@ -788,7 +788,7 @@ PRIVATE void start_motor(void)
/*===========================================================================*
* stop_motor *
*===========================================================================*/
PRIVATE void stop_motor(timer_t *tp)
static void stop_motor(timer_t *tp)
{
/* This routine is called from an alarm timer after several seconds have
* elapsed with no floppy disk activity. It turns the drive motor off.
@@ -802,7 +802,7 @@ PRIVATE void stop_motor(timer_t *tp)
/*===========================================================================*
* seek *
*===========================================================================*/
PRIVATE int seek(void)
static int seek(void)
{
/* Issue a SEEK command on the indicated drive unless the arm is already
* positioned on the correct cylinder.
@@ -866,7 +866,7 @@ PRIVATE int seek(void)
/*===========================================================================*
* fdc_transfer *
*===========================================================================*/
PRIVATE int fdc_transfer(int do_write)
static int fdc_transfer(int do_write)
{
/* The drive is now on the proper cylinder. Read, write or format 1 block. */
@@ -938,7 +938,7 @@ PRIVATE int fdc_transfer(int do_write)
/*===========================================================================*
* fdc_results *
*===========================================================================*/
PRIVATE int fdc_results(void)
static int fdc_results(void)
{
/* Extract results from the controller after an operation, then allow floppy
* interrupts again.
@@ -987,7 +987,7 @@ PRIVATE int fdc_results(void)
/*===========================================================================*
* fdc_command *
*===========================================================================*/
PRIVATE int fdc_command(
static int fdc_command(
const u8_t *cmd, /* command bytes */
int len /* command length */
)
@@ -1012,7 +1012,7 @@ PRIVATE int fdc_command(
/*===========================================================================*
* fdc_out *
*===========================================================================*/
PRIVATE void fdc_out(
static void fdc_out(
int val /* write this byte to floppy disk controller */
)
{
@@ -1045,7 +1045,7 @@ PRIVATE void fdc_out(
/*===========================================================================*
* recalibrate *
*===========================================================================*/
PRIVATE int recalibrate(void)
static int recalibrate(void)
{
/* The floppy disk controller has no way of determining its absolute arm
* position (cylinder). Instead, it steps the arm a cylinder at a time and
@@ -1087,7 +1087,7 @@ PRIVATE int recalibrate(void)
/*===========================================================================*
* f_reset *
*===========================================================================*/
PRIVATE void f_reset(void)
static void f_reset(void)
{
/* Issue a reset to the controller. This is done after any catastrophe,
* like the controller refusing to respond.
@@ -1160,7 +1160,7 @@ PRIVATE void f_reset(void)
/*===========================================================================*
* f_intr_wait *
*===========================================================================*/
PRIVATE int f_intr_wait(void)
static int f_intr_wait(void)
{
/* Wait for an interrupt, but not forever. The FDC may have all the time of
* the world, but we humans do not.
@@ -1199,7 +1199,7 @@ PRIVATE int f_intr_wait(void)
/*===========================================================================*
* f_timeout *
*===========================================================================*/
PRIVATE void f_timeout(timer_t *UNUSED(tp))
static void f_timeout(timer_t *UNUSED(tp))
{
/* This routine is called when a timer expires. Usually to tell that a
* motor has spun up, but also to forge an interrupt when it takes too long
@@ -1214,7 +1214,7 @@ PRIVATE void f_timeout(timer_t *UNUSED(tp))
/*===========================================================================*
* read_id *
*===========================================================================*/
PRIVATE int read_id(void)
static int read_id(void)
{
/* Determine current cylinder and sector. */
@@ -1247,7 +1247,7 @@ PRIVATE int read_id(void)
/*===========================================================================*
* f_do_open *
*===========================================================================*/
PRIVATE int f_do_open(dev_t minor, int UNUSED(access))
static int f_do_open(dev_t minor, int UNUSED(access))
{
/* Handle an open on a floppy. Determine diskette type if need be. */
@@ -1306,7 +1306,7 @@ PRIVATE int f_do_open(dev_t minor, int UNUSED(access))
/*===========================================================================*
* f_do_close *
*===========================================================================*/
PRIVATE int f_do_close(dev_t UNUSED(minor))
static int f_do_close(dev_t UNUSED(minor))
{
/* Handle a close on a floppy. Nothing to do here. */
@@ -1316,7 +1316,7 @@ PRIVATE int f_do_close(dev_t UNUSED(minor))
/*===========================================================================*
* test_read *
*===========================================================================*/
PRIVATE int test_read(int density)
static int test_read(int density)
{
/* Try to read the highest numbered sector on cylinder 2. Not all floppy
* types have as many sectors per track, and trying cylinder 2 finds the
@@ -1346,7 +1346,7 @@ PRIVATE int test_read(int density)
/*===========================================================================*
* f_geometry *
*===========================================================================*/
PRIVATE void f_geometry(dev_t minor, struct partition *entry)
static void f_geometry(dev_t minor, struct partition *entry)
{
if (f_prepare(minor) == NULL) return;

View File

@@ -22,7 +22,7 @@ EXTERN int last_was_write;
/*===========================================================================*
* sef_cb_lu_prepare *
*===========================================================================*/
PUBLIC int sef_cb_lu_prepare(int state)
int sef_cb_lu_prepare(int state)
{
int is_ready;
@@ -49,7 +49,7 @@ PUBLIC int sef_cb_lu_prepare(int state)
/*===========================================================================*
* sef_cb_lu_state_isvalid *
*===========================================================================*/
PUBLIC int sef_cb_lu_state_isvalid(int state)
int sef_cb_lu_state_isvalid(int state)
{
return SEF_LU_STATE_IS_STANDARD(state) || FL_STATE_IS_CUSTOM(state);
}
@@ -57,7 +57,7 @@ PUBLIC int sef_cb_lu_state_isvalid(int state)
/*===========================================================================*
* sef_cb_lu_state_dump *
*===========================================================================*/
PUBLIC void sef_cb_lu_state_dump(int state)
void sef_cb_lu_state_dump(int state)
{
sef_lu_dprint("floppy: live update state = %d\n", state);
sef_lu_dprint("floppy: f_busy = %d\n", f_busy);

View File

@@ -45,7 +45,7 @@ typedef int irq_hook_t;
/* ignore interrupt for the moment */
#define interrupt(x) do { } while(0)
PRIVATE union tmpbuf
static union tmpbuf
{
char pad[4096];
struct cbl_conf cc;
@@ -136,13 +136,13 @@ fxp_t;
#define FT_82559 0x4
#define FT_82801 0x8
PRIVATE int fxp_instance;
static int fxp_instance;
PRIVATE fxp_t *fxp_state;
static fxp_t *fxp_state;
PRIVATE timer_t fxp_watchdog;
static timer_t fxp_watchdog;
PRIVATE u32_t system_hz;
static u32_t system_hz;
#define fxp_inb(port, offset) (do_inb((port) + (offset)))
#define fxp_inl(port, offset) (do_inl((port) + (offset)))
@@ -184,7 +184,7 @@ static void do_outl(port_t port, u32_t v);
static void tell_dev(vir_bytes start, size_t size, int pci_bus, int
pci_dev, int pci_func);
PRIVATE void handle_hw_intr(void)
static void handle_hw_intr(void)
{
int r;
fxp_t *fp;
@@ -208,9 +208,9 @@ PRIVATE void handle_hw_intr(void)
}
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
FORWARD void sef_cb_signal_handler(int signo);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_cb_signal_handler(int signo);
/*===========================================================================*
* main *
@@ -261,7 +261,7 @@ int main(int argc, char *argv[])
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -282,7 +282,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize the fxp driver. */
long v;
@@ -314,7 +314,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
port_t port;
fxp_t *fp;
@@ -1986,7 +1986,7 @@ message *reply_mess;
/*===========================================================================*
* eeprom_read *
*===========================================================================*/
PRIVATE u16_t eeprom_read(fp, reg)
static u16_t eeprom_read(fp, reg)
fxp_t *fp;
int reg;
{
@@ -2046,7 +2046,7 @@ int reg;
/*===========================================================================*
* eeprom_addrsize *
*===========================================================================*/
PRIVATE void eeprom_addrsize(fp)
static void eeprom_addrsize(fp)
fxp_t *fp;
{
port_t port;
@@ -2104,7 +2104,7 @@ fxp_t *fp;
/*===========================================================================*
* mii_read *
*===========================================================================*/
PRIVATE u16_t mii_read(fp, reg)
static u16_t mii_read(fp, reg)
fxp_t *fp;
int reg;
{
@@ -2178,7 +2178,7 @@ static void do_outl(port_t port, u32_t value)
panic("sys_outl failed: %d", r);
}
PRIVATE void tell_dev(buf, size, pci_bus, pci_dev, pci_func)
static void tell_dev(buf, size, pci_bus, pci_dev, pci_func)
vir_bytes buf;
size_t size;
int pci_bus;

View File

@@ -16,7 +16,7 @@ Media Independent (Ethernet) Interface functions
/*===========================================================================*
* mii_print_stat_speed *
*===========================================================================*/
PUBLIC void mii_print_stat_speed(u16_t stat, u16_t extstat)
void mii_print_stat_speed(u16_t stat, u16_t extstat)
{
int fs, ft;
@@ -117,7 +117,7 @@ PUBLIC void mii_print_stat_speed(u16_t stat, u16_t extstat)
/*===========================================================================*
* mii_print_techab *
*===========================================================================*/
PUBLIC void mii_print_techab(u16_t techab)
void mii_print_techab(u16_t techab)
{
int fs, ft;

View File

@@ -8,21 +8,21 @@
/*
* Function prototypes for the hello driver.
*/
FORWARD int hello_open(message *m);
FORWARD int hello_close(message *m);
FORWARD struct device * hello_prepare(dev_t device);
FORWARD int hello_transfer(endpoint_t endpt, int opcode, u64_t position,
static int hello_open(message *m);
static int hello_close(message *m);
static struct device * hello_prepare(dev_t device);
static int hello_transfer(endpoint_t endpt, int opcode, u64_t position,
iovec_t *iov, unsigned int nr_req, endpoint_t user_endpt, unsigned int
flags);
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init(int type, sef_init_info_t *info);
FORWARD int sef_cb_lu_state_save(int);
FORWARD int lu_state_restore(void);
static void sef_local_startup(void);
static int sef_cb_init(int type, sef_init_info_t *info);
static int sef_cb_lu_state_save(int);
static int lu_state_restore(void);
/* Entry points to the hello driver. */
PRIVATE struct chardriver hello_tab =
static struct chardriver hello_tab =
{
hello_open,
hello_close,
@@ -37,31 +37,31 @@ PRIVATE struct chardriver hello_tab =
};
/** Represents the /dev/hello device. */
PRIVATE struct device hello_device;
static struct device hello_device;
/** State variable to count the number of times the device has been opened. */
PRIVATE int open_counter;
static int open_counter;
PRIVATE int hello_open(message *UNUSED(m))
static int hello_open(message *UNUSED(m))
{
printf("hello_open(). Called %d time(s).\n", ++open_counter);
return OK;
}
PRIVATE int hello_close(message *UNUSED(m))
static int hello_close(message *UNUSED(m))
{
printf("hello_close()\n");
return OK;
}
PRIVATE struct device * hello_prepare(dev_t UNUSED(dev))
static struct device * hello_prepare(dev_t UNUSED(dev))
{
hello_device.dv_base = make64(0, 0);
hello_device.dv_size = make64(strlen(HELLO_MESSAGE), 0);
return &hello_device;
}
PRIVATE int hello_transfer(endpoint_t endpt, int opcode, u64_t position,
static int hello_transfer(endpoint_t endpt, int opcode, u64_t position,
iovec_t *iov, unsigned nr_req, endpoint_t UNUSED(user_endpt),
unsigned int UNUSED(flags))
{
@@ -97,14 +97,14 @@ PRIVATE int hello_transfer(endpoint_t endpt, int opcode, u64_t position,
return ret;
}
PRIVATE int sef_cb_lu_state_save(int UNUSED(state)) {
static int sef_cb_lu_state_save(int UNUSED(state)) {
/* Save the state. */
ds_publish_u32("open_counter", open_counter, DSF_OVERWRITE);
return OK;
}
PRIVATE int lu_state_restore() {
static int lu_state_restore() {
/* Restore the state. */
u32_t value;
@@ -115,7 +115,7 @@ PRIVATE int lu_state_restore() {
return OK;
}
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/*
* Register init callbacks. Use the same function for all event types
@@ -138,7 +138,7 @@ PRIVATE void sef_local_startup()
sef_startup();
}
PRIVATE int sef_cb_init(int type, sef_init_info_t *UNUSED(info))
static int sef_cb_init(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the hello driver. */
int do_announce_driver = TRUE;
@@ -171,7 +171,7 @@ PRIVATE int sef_cb_init(int type, sef_init_info_t *UNUSED(info))
return OK;
}
PUBLIC int main(void)
int main(void)
{
/*
* Perform initialization.

View File

@@ -245,9 +245,9 @@ static char isstored[TX_RING_SIZE]; /* Tx-slot in-use */
phys_bytes lance_buf_phys;
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
FORWARD void sef_cb_signal_handler(int signo);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_cb_signal_handler(int signo);
/*===========================================================================*
* main *
@@ -322,7 +322,7 @@ int main( int argc, char **argv )
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -343,7 +343,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the lance driver. */
long v;
@@ -371,7 +371,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
/* Only check for termination signal, ignore anything else. */

View File

@@ -12,7 +12,7 @@
/*==========================================================================*
* do_new_kmess *
*==========================================================================*/
PUBLIC void do_new_kmess(void)
void do_new_kmess(void)
{
/* Notification for a new kernel message. */
static struct kmessages kmess; /* entire kmess structure */

View File

@@ -5,9 +5,9 @@
EXTERN struct logdevice logdevices[NR_DEVS];
/* State management helpers. */
PRIVATE int is_read_pending;
PRIVATE int is_select_callback_pending;
PRIVATE void load_state_info(void)
static int is_read_pending;
static int is_select_callback_pending;
static void load_state_info(void)
{
int i, found_pending;
struct logdevice *log;
@@ -36,7 +36,7 @@ PRIVATE void load_state_info(void)
/*===========================================================================*
* sef_cb_lu_prepare *
*===========================================================================*/
PUBLIC int sef_cb_lu_prepare(int state)
int sef_cb_lu_prepare(int state)
{
int is_ready;
@@ -68,7 +68,7 @@ PUBLIC int sef_cb_lu_prepare(int state)
/*===========================================================================*
* sef_cb_lu_state_isvalid *
*===========================================================================*/
PUBLIC int sef_cb_lu_state_isvalid(int state)
int sef_cb_lu_state_isvalid(int state)
{
return SEF_LU_STATE_IS_STANDARD(state) || LOG_STATE_IS_CUSTOM(state);
}
@@ -76,7 +76,7 @@ PUBLIC int sef_cb_lu_state_isvalid(int state)
/*===========================================================================*
* sef_cb_lu_state_dump *
*===========================================================================*/
PUBLIC void sef_cb_lu_state_dump(int state)
void sef_cb_lu_state_dump(int state)
{
/* Load state information. */
load_state_info();

View File

@@ -18,23 +18,23 @@
#define LOGINC(n, i) do { (n) = (((n) + (i)) % LOG_SIZE); } while(0)
PUBLIC struct logdevice logdevices[NR_DEVS];
PRIVATE struct device log_geom[NR_DEVS]; /* base and size of devices */
PRIVATE int log_device = -1; /* current device */
struct logdevice logdevices[NR_DEVS];
static struct device log_geom[NR_DEVS]; /* base and size of devices */
static int log_device = -1; /* current device */
FORWARD struct device *log_prepare(dev_t device);
FORWARD int log_transfer(endpoint_t endpt, int opcode, u64_t position,
static struct device *log_prepare(dev_t device);
static int log_transfer(endpoint_t endpt, int opcode, u64_t position,
iovec_t *iov, unsigned int nr_req, endpoint_t user_endpt, unsigned int
flags);
FORWARD int log_do_open(message *m_ptr);
FORWARD int log_cancel(message *m_ptr);
FORWARD int log_select(message *m_ptr);
FORWARD int log_other(message *m_ptr);
FORWARD int subread(struct logdevice *log, int count, endpoint_t endpt,
static int log_do_open(message *m_ptr);
static int log_cancel(message *m_ptr);
static int log_select(message *m_ptr);
static int log_other(message *m_ptr);
static int subread(struct logdevice *log, int count, endpoint_t endpt,
cp_grant_id_t grant, size_t);
/* Entry points to this driver. */
PRIVATE struct chardriver log_dtab = {
static struct chardriver log_dtab = {
log_do_open, /* open or mount */
do_nop, /* nothing on a close */
nop_ioctl, /* ioctl nop */
@@ -48,17 +48,17 @@ PRIVATE struct chardriver log_dtab = {
};
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
EXTERN int sef_cb_lu_prepare(int state);
EXTERN int sef_cb_lu_state_isvalid(int state);
EXTERN void sef_cb_lu_state_dump(int state);
FORWARD void sef_cb_signal_handler(int signo);
static void sef_cb_signal_handler(int signo);
/*===========================================================================*
* main *
*===========================================================================*/
PUBLIC int main(void)
int main(void)
{
/* SEF local startup. */
sef_local_startup();
@@ -72,7 +72,7 @@ PUBLIC int main(void)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -94,7 +94,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize the log driver. */
int i;
@@ -118,7 +118,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
/* Only check for a pending message from the kernel, ignore anything else. */
if (signo != SIGKMESS) return;
@@ -129,7 +129,7 @@ PRIVATE void sef_cb_signal_handler(int signo)
/*===========================================================================*
* log_prepare *
*===========================================================================*/
PRIVATE struct device *log_prepare(dev_t device)
static struct device *log_prepare(dev_t device)
{
/* Prepare for I/O on a device: check if the minor device number is ok. */
@@ -142,7 +142,7 @@ PRIVATE struct device *log_prepare(dev_t device)
/*===========================================================================*
* subwrite *
*===========================================================================*/
PRIVATE int
static int
subwrite(struct logdevice *log, int count, endpoint_t endpt,
cp_grant_id_t grant, size_t offset, char *localbuf)
{
@@ -230,7 +230,7 @@ subwrite(struct logdevice *log, int count, endpoint_t endpt,
/*===========================================================================*
* log_append *
*===========================================================================*/
PUBLIC void
void
log_append(char *buf, int count)
{
int w = 0, skip = 0;
@@ -250,7 +250,7 @@ log_append(char *buf, int count)
/*===========================================================================*
* subread *
*===========================================================================*/
PRIVATE int
static int
subread(struct logdevice *log, int count, endpoint_t endpt,
cp_grant_id_t grant, size_t offset)
{
@@ -275,7 +275,7 @@ subread(struct logdevice *log, int count, endpoint_t endpt,
/*===========================================================================*
* log_transfer *
*===========================================================================*/
PRIVATE int log_transfer(
static int log_transfer(
endpoint_t endpt, /* endpoint of grant owner */
int opcode, /* DEV_GATHER_S or DEV_SCATTER_S */
u64_t UNUSED(position), /* offset on device to read or write */
@@ -356,7 +356,7 @@ PRIVATE int log_transfer(
/*============================================================================*
* log_do_open *
*============================================================================*/
PRIVATE int log_do_open(message *m_ptr)
static int log_do_open(message *m_ptr)
{
if (log_prepare(m_ptr->DEVICE) == NULL) return(ENXIO);
return(OK);
@@ -365,7 +365,7 @@ PRIVATE int log_do_open(message *m_ptr)
/*============================================================================*
* log_cancel *
*============================================================================*/
PRIVATE int log_cancel(message *m_ptr)
static int log_cancel(message *m_ptr)
{
int d;
d = m_ptr->TTY_LINE;
@@ -379,7 +379,7 @@ PRIVATE int log_cancel(message *m_ptr)
/*============================================================================*
* log_other *
*============================================================================*/
PRIVATE int log_other(message *m_ptr)
static int log_other(message *m_ptr)
{
int r;
@@ -406,7 +406,7 @@ PRIVATE int log_other(message *m_ptr)
/*============================================================================*
* log_select *
*============================================================================*/
PRIVATE int log_select(message *m_ptr)
static int log_select(message *m_ptr)
{
int d, ready_ops = 0, ops = 0;
d = m_ptr->TTY_LINE;

View File

@@ -38,29 +38,29 @@
#define NR_DEVS (7+RAMDISKS) /* number of minor devices */
PRIVATE struct device m_geom[NR_DEVS]; /* base and size of each device */
PRIVATE vir_bytes m_vaddrs[NR_DEVS];
PRIVATE dev_t m_device; /* current minor character device */
static struct device m_geom[NR_DEVS]; /* base and size of each device */
static vir_bytes m_vaddrs[NR_DEVS];
static dev_t m_device; /* current minor character device */
PRIVATE int openct[NR_DEVS];
static int openct[NR_DEVS];
FORWARD struct device *m_prepare(dev_t device);
FORWARD int m_transfer(endpoint_t endpt, int opcode, u64_t position,
static struct device *m_prepare(dev_t device);
static int m_transfer(endpoint_t endpt, int opcode, u64_t position,
iovec_t *iov, unsigned int nr_req, endpoint_t user_endpt, unsigned int
flags);
FORWARD int m_do_open(message *m_ptr);
FORWARD int m_do_close(message *m_ptr);
static int m_do_open(message *m_ptr);
static int m_do_close(message *m_ptr);
FORWARD struct device *m_block_part(dev_t minor);
FORWARD int m_block_transfer(dev_t minor, int do_write, u64_t position,
static struct device *m_block_part(dev_t minor);
static int m_block_transfer(dev_t minor, int do_write, u64_t position,
endpoint_t endpt, iovec_t *iov, unsigned int nr_req, int flags);
FORWARD int m_block_open(dev_t minor, int access);
FORWARD int m_block_close(dev_t minor);
FORWARD int m_block_ioctl(dev_t minor, unsigned int request, endpoint_t
static int m_block_open(dev_t minor, int access);
static int m_block_close(dev_t minor);
static int m_block_ioctl(dev_t minor, unsigned int request, endpoint_t
endpt, cp_grant_id_t grant);
/* Entry points to the CHARACTER part of this driver. */
PRIVATE struct chardriver m_cdtab = {
static struct chardriver m_cdtab = {
m_do_open, /* open or mount */
m_do_close, /* nothing on a close */
nop_ioctl, /* no I/O control */
@@ -74,7 +74,7 @@ PRIVATE struct chardriver m_cdtab = {
};
/* Entry points to the BLOCK part of this driver. */
PRIVATE struct blockdriver m_bdtab = {
static struct blockdriver m_bdtab = {
BLOCKDRIVER_TYPE_DISK,/* handle partition requests */
m_block_open, /* open or mount */
m_block_close, /* nothing on a close */
@@ -91,19 +91,19 @@ PRIVATE struct blockdriver m_bdtab = {
/* Buffer for the /dev/zero null byte feed. */
#define ZERO_BUF_SIZE 1024
PRIVATE char dev_zero[ZERO_BUF_SIZE];
static char dev_zero[ZERO_BUF_SIZE];
#define click_to_round_k(n) \
((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024))
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
/*===========================================================================*
* main *
*===========================================================================*/
PUBLIC int main(void)
int main(void)
{
message msg;
int r, ipc_status;
@@ -129,7 +129,7 @@ PUBLIC int main(void)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -147,7 +147,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize the memory driver. */
int i;
@@ -193,7 +193,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
/*===========================================================================*
* m_is_block *
*===========================================================================*/
PRIVATE int m_is_block(dev_t minor)
static int m_is_block(dev_t minor)
{
/* Return TRUE iff the given minor device number is for a block device. */
@@ -212,7 +212,7 @@ PRIVATE int m_is_block(dev_t minor)
/*===========================================================================*
* m_prepare *
*===========================================================================*/
PRIVATE struct device *m_prepare(dev_t device)
static struct device *m_prepare(dev_t device)
{
/* Prepare for I/O on a device: check if the minor device number is ok. */
if (device >= NR_DEVS || m_is_block(device)) return(NULL);
@@ -224,7 +224,7 @@ PRIVATE struct device *m_prepare(dev_t device)
/*===========================================================================*
* m_transfer *
*===========================================================================*/
PRIVATE int m_transfer(
static int m_transfer(
endpoint_t endpt, /* endpoint of grant owner */
int opcode, /* DEV_GATHER_S or DEV_SCATTER_S */
u64_t pos64, /* offset on device to read or write */
@@ -381,7 +381,7 @@ PRIVATE int m_transfer(
/*===========================================================================*
* m_do_open *
*===========================================================================*/
PRIVATE int m_do_open(message *m_ptr)
static int m_do_open(message *m_ptr)
{
/* Open a memory character device. */
int r;
@@ -407,7 +407,7 @@ PRIVATE int m_do_open(message *m_ptr)
/*===========================================================================*
* m_do_close *
*===========================================================================*/
PRIVATE int m_do_close(message *m_ptr)
static int m_do_close(message *m_ptr)
{
/* Close a memory character device. */
if (m_prepare(m_ptr->DEVICE) == NULL) return(ENXIO);
@@ -424,7 +424,7 @@ PRIVATE int m_do_close(message *m_ptr)
/*===========================================================================*
* m_block_part *
*===========================================================================*/
PRIVATE struct device *m_block_part(dev_t minor)
static struct device *m_block_part(dev_t minor)
{
/* Prepare for I/O on a device: check if the minor device number is ok. */
if (minor >= NR_DEVS || !m_is_block(minor)) return(NULL);
@@ -435,7 +435,7 @@ PRIVATE struct device *m_block_part(dev_t minor)
/*===========================================================================*
* m_block_transfer *
*===========================================================================*/
PRIVATE int m_block_transfer(
static int m_block_transfer(
dev_t minor, /* minor device number */
int do_write, /* read or write? */
u64_t pos64, /* offset on device to read or write */
@@ -502,7 +502,7 @@ PRIVATE int m_block_transfer(
/*===========================================================================*
* m_block_open *
*===========================================================================*/
PRIVATE int m_block_open(dev_t minor, int UNUSED(access))
static int m_block_open(dev_t minor, int UNUSED(access))
{
/* Open a memory block device. */
if (m_block_part(minor) == NULL) return(ENXIO);
@@ -515,7 +515,7 @@ PRIVATE int m_block_open(dev_t minor, int UNUSED(access))
/*===========================================================================*
* m_block_close *
*===========================================================================*/
PRIVATE int m_block_close(dev_t minor)
static int m_block_close(dev_t minor)
{
/* Close a memory block device. */
if (m_block_part(minor) == NULL) return(ENXIO);
@@ -556,7 +556,7 @@ PRIVATE int m_block_close(dev_t minor)
/*===========================================================================*
* m_block_ioctl *
*===========================================================================*/
PRIVATE int m_block_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
static int m_block_ioctl(dev_t minor, unsigned int request, endpoint_t endpt,
cp_grant_id_t grant)
{
/* I/O controls for the block devices of the memory driver. Currently there is

View File

@@ -43,7 +43,7 @@
* *
* Wait msecs milli seconds *
*****************************************************************************/
PRIVATE void milli_delay(unsigned int msecs)
static void milli_delay(unsigned int msecs)
{
micro_delay((long)msecs * 1000);
}
@@ -141,7 +141,7 @@ int hermes_cor_reset (hermes_t *hw) {
* 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) {
static 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");

View File

@@ -69,8 +69,8 @@
#define IRQ_BAP 1
#define ETH_HLEN 14
PRIVATE t_or or_state;
PRIVATE int or_instance;
static t_or or_state;
static int or_instance;
struct ethhdr {
u8_t h_dest[ETH_ALEN];
@@ -102,7 +102,7 @@ u8_t encaps_hdr[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
********************************************************************/
/* The frequency of each channel in MHz */
PRIVATE const long channel_frequency[] = {
static const long channel_frequency[] = {
2412, 2417, 2422, 2427, 2432, 2437, 2442,
2447, 2452, 2457, 2462, 2467, 2472, 2484
};
@@ -159,15 +159,15 @@ static void or_dump(message *m);
/* The message used in the main loop is made global, so that rl_watchdog_f()
* can change its message type to fake an interrupt message.
*/
PRIVATE message m;
PRIVATE int int_event_check; /* set to TRUE if events arrived */
static message m;
static int int_event_check; /* set to TRUE if events arrived */
PRIVATE u32_t system_hz;
static u32_t system_hz;
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
FORWARD void sef_cb_signal_handler(int signo);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_cb_signal_handler(int signo);
/*****************************************************************************
* main *
@@ -231,7 +231,7 @@ int main(int argc, char *argv[]) {
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -252,7 +252,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
static int sef_cb_init_fresh(int type, sef_init_info_t *info)
{
/* Initialize the orinoco driver. */
long v;
@@ -278,7 +278,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
t_or *orp;

View File

@@ -4,33 +4,33 @@ main.c
#include "pci.h"
PUBLIC struct pci_acl pci_acl[NR_DRIVERS];
struct pci_acl pci_acl[NR_DRIVERS];
FORWARD void do_init(message *mp);
FORWARD void do_first_dev(message *mp);
FORWARD void do_next_dev(message *mp);
FORWARD void do_find_dev(message *mp);
FORWARD void do_ids(message *mp);
FORWARD void do_dev_name_s(message *mp);
FORWARD void do_slot_name_s(message *mp);
FORWARD void do_set_acl(message *mp);
FORWARD void do_del_acl(message *mp);
FORWARD void do_reserve(message *mp);
FORWARD void do_attr_r8(message *mp);
FORWARD void do_attr_r16(message *mp);
FORWARD void do_attr_r32(message *mp);
FORWARD void do_attr_w8(message *mp);
FORWARD void do_attr_w16(message *mp);
FORWARD void do_attr_w32(message *mp);
FORWARD void do_get_bar(message *mp);
FORWARD void do_rescan_bus(message *mp);
FORWARD void reply(message *mp, int result);
FORWARD struct rs_pci *find_acl(int endpoint);
static void do_init(message *mp);
static void do_first_dev(message *mp);
static void do_next_dev(message *mp);
static void do_find_dev(message *mp);
static void do_ids(message *mp);
static void do_dev_name_s(message *mp);
static void do_slot_name_s(message *mp);
static void do_set_acl(message *mp);
static void do_del_acl(message *mp);
static void do_reserve(message *mp);
static void do_attr_r8(message *mp);
static void do_attr_r16(message *mp);
static void do_attr_r32(message *mp);
static void do_attr_w8(message *mp);
static void do_attr_w16(message *mp);
static void do_attr_w32(message *mp);
static void do_get_bar(message *mp);
static void do_rescan_bus(message *mp);
static void reply(message *mp, int result);
static struct rs_pci *find_acl(int endpoint);
extern int debug;
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
static void sef_local_startup(void);
int main(void)
{
@@ -90,7 +90,7 @@ int main(void)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -105,7 +105,7 @@ PRIVATE void sef_local_startup()
sef_startup();
}
PRIVATE void do_init(mp)
static void do_init(mp)
message *mp;
{
int r;
@@ -121,7 +121,7 @@ message *mp;
mp->m_source, r);
}
PRIVATE void do_first_dev(message *mp)
static void do_first_dev(message *mp)
{
int r, devind;
u16_t vid, did;
@@ -149,7 +149,7 @@ PRIVATE void do_first_dev(message *mp)
}
}
PRIVATE void do_next_dev(message *mp)
static void do_next_dev(message *mp)
{
int r, devind;
u16_t vid, did;
@@ -174,7 +174,7 @@ PRIVATE void do_next_dev(message *mp)
}
}
PRIVATE void do_find_dev(mp)
static void do_find_dev(mp)
message *mp;
{
int r, devind;
@@ -196,7 +196,7 @@ message *mp;
}
}
PRIVATE void do_ids(mp)
static void do_ids(mp)
message *mp;
{
int r, devind;
@@ -222,7 +222,7 @@ message *mp;
}
}
PRIVATE void do_dev_name_s(mp)
static void do_dev_name_s(mp)
message *mp;
{
int r, name_len, len;
@@ -259,7 +259,7 @@ message *mp;
}
}
PRIVATE void do_slot_name_s(mp)
static void do_slot_name_s(mp)
message *mp;
{
int r, devind, name_len, len;
@@ -295,7 +295,7 @@ message *mp;
}
}
PRIVATE void do_set_acl(mp)
static void do_set_acl(mp)
message *mp;
{
int i, r, gid;
@@ -338,7 +338,7 @@ message *mp;
reply(mp, OK);
}
PRIVATE void do_del_acl(message *mp)
static void do_del_acl(message *mp)
{
int i, proc_nr;
@@ -378,7 +378,7 @@ PRIVATE void do_del_acl(message *mp)
reply(mp, OK);
}
PRIVATE void do_reserve(message *mp)
static void do_reserve(message *mp)
{
struct rs_pci *aclp;
int r, devind;
@@ -396,7 +396,7 @@ PRIVATE void do_reserve(message *mp)
}
}
PRIVATE void do_attr_r8(mp)
static void do_attr_r8(mp)
message *mp;
{
int r, devind, port;
@@ -422,7 +422,7 @@ message *mp;
}
}
PRIVATE void do_attr_r16(mp)
static void do_attr_r16(mp)
message *mp;
{
int r, devind, port;
@@ -442,7 +442,7 @@ message *mp;
}
}
PRIVATE void do_attr_r32(mp)
static void do_attr_r32(mp)
message *mp;
{
int r, devind, port;
@@ -468,7 +468,7 @@ message *mp;
}
}
PRIVATE void do_attr_w8(mp)
static void do_attr_w8(mp)
message *mp;
{
int r, devind, port;
@@ -488,7 +488,7 @@ message *mp;
}
}
PRIVATE void do_attr_w16(mp)
static void do_attr_w16(mp)
message *mp;
{
int r, devind, port;
@@ -508,7 +508,7 @@ message *mp;
}
}
PRIVATE void do_attr_w32(mp)
static void do_attr_w32(mp)
message *mp;
{
int r, devind, port;
@@ -528,7 +528,7 @@ message *mp;
}
}
PRIVATE void do_get_bar(mp)
static void do_get_bar(mp)
message *mp;
{
int r, devind, port, ioflag;
@@ -554,7 +554,7 @@ message *mp;
}
}
PRIVATE void do_rescan_bus(mp)
static void do_rescan_bus(mp)
message *mp;
{
int r, busnr;
@@ -572,7 +572,7 @@ message *mp;
}
PRIVATE void reply(mp, result)
static void reply(mp, result)
message *mp;
int result;
{
@@ -586,7 +586,7 @@ int result;
}
PRIVATE struct rs_pci *find_acl(endpoint)
static struct rs_pci *find_acl(endpoint)
int endpoint;
{
int i;

View File

@@ -39,7 +39,7 @@ Created: Jan 2000 by Philip Homburg <philip@cs.vu.nl>
int debug= 0;
PRIVATE struct pcibus
static struct pcibus
{
int pb_type;
int pb_needinit;
@@ -57,9 +57,9 @@ PRIVATE struct pcibus
u16_t (*pb_rsts)(int busind);
void (*pb_wsts)(int busind, u16_t value);
} pcibus[NR_PCIBUS];
PRIVATE int nr_pcibus= 0;
static int nr_pcibus= 0;
PRIVATE struct pcidev
static struct pcidev
{
u8_t pd_busnr;
u8_t pd_dev;
@@ -90,68 +90,68 @@ EXTERN struct pci_acl pci_acl[NR_DRIVERS];
#define PBF_IO 1 /* I/O else memory */
#define PBF_INCOMPLETE 2 /* not allocated */
PRIVATE int nr_pcidev= 0;
static int nr_pcidev= 0;
FORWARD void pci_intel_init(void);
FORWARD void probe_bus(int busind);
FORWARD int is_duplicate(u8_t busnr, u8_t dev, u8_t func);
FORWARD void record_irq(int devind);
FORWARD void record_bars_normal(int devind);
FORWARD void record_bars_bridge(int devind);
FORWARD void record_bars_cardbus(int devind);
FORWARD void record_bars(int devind, int last_reg);
FORWARD int record_bar(int devind, int bar_nr, int last);
FORWARD void complete_bridges(void);
FORWARD void complete_bars(void);
FORWARD void update_bridge4dev_io(int devind, u32_t io_base, u32_t
static void pci_intel_init(void);
static void probe_bus(int busind);
static int is_duplicate(u8_t busnr, u8_t dev, u8_t func);
static void record_irq(int devind);
static void record_bars_normal(int devind);
static void record_bars_bridge(int devind);
static void record_bars_cardbus(int devind);
static void record_bars(int devind, int last_reg);
static int record_bar(int devind, int bar_nr, int last);
static void complete_bridges(void);
static void complete_bars(void);
static void update_bridge4dev_io(int devind, u32_t io_base, u32_t
io_size);
FORWARD int get_freebus(void);
FORWARD int do_isabridge(int busind);
FORWARD void do_pcibridge(int busind);
FORWARD int get_busind(int busnr);
FORWARD int do_piix(int devind);
FORWARD int do_amd_isabr(int devind);
FORWARD int do_sis_isabr(int devind);
FORWARD int do_via_isabr(int devind);
static int get_freebus(void);
static int do_isabridge(int busind);
static void do_pcibridge(int busind);
static int get_busind(int busnr);
static int do_piix(int devind);
static int do_amd_isabr(int devind);
static int do_sis_isabr(int devind);
static int do_via_isabr(int devind);
#if 0
FORWARD void report_vga(int devind);
static void report_vga(int devind);
#endif
FORWARD char *pci_vid_name(u16_t vid);
FORWARD char *pci_baseclass_name(u8_t baseclass);
FORWARD char *pci_subclass_name(u8_t baseclass, u8_t subclass, u8_t
static char *pci_vid_name(u16_t vid);
static char *pci_baseclass_name(u8_t baseclass);
static char *pci_subclass_name(u8_t baseclass, u8_t subclass, u8_t
infclass);
FORWARD void ntostr(unsigned n, char **str, char *end);
static void ntostr(unsigned n, char **str, char *end);
FORWARD u8_t pci_attr_r8_u(int devind, int port);
FORWARD u32_t pci_attr_r32_u(int devind, int port);
static u8_t pci_attr_r8_u(int devind, int port);
static u32_t pci_attr_r32_u(int devind, int port);
FORWARD u16_t pci_attr_rsts(int devind);
FORWARD void pci_attr_wsts(int devind, u16_t value);
FORWARD u16_t pcibr_std_rsts(int busind);
FORWARD void pcibr_std_wsts(int busind, u16_t value);
FORWARD u16_t pcibr_cb_rsts(int busind);
FORWARD void pcibr_cb_wsts(int busind, u16_t value);
FORWARD u16_t pcibr_via_rsts(int busind);
FORWARD void pcibr_via_wsts(int busind, u16_t value);
FORWARD u8_t pcii_rreg8(int busind, int devind, int port);
FORWARD u16_t pcii_rreg16(int busind, int devind, int port);
FORWARD u32_t pcii_rreg32(int busind, int devind, int port);
FORWARD void pcii_wreg8(int busind, int devind, int port, u8_t value);
FORWARD void pcii_wreg16(int busind, int devind, int port, u16_t value);
FORWARD void pcii_wreg32(int busind, int devind, int port, u32_t value);
FORWARD u16_t pcii_rsts(int busind);
FORWARD void pcii_wsts(int busind, u16_t value);
FORWARD void print_capabilities(int devind);
FORWARD int visible(struct rs_pci *aclp, int devind);
FORWARD void print_hyper_cap(int devind, u8_t capptr);
static u16_t pci_attr_rsts(int devind);
static void pci_attr_wsts(int devind, u16_t value);
static u16_t pcibr_std_rsts(int busind);
static void pcibr_std_wsts(int busind, u16_t value);
static u16_t pcibr_cb_rsts(int busind);
static void pcibr_cb_wsts(int busind, u16_t value);
static u16_t pcibr_via_rsts(int busind);
static void pcibr_via_wsts(int busind, u16_t value);
static u8_t pcii_rreg8(int busind, int devind, int port);
static u16_t pcii_rreg16(int busind, int devind, int port);
static u32_t pcii_rreg32(int busind, int devind, int port);
static void pcii_wreg8(int busind, int devind, int port, u8_t value);
static void pcii_wreg16(int busind, int devind, int port, u16_t value);
static void pcii_wreg32(int busind, int devind, int port, u32_t value);
static u16_t pcii_rsts(int busind);
static void pcii_wsts(int busind, u16_t value);
static void print_capabilities(int devind);
static int visible(struct rs_pci *aclp, int devind);
static void print_hyper_cap(int devind, u8_t capptr);
PRIVATE struct machine machine;
PRIVATE endpoint_t acpi_ep;
static struct machine machine;
static endpoint_t acpi_ep;
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PUBLIC int sef_cb_init_fresh(int type, sef_init_info_t *info)
int sef_cb_init_fresh(int type, sef_init_info_t *info)
{
/* Initialize the pci driver. */
long v;
@@ -195,7 +195,7 @@ PUBLIC int sef_cb_init_fresh(int type, sef_init_info_t *info)
/*===========================================================================*
* map_service *
*===========================================================================*/
PUBLIC int map_service(rpub)
int map_service(rpub)
struct rprocpub *rpub;
{
/* Map a new service by registering a new acl entry if required. */
@@ -229,38 +229,38 @@ struct rprocpub *rpub;
/*===========================================================================*
* helper functions for I/O *
*===========================================================================*/
PUBLIC unsigned pci_inb(u16_t port) {
unsigned pci_inb(u16_t port) {
u32_t value;
int s;
if ((s=sys_inb(port, &value)) !=OK)
printf("PCI: warning, sys_inb failed: %d\n", s);
return value;
}
PUBLIC unsigned pci_inw(u16_t port) {
unsigned pci_inw(u16_t port) {
u32_t value;
int s;
if ((s=sys_inw(port, &value)) !=OK)
printf("PCI: warning, sys_inw failed: %d\n", s);
return value;
}
PUBLIC unsigned pci_inl(u16_t port) {
unsigned pci_inl(u16_t port) {
u32_t value;
int s;
if ((s=sys_inl(port, &value)) !=OK)
printf("PCI: warning, sys_inl failed: %d\n", s);
return value;
}
PUBLIC void pci_outb(u16_t port, u8_t value) {
void pci_outb(u16_t port, u8_t value) {
int s;
if ((s=sys_outb(port, value)) !=OK)
printf("PCI: warning, sys_outb failed: %d\n", s);
}
PUBLIC void pci_outw(u16_t port, u16_t value) {
void pci_outw(u16_t port, u16_t value) {
int s;
if ((s=sys_outw(port, value)) !=OK)
printf("PCI: warning, sys_outw failed: %d\n", s);
}
PUBLIC void pci_outl(u16_t port, u32_t value) {
void pci_outl(u16_t port, u32_t value) {
int s;
if ((s=sys_outl(port, value)) !=OK)
printf("PCI: warning, sys_outl failed: %d\n", s);
@@ -269,7 +269,7 @@ PUBLIC void pci_outl(u16_t port, u32_t value) {
/*===========================================================================*
* pci_find_dev *
*===========================================================================*/
PUBLIC int pci_find_dev(u8_t bus, u8_t dev, u8_t func, int *devindp)
int pci_find_dev(u8_t bus, u8_t dev, u8_t func, int *devindp)
{
int devind;
@@ -295,7 +295,7 @@ PUBLIC int pci_find_dev(u8_t bus, u8_t dev, u8_t func, int *devindp)
/*===========================================================================*
* pci_first_dev_a *
*===========================================================================*/
PUBLIC int pci_first_dev_a(
int pci_first_dev_a(
struct rs_pci *aclp,
int *devindp,
u16_t *vidp,
@@ -325,7 +325,7 @@ PUBLIC int pci_first_dev_a(
/*===========================================================================*
* pci_next_dev *
*===========================================================================*/
PUBLIC int pci_next_dev_a(
int pci_next_dev_a(
struct rs_pci *aclp,
int *devindp,
u16_t *vidp,
@@ -355,7 +355,7 @@ PUBLIC int pci_next_dev_a(
/*===========================================================================*
* pci_reserve_a *
*===========================================================================*/
PUBLIC int pci_reserve_a(devind, proc, aclp)
int pci_reserve_a(devind, proc, aclp)
int devind;
endpoint_t proc;
struct rs_pci *aclp;
@@ -439,7 +439,7 @@ struct rs_pci *aclp;
/*===========================================================================*
* pci_release *
*===========================================================================*/
PUBLIC void pci_release(proc)
void pci_release(proc)
endpoint_t proc;
{
int i;
@@ -457,7 +457,7 @@ endpoint_t proc;
/*===========================================================================*
* pci_ids_s *
*===========================================================================*/
PUBLIC int pci_ids_s(int devind, u16_t *vidp, u16_t *didp)
int pci_ids_s(int devind, u16_t *vidp, u16_t *didp)
{
if (devind < 0 || devind >= nr_pcidev)
return EINVAL;
@@ -470,7 +470,7 @@ PUBLIC int pci_ids_s(int devind, u16_t *vidp, u16_t *didp)
/*===========================================================================*
* pci_rescan_bus *
*===========================================================================*/
PUBLIC void pci_rescan_bus(u8_t busnr)
void pci_rescan_bus(u8_t busnr)
{
int busind;
@@ -487,7 +487,7 @@ PUBLIC void pci_rescan_bus(u8_t busnr)
/*===========================================================================*
* pci_slot_name_s *
*===========================================================================*/
PUBLIC int pci_slot_name_s(devind, cpp)
int pci_slot_name_s(devind, cpp)
int devind;
char **cpp;
{
@@ -516,7 +516,7 @@ char **cpp;
/*===========================================================================*
* pci_dev_name *
*===========================================================================*/
PUBLIC char *pci_dev_name(u16_t vid, u16_t did)
char *pci_dev_name(u16_t vid, u16_t did)
{
int i;
@@ -534,7 +534,7 @@ PUBLIC char *pci_dev_name(u16_t vid, u16_t did)
/*===========================================================================*
* pci_get_bar_s *
*===========================================================================*/
PUBLIC int pci_get_bar_s(int devind, int port, u32_t *base, u32_t *size,
int pci_get_bar_s(int devind, int port, u32_t *base, u32_t *size,
int *ioflag)
{
int i, reg;
@@ -564,7 +564,7 @@ PUBLIC int pci_get_bar_s(int devind, int port, u32_t *base, u32_t *size,
/*===========================================================================*
* pci_attr_r8_s *
*===========================================================================*/
PUBLIC int pci_attr_r8_s(int devind, int port, u8_t *vp)
int pci_attr_r8_s(int devind, int port, u8_t *vp)
{
if (devind < 0 || devind >= nr_pcidev)
return EINVAL;
@@ -578,7 +578,7 @@ PUBLIC int pci_attr_r8_s(int devind, int port, u8_t *vp)
/*===========================================================================*
* pci_attr_r8_u *
*===========================================================================*/
PRIVATE u8_t pci_attr_r8_u(devind, port)
static u8_t pci_attr_r8_u(devind, port)
int devind;
int port;
{
@@ -592,7 +592,7 @@ int port;
/*===========================================================================*
* pci_attr_r16 *
*===========================================================================*/
PUBLIC u16_t pci_attr_r16(devind, port)
u16_t pci_attr_r16(devind, port)
int devind;
int port;
{
@@ -606,7 +606,7 @@ int port;
/*===========================================================================*
* pci_attr_r32_s *
*===========================================================================*/
PUBLIC int pci_attr_r32_s(int devind, int port, u32_t *vp)
int pci_attr_r32_s(int devind, int port, u32_t *vp)
{
if (devind < 0 || devind >= nr_pcidev)
return EINVAL;
@@ -620,7 +620,7 @@ PUBLIC int pci_attr_r32_s(int devind, int port, u32_t *vp)
/*===========================================================================*
* pci_attr_r32_u *
*===========================================================================*/
PRIVATE u32_t pci_attr_r32_u(devind, port)
static u32_t pci_attr_r32_u(devind, port)
int devind;
int port;
{
@@ -634,7 +634,7 @@ int port;
/*===========================================================================*
* pci_attr_w8 *
*===========================================================================*/
PUBLIC void pci_attr_w8(int devind, int port, u8_t value)
void pci_attr_w8(int devind, int port, u8_t value)
{
int busnr, busind;
@@ -646,7 +646,7 @@ PUBLIC void pci_attr_w8(int devind, int port, u8_t value)
/*===========================================================================*
* pci_attr_w16 *
*===========================================================================*/
PUBLIC void pci_attr_w16(int devind, int port, u16_t value)
void pci_attr_w16(int devind, int port, u16_t value)
{
int busnr, busind;
@@ -658,7 +658,7 @@ PUBLIC void pci_attr_w16(int devind, int port, u16_t value)
/*===========================================================================*
* pci_attr_w32 *
*===========================================================================*/
PUBLIC void pci_attr_w32(int devind, int port, u32_t value)
void pci_attr_w32(int devind, int port, u32_t value)
{
int busnr, busind;
@@ -670,7 +670,7 @@ PUBLIC void pci_attr_w32(int devind, int port, u32_t value)
/*===========================================================================*
* pci_intel_init *
*===========================================================================*/
PRIVATE void pci_intel_init()
static void pci_intel_init()
{
/* Try to detect a know PCI controller. Read the Vendor ID and
* the Device ID for function 0 of device 0.
@@ -770,7 +770,7 @@ PRIVATE void pci_intel_init()
/*===========================================================================*
* probe_bus *
*===========================================================================*/
PRIVATE void probe_bus(int busind)
static void probe_bus(int busind)
{
u32_t dev, func, t3;
u16_t vid, did, sts;
@@ -927,7 +927,7 @@ PRIVATE void probe_bus(int busind)
/*===========================================================================*
* is_duplicate *
*===========================================================================*/
PRIVATE int is_duplicate(u8_t busnr, u8_t dev, u8_t func)
static int is_duplicate(u8_t busnr, u8_t dev, u8_t func)
{
int i;
@@ -943,7 +943,7 @@ PRIVATE int is_duplicate(u8_t busnr, u8_t dev, u8_t func)
return 0;
}
PRIVATE int acpi_get_irq(unsigned bus, unsigned dev, unsigned pin)
static int acpi_get_irq(unsigned bus, unsigned dev, unsigned pin)
{
int err;
message m;
@@ -959,7 +959,7 @@ PRIVATE int acpi_get_irq(unsigned bus, unsigned dev, unsigned pin)
return ((struct acpi_get_irq_resp *)&m)->irq;
}
PRIVATE int derive_irq(struct pcidev * dev, int pin)
static int derive_irq(struct pcidev * dev, int pin)
{
struct pcidev * parent_bridge;
int slot;
@@ -979,7 +979,7 @@ PRIVATE int derive_irq(struct pcidev * dev, int pin)
/*===========================================================================*
* record_irq *
*===========================================================================*/
PRIVATE void record_irq(devind)
static void record_irq(devind)
int devind;
{
int ilr, ipr, busnr, busind, cb_devind;
@@ -1078,7 +1078,7 @@ int devind;
/*===========================================================================*
* record_bars_normal *
*===========================================================================*/
PRIVATE void record_bars_normal(devind)
static void record_bars_normal(devind)
int devind;
{
int i, j, clear_01, clear_23, pb_nr;
@@ -1142,7 +1142,7 @@ int devind;
/*===========================================================================*
* record_bars_bridge *
*===========================================================================*/
PRIVATE void record_bars_bridge(devind)
static void record_bars_bridge(devind)
int devind;
{
u32_t base, limit, size;
@@ -1194,7 +1194,7 @@ int devind;
/*===========================================================================*
* record_bars_cardbus *
*===========================================================================*/
PRIVATE void record_bars_cardbus(devind)
static void record_bars_cardbus(devind)
int devind;
{
u32_t base, limit, size;
@@ -1246,7 +1246,7 @@ int devind;
/*===========================================================================*
* record_bars *
*===========================================================================*/
PRIVATE void record_bars(int devind, int last_reg)
static void record_bars(int devind, int last_reg)
{
int i, reg, width;
@@ -1259,7 +1259,7 @@ PRIVATE void record_bars(int devind, int last_reg)
/*===========================================================================*
* record_bar *
*===========================================================================*/
PRIVATE int record_bar(devind, bar_nr, last)
static int record_bar(devind, bar_nr, last)
int devind;
int bar_nr;
int last;
@@ -1405,7 +1405,7 @@ int last;
/*===========================================================================*
* complete_bridges *
*===========================================================================*/
PRIVATE void complete_bridges()
static void complete_bridges()
{
int i, freebus, devind, prim_busnr;
@@ -1446,7 +1446,7 @@ PRIVATE void complete_bridges()
/*===========================================================================*
* complete_bars *
*===========================================================================*/
PRIVATE void complete_bars(void)
static void complete_bars(void)
{
int i, j, r, bar_nr, reg;
u32_t memgap_low, memgap_high, iogap_low, iogap_high, io_high,
@@ -1670,7 +1670,7 @@ bad_mem_string:
/*===========================================================================*
* update_bridge4dev_io *
*===========================================================================*/
PRIVATE void update_bridge4dev_io(
static void update_bridge4dev_io(
int devind,
u32_t io_base,
u32_t io_size
@@ -1710,7 +1710,7 @@ PRIVATE void update_bridge4dev_io(
/*===========================================================================*
* get_freebus *
*===========================================================================*/
PRIVATE int get_freebus()
static int get_freebus()
{
int i, freebus;
@@ -1731,7 +1731,7 @@ PRIVATE int get_freebus()
/*===========================================================================*
* do_isabridge *
*===========================================================================*/
PRIVATE int do_isabridge(busind)
static int do_isabridge(busind)
int busind;
{
int i, j, r, type, busnr, unknown_bridge, bridge_dev;
@@ -1840,7 +1840,7 @@ int busind;
* (pbnr) must be already known to acpi and it must map dev as the connection to
* the secondary (sbnr) bus
*/
PRIVATE void acpi_map_bridge(unsigned pbnr, unsigned dev, unsigned sbnr)
static void acpi_map_bridge(unsigned pbnr, unsigned dev, unsigned sbnr)
{
int err;
message m;
@@ -1861,7 +1861,7 @@ PRIVATE void acpi_map_bridge(unsigned pbnr, unsigned dev, unsigned sbnr)
/*===========================================================================*
* do_pcibridge *
*===========================================================================*/
PRIVATE void do_pcibridge(busind)
static void do_pcibridge(busind)
int busind;
{
int i, devind, busnr;
@@ -2015,7 +2015,7 @@ int busind;
/*===========================================================================*
* get_busind *
*===========================================================================*/
PRIVATE int get_busind(busnr)
static int get_busind(busnr)
int busnr;
{
int i;
@@ -2031,7 +2031,7 @@ int busnr;
/*===========================================================================*
* do_piix *
*===========================================================================*/
PRIVATE int do_piix(int devind)
static int do_piix(int devind)
{
int i, s, irqrc, irq;
u32_t elcr1, elcr2, elcr;
@@ -2075,7 +2075,7 @@ PRIVATE int do_piix(int devind)
/*===========================================================================*
* do_amd_isabr *
*===========================================================================*/
PRIVATE int do_amd_isabr(int devind)
static int do_amd_isabr(int devind)
{
int i, busnr, dev, func, xdevind, irq, edge;
u8_t levmask;
@@ -2127,7 +2127,7 @@ PRIVATE int do_amd_isabr(int devind)
/*===========================================================================*
* do_sis_isabr *
*===========================================================================*/
PRIVATE int do_sis_isabr(int devind)
static int do_sis_isabr(int devind)
{
int i, irq;
@@ -2154,7 +2154,7 @@ PRIVATE int do_sis_isabr(int devind)
/*===========================================================================*
* do_via_isabr *
*===========================================================================*/
PRIVATE int do_via_isabr(int devind)
static int do_via_isabr(int devind)
{
int i, irq, edge;
u8_t levmask;
@@ -2212,7 +2212,7 @@ PRIVATE int do_via_isabr(int devind)
/*===========================================================================*
* report_vga *
*===========================================================================*/
PRIVATE void report_vga(devind)
static void report_vga(devind)
int devind;
{
/* Report the amount of video memory. This is needed by the X11R6
@@ -2247,7 +2247,7 @@ int devind;
/*===========================================================================*
* pci_vid_name *
*===========================================================================*/
PRIVATE char *pci_vid_name(u16_t vid)
static char *pci_vid_name(u16_t vid)
{
int i;
@@ -2262,7 +2262,7 @@ PRIVATE char *pci_vid_name(u16_t vid)
/*===========================================================================*
* pci_baseclass_name *
*===========================================================================*/
PRIVATE char *pci_baseclass_name(u8_t baseclass)
static char *pci_baseclass_name(u8_t baseclass)
{
int i;
@@ -2277,7 +2277,7 @@ PRIVATE char *pci_baseclass_name(u8_t baseclass)
/*===========================================================================*
* pci_subclass_name *
*===========================================================================*/
PRIVATE char *pci_subclass_name(u8_t baseclass, u8_t subclass, u8_t infclass)
static char *pci_subclass_name(u8_t baseclass, u8_t subclass, u8_t infclass)
{
int i;
@@ -2300,7 +2300,7 @@ PRIVATE char *pci_subclass_name(u8_t baseclass, u8_t subclass, u8_t infclass)
/*===========================================================================*
* ntostr *
*===========================================================================*/
PRIVATE void ntostr(n, str, end)
static void ntostr(n, str, end)
unsigned n;
char **str;
char *end;
@@ -2339,7 +2339,7 @@ char *end;
/*===========================================================================*
* pci_attr_rsts *
*===========================================================================*/
PRIVATE u16_t pci_attr_rsts(devind)
static u16_t pci_attr_rsts(devind)
int devind;
{
int busnr, busind;
@@ -2353,7 +2353,7 @@ int devind;
/*===========================================================================*
* pcibr_std_rsts *
*===========================================================================*/
PRIVATE u16_t pcibr_std_rsts(busind)
static u16_t pcibr_std_rsts(busind)
int busind;
{
int devind;
@@ -2365,7 +2365,7 @@ int busind;
/*===========================================================================*
* pcibr_std_wsts *
*===========================================================================*/
PRIVATE void pcibr_std_wsts(int busind, u16_t value)
static void pcibr_std_wsts(int busind, u16_t value)
{
int devind;
devind= pcibus[busind].pb_devind;
@@ -2380,7 +2380,7 @@ PRIVATE void pcibr_std_wsts(int busind, u16_t value)
/*===========================================================================*
* pcibr_cb_rsts *
*===========================================================================*/
PRIVATE u16_t pcibr_cb_rsts(busind)
static u16_t pcibr_cb_rsts(busind)
int busind;
{
int devind;
@@ -2392,7 +2392,7 @@ int busind;
/*===========================================================================*
* pcibr_cb_wsts *
*===========================================================================*/
PRIVATE void pcibr_cb_wsts(int busind, u16_t value)
static void pcibr_cb_wsts(int busind, u16_t value)
{
int devind;
devind= pcibus[busind].pb_devind;
@@ -2407,7 +2407,7 @@ PRIVATE void pcibr_cb_wsts(int busind, u16_t value)
/*===========================================================================*
* pcibr_via_rsts *
*===========================================================================*/
PRIVATE u16_t pcibr_via_rsts(int busind)
static u16_t pcibr_via_rsts(int busind)
{
return 0;
}
@@ -2415,7 +2415,7 @@ PRIVATE u16_t pcibr_via_rsts(int busind)
/*===========================================================================*
* pcibr_via_wsts *
*===========================================================================*/
PRIVATE void pcibr_via_wsts(int busind, u16_t value)
static void pcibr_via_wsts(int busind, u16_t value)
{
int devind;
devind= pcibus[busind].pb_devind;
@@ -2429,7 +2429,7 @@ PRIVATE void pcibr_via_wsts(int busind, u16_t value)
/*===========================================================================*
* pci_attr_wsts *
*===========================================================================*/
PRIVATE void pci_attr_wsts(int devind, u16_t value)
static void pci_attr_wsts(int devind, u16_t value)
{
int busnr, busind;
@@ -2442,7 +2442,7 @@ PRIVATE void pci_attr_wsts(int devind, u16_t value)
/*===========================================================================*
* pcii_rreg8 *
*===========================================================================*/
PRIVATE u8_t pcii_rreg8(busind, devind, port)
static u8_t pcii_rreg8(busind, devind, port)
int busind;
int devind;
int port;
@@ -2467,7 +2467,7 @@ int port;
/*===========================================================================*
* pcii_rreg16 *
*===========================================================================*/
PRIVATE u16_t pcii_rreg16(int busind, int devind, int port)
static u16_t pcii_rreg16(int busind, int devind, int port)
{
u16_t v;
int s;
@@ -2489,7 +2489,7 @@ PRIVATE u16_t pcii_rreg16(int busind, int devind, int port)
/*===========================================================================*
* pcii_rreg32 *
*===========================================================================*/
PRIVATE u32_t pcii_rreg32(int busind, int devind, int port)
static u32_t pcii_rreg32(int busind, int devind, int port)
{
u32_t v;
int s;
@@ -2511,7 +2511,7 @@ PRIVATE u32_t pcii_rreg32(int busind, int devind, int port)
/*===========================================================================*
* pcii_wreg8 *
*===========================================================================*/
PRIVATE void pcii_wreg8(
static void pcii_wreg8(
int busind,
int devind,
int port,
@@ -2535,7 +2535,7 @@ PRIVATE void pcii_wreg8(
/*===========================================================================*
* pcii_wreg16 *
*===========================================================================*/
PRIVATE void pcii_wreg16(
static void pcii_wreg16(
int busind,
int devind,
int port,
@@ -2559,7 +2559,7 @@ PRIVATE void pcii_wreg16(
/*===========================================================================*
* pcii_wreg32 *
*===========================================================================*/
PRIVATE void pcii_wreg32(
static void pcii_wreg32(
int busind,
int devind,
int port,
@@ -2583,7 +2583,7 @@ PRIVATE void pcii_wreg32(
/*===========================================================================*
* pcii_rsts *
*===========================================================================*/
PRIVATE u16_t pcii_rsts(int busind)
static u16_t pcii_rsts(int busind)
{
u16_t v;
int s;
@@ -2597,7 +2597,7 @@ PRIVATE u16_t pcii_rsts(int busind)
/*===========================================================================*
* pcii_wsts *
*===========================================================================*/
PRIVATE void pcii_wsts(int busind, u16_t value)
static void pcii_wsts(int busind, u16_t value)
{
int s;
PCII_WREG16_(pcibus[busind].pb_busnr, 0, 0, PCI_SR, value);
@@ -2609,7 +2609,7 @@ PRIVATE void pcii_wsts(int busind, u16_t value)
/*===========================================================================*
* print_capabilities *
*===========================================================================*/
PRIVATE void print_capabilities(int devind)
static void print_capabilities(int devind)
{
u8_t status, capptr, type, next, subtype;
char *str;
@@ -2661,7 +2661,7 @@ PRIVATE void print_capabilities(int devind)
/*===========================================================================*
* visible *
*===========================================================================*/
PRIVATE int visible(aclp, devind)
static int visible(aclp, devind)
struct rs_pci *aclp;
int devind;
{
@@ -2703,7 +2703,7 @@ int devind;
/*===========================================================================*
* print_hyper_cap *
*===========================================================================*/
PRIVATE void print_hyper_cap(int devind, u8_t capptr)
static void print_hyper_cap(int devind, u8_t capptr)
{
u32_t v;
u16_t cmd;

View File

@@ -11,7 +11,7 @@ EXTERN int is_status_msg_expected;
/*===========================================================================*
* sef_cb_lu_prepare *
*===========================================================================*/
PUBLIC int sef_cb_lu_prepare(int state)
int sef_cb_lu_prepare(int state)
{
int is_ready;
@@ -40,7 +40,7 @@ PUBLIC int sef_cb_lu_prepare(int state)
/*===========================================================================*
* sef_cb_lu_state_isvalid *
*===========================================================================*/
PUBLIC int sef_cb_lu_state_isvalid(int state)
int sef_cb_lu_state_isvalid(int state)
{
return SEF_LU_STATE_IS_STANDARD(state) || PR_STATE_IS_CUSTOM(state);
}
@@ -48,7 +48,7 @@ PUBLIC int sef_cb_lu_state_isvalid(int state)
/*===========================================================================*
* sef_cb_lu_state_dump *
*===========================================================================*/
PUBLIC void sef_cb_lu_state_dump(int state)
void sef_cb_lu_state_dump(int state)
{
sef_lu_dprint("printer: live update state = %d\n", state);
sef_lu_dprint("printer: writing = %d\n", writing);

View File

@@ -86,44 +86,44 @@
* with the sys_outb() messages exchanged.
*/
PRIVATE endpoint_t caller; /* process to tell when printing done (FS) */
PRIVATE int revive_pending; /* set to true if revive is pending */
PRIVATE int revive_status; /* revive status */
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 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 endpoint_t proc_nr; /* user requesting the printing */
PRIVATE cp_grant_id_t grant_nr; /* grant on which print happens */
PRIVATE int user_left; /* bytes of output left in user buf */
PRIVATE vir_bytes user_vir_d; /* offset in user buf */
PUBLIC int writing; /* nonzero while write is in progress */
PRIVATE int irq_hook_id; /* id of irq hook at kernel */
static endpoint_t caller; /* process to tell when printing done (FS) */
static int revive_pending; /* set to true if revive is pending */
static int revive_status; /* revive status */
static int done_status; /* status of last output completion */
static int oleft; /* bytes of output left in obuf */
static unsigned char obuf[128]; /* output buffer */
static unsigned const char *optr; /* ptr to next char in obuf to print */
static int orig_count; /* original byte count */
static int port_base; /* I/O port for printer */
static endpoint_t proc_nr; /* user requesting the printing */
static cp_grant_id_t grant_nr; /* grant on which print happens */
static int user_left; /* bytes of output left in user buf */
static vir_bytes user_vir_d; /* offset in user buf */
int writing; /* nonzero while write is in progress */
static int irq_hook_id; /* id of irq hook at kernel */
FORWARD void do_cancel(message *m_ptr);
FORWARD void output_done(void);
FORWARD void do_write(message *m_ptr);
FORWARD void do_status(message *m_ptr);
FORWARD void prepare_output(void);
FORWARD int do_probe(void);
FORWARD void do_initialize(void);
FORWARD void reply(int code,int replyee,int proc,int status);
FORWARD void do_printer_output(void);
static void do_cancel(message *m_ptr);
static void output_done(void);
static void do_write(message *m_ptr);
static void do_status(message *m_ptr);
static void prepare_output(void);
static int do_probe(void);
static void do_initialize(void);
static void reply(int code,int replyee,int proc,int status);
static void do_printer_output(void);
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
EXTERN int sef_cb_lu_prepare(int state);
EXTERN int sef_cb_lu_state_isvalid(int state);
EXTERN void sef_cb_lu_state_dump(int state);
PUBLIC int is_status_msg_expected = FALSE;
int is_status_msg_expected = FALSE;
/*===========================================================================*
* printer_task *
*===========================================================================*/
PUBLIC int main(void)
int main(void)
{
/* Main routine of the printer task. */
message pr_mess; /* buffer for all incoming messages */
@@ -169,7 +169,7 @@ PUBLIC int main(void)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -191,7 +191,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize the printer driver. */
@@ -208,7 +208,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
/*===========================================================================*
* do_write *
*===========================================================================*/
PRIVATE void do_write(m_ptr)
static void do_write(m_ptr)
register message *m_ptr; /* pointer to the newly arrived message */
{
/* The printer is used by sending DEV_WRITE messages to it. Process one. */
@@ -260,7 +260,7 @@ register message *m_ptr; /* pointer to the newly arrived message */
/*===========================================================================*
* output_done *
*===========================================================================*/
PRIVATE void output_done()
static void output_done()
{
/* Previous chunk of printing is finished. Continue if OK and more.
* Otherwise, reply to caller (FS).
@@ -300,7 +300,7 @@ PRIVATE void output_done()
/*===========================================================================*
* do_status *
*===========================================================================*/
PRIVATE void do_status(m_ptr)
static void do_status(m_ptr)
register message *m_ptr; /* pointer to the newly arrived message */
{
if (revive_pending) {
@@ -322,7 +322,7 @@ register message *m_ptr; /* pointer to the newly arrived message */
/*===========================================================================*
* do_cancel *
*===========================================================================*/
PRIVATE void do_cancel(m_ptr)
static void do_cancel(m_ptr)
register message *m_ptr; /* pointer to the newly arrived message */
{
/* Cancel a print request that has already started. Usually this means that
@@ -342,7 +342,7 @@ register message *m_ptr; /* pointer to the newly arrived message */
/*===========================================================================*
* reply *
*===========================================================================*/
PRIVATE void reply(code, replyee, process, status)
static void reply(code, replyee, process, status)
int code; /* TASK_REPLY or REVIVE */
int replyee; /* destination for message (normally FS) */
int process; /* which user requested the printing */
@@ -361,7 +361,7 @@ int status; /* number of chars printed or error code */
/*===========================================================================*
* do_probe *
*===========================================================================*/
PRIVATE int do_probe(void)
static int do_probe(void)
{
/* See if there is a printer at all. */
@@ -378,7 +378,7 @@ PRIVATE int do_probe(void)
/*===========================================================================*
* do_initialize *
*===========================================================================*/
PRIVATE void do_initialize()
static void do_initialize()
{
/* Set global variables and initialize the printer. */
static int initialized = FALSE;
@@ -404,7 +404,7 @@ PRIVATE void do_initialize()
/*==========================================================================*
* prepare_output *
*==========================================================================*/
PRIVATE void prepare_output()
static void prepare_output()
{
/* Start next chunk of printer output. Fetch the data from user space. */
int s;
@@ -427,7 +427,7 @@ PRIVATE void prepare_output()
/*===========================================================================*
* do_printer_output *
*===========================================================================*/
PRIVATE void do_printer_output()
static void do_printer_output()
{
/* This function does the actual output to the printer. This is called on an
* interrupt message sent from the generic interrupt handler that 'forwards'

View File

@@ -15,21 +15,21 @@
#define KRANDOM_PERIOD 1 /* ticks between krandom calls */
PRIVATE struct device m_geom[NR_DEVS]; /* base and size of each device */
PRIVATE dev_t m_device; /* current device */
static struct device m_geom[NR_DEVS]; /* base and size of each device */
static dev_t m_device; /* current device */
extern int errno; /* error number for PM calls */
FORWARD struct device *r_prepare(dev_t device);
FORWARD int r_transfer(endpoint_t endpt, int opcode, u64_t position,
static struct device *r_prepare(dev_t device);
static int r_transfer(endpoint_t endpt, int opcode, u64_t position,
iovec_t *iov, unsigned int nr_req, endpoint_t user_endpt, unsigned int
flags);
FORWARD int r_do_open(message *m_ptr);
FORWARD void r_random(message *m_ptr);
FORWARD void r_updatebin(int source, struct k_randomness_bin *rb);
static int r_do_open(message *m_ptr);
static void r_random(message *m_ptr);
static void r_updatebin(int source, struct k_randomness_bin *rb);
/* Entry points to this driver. */
PRIVATE struct chardriver r_dtab = {
static struct chardriver r_dtab = {
r_do_open, /* open or mount */
do_nop, /* nothing on a close */
nop_ioctl, /* no I/O controls supported */
@@ -44,16 +44,16 @@ PRIVATE struct chardriver r_dtab = {
/* Buffer for the /dev/random number generator. */
#define RANDOM_BUF_SIZE 1024
PRIVATE char random_buf[RANDOM_BUF_SIZE];
static char random_buf[RANDOM_BUF_SIZE];
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
/*===========================================================================*
* main *
*===========================================================================*/
PUBLIC int main(void)
int main(void)
{
/* SEF local startup. */
sef_local_startup();
@@ -67,7 +67,7 @@ PUBLIC int main(void)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -85,7 +85,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize the random driver. */
static struct k_randomness krandom;
@@ -122,7 +122,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
/*===========================================================================*
* r_prepare *
*===========================================================================*/
PRIVATE struct device *r_prepare(dev_t device)
static struct device *r_prepare(dev_t device)
{
/* Prepare for I/O on a device: check if the minor device number is ok. */
@@ -135,7 +135,7 @@ PRIVATE struct device *r_prepare(dev_t device)
/*===========================================================================*
* r_transfer *
*===========================================================================*/
PRIVATE int r_transfer(
static int r_transfer(
endpoint_t endpt, /* endpoint of grant owner */
int opcode, /* DEV_GATHER or DEV_SCATTER */
u64_t position, /* offset on device to read or write */
@@ -212,7 +212,7 @@ PRIVATE int r_transfer(
/*===========================================================================*
* r_do_open *
*===========================================================================*/
PRIVATE int r_do_open(message *m_ptr)
static int r_do_open(message *m_ptr)
{
/* Check device number on open.
*/
@@ -239,7 +239,7 @@ PRIVATE int r_do_open(message *m_ptr)
/*===========================================================================*
* r_updatebin *
*===========================================================================*/
PRIVATE void r_updatebin(int source, struct k_randomness_bin *rb)
static void r_updatebin(int source, struct k_randomness_bin *rb)
{
int r_next, r_size, r_high;
@@ -265,7 +265,7 @@ PRIVATE void r_updatebin(int source, struct k_randomness_bin *rb)
/*===========================================================================*
* r_random *
*===========================================================================*/
PRIVATE void r_random(message *UNUSED(m_ptr))
static void r_random(message *UNUSED(m_ptr))
{
/* Fetch random information from the kernel to update /dev/random. */
int s;

View File

@@ -25,20 +25,20 @@ that data into a seed for a psuedo random number generator.
* re-seed.
*/
PRIVATE unsigned long deriv[TOTAL_SOURCES][N_DERIV];
PRIVATE int pool_ind[TOTAL_SOURCES];
PRIVATE SHA256_CTX pool_ctx[NR_POOLS];
PRIVATE unsigned samples= 0;
PRIVATE int got_seeded= 0;
PRIVATE u8_t random_key[2*AES_BLOCKSIZE];
PRIVATE u32_t count_lo, count_hi;
PRIVATE u32_t reseed_count;
static unsigned long deriv[TOTAL_SOURCES][N_DERIV];
static int pool_ind[TOTAL_SOURCES];
static SHA256_CTX pool_ctx[NR_POOLS];
static unsigned samples= 0;
static int got_seeded= 0;
static u8_t random_key[2*AES_BLOCKSIZE];
static u32_t count_lo, count_hi;
static u32_t reseed_count;
FORWARD void add_sample(int source, unsigned long sample);
FORWARD void data_block(rd_keyinstance *keyp, void *data);
FORWARD void reseed(void);
static void add_sample(int source, unsigned long sample);
static void data_block(rd_keyinstance *keyp, void *data);
static void reseed(void);
PUBLIC void random_init()
void random_init()
{
int i, j;
@@ -58,14 +58,14 @@ PUBLIC void random_init()
reseed_count= 0;
}
PUBLIC int random_isseeded()
int random_isseeded()
{
if (got_seeded)
return 1;
return 0;
}
PUBLIC void random_update(source, buf, count)
void random_update(source, buf, count)
int source;
rand_t *buf;
int count;
@@ -82,7 +82,7 @@ int count;
reseed();
}
PUBLIC void random_getbytes(buf, size)
void random_getbytes(buf, size)
void *buf;
size_t size;
{
@@ -116,7 +116,7 @@ size_t size;
data_block(&key, random_key+AES_BLOCKSIZE);
}
PUBLIC void random_putbytes(buf, size)
void random_putbytes(buf, size)
void *buf;
size_t size;
{
@@ -131,7 +131,7 @@ size_t size;
reseed();
}
PRIVATE void add_sample(source, sample)
static void add_sample(source, sample)
int source;
unsigned long sample;
{
@@ -182,7 +182,7 @@ unsigned long sample;
pool_ind[source]= pool_nr;
}
PRIVATE void data_block(keyp, data)
static void data_block(keyp, data)
rd_keyinstance *keyp;
void *data;
{
@@ -207,7 +207,7 @@ void *data;
count_hi++;
}
PRIVATE void reseed()
static void reseed()
{
int i;
SHA256_CTX ctx;

View File

@@ -83,7 +83,7 @@ int dec_to_bcd(int n);
void usage(void);
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
static void sef_local_startup(void);
int main(int argc, char **argv)
{
@@ -201,7 +201,7 @@ int main(int argc, char **argv)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Let SEF perform startup. */
sef_startup();

View File

@@ -10,10 +10,10 @@ EXTERN re_t re_state;
((s) >= RL_STATE_READ_PROTOCOL_FREE && (s) <= RL_STATE_WRITE_PROTOCOL_FREE)
/* State management helpers. */
PRIVATE int is_reading;
PRIVATE int is_writing;
static int is_reading;
static int is_writing;
PRIVATE void load_state_info(void)
static void load_state_info(void)
{
re_t *rep;
@@ -27,7 +27,7 @@ PRIVATE void load_state_info(void)
/*===========================================================================*
* sef_cb_lu_prepare *
*===========================================================================*/
PUBLIC int sef_cb_lu_prepare(int state)
int sef_cb_lu_prepare(int state)
{
int is_ready;
@@ -63,7 +63,7 @@ PUBLIC int sef_cb_lu_prepare(int state)
/*===========================================================================*
* sef_cb_lu_state_isvalid *
*===========================================================================*/
PUBLIC int sef_cb_lu_state_isvalid(int state)
int sef_cb_lu_state_isvalid(int state)
{
return SEF_LU_STATE_IS_STANDARD(state) || RL_STATE_IS_CUSTOM(state);
}
@@ -71,7 +71,7 @@ PUBLIC int sef_cb_lu_state_isvalid(int state)
/*===========================================================================*
* sef_cb_lu_state_dump *
*===========================================================================*/
PUBLIC void sef_cb_lu_state_dump(int state)
void sef_cb_lu_state_dump(int state)
{
/* Load state information. */
load_state_info();

View File

@@ -16,7 +16,7 @@
#include "rtl8139.h"
PUBLIC re_t re_state;
re_t re_state;
static int re_instance;
@@ -98,15 +98,15 @@ static void tell_dev(vir_bytes start, size_t size, int pci_bus, int
/* The message used in the main loop is made global, so that rl_watchdog_f()
* can change its message type to fake an interrupt message.
*/
PRIVATE message m;
PRIVATE int int_event_check; /* set to TRUE if events arrived */
static message m;
static int int_event_check; /* set to TRUE if events arrived */
PRIVATE u32_t system_hz;
static u32_t system_hz;
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
FORWARD void sef_cb_signal_handler(int signo);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_cb_signal_handler(int signo);
EXTERN int sef_cb_lu_prepare(int state);
EXTERN int sef_cb_lu_state_isvalid(int state);
EXTERN void sef_cb_lu_state_dump(int state);
@@ -178,7 +178,7 @@ int main(int argc, char *argv[])
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -200,7 +200,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the rtl8139 driver. */
long v;
@@ -233,7 +233,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
re_t *rep;
@@ -2231,7 +2231,7 @@ dpeth_t *dep;
}
#endif
PRIVATE void tell_dev(buf, size, pci_bus, pci_dev, pci_func)
static void tell_dev(buf, size, pci_bus, pci_dev, pci_func)
vir_bytes buf;
size_t size;
int pci_bus;

View File

@@ -232,15 +232,15 @@ static void rl_watchdog_f(timer_t *tp);
* The message used in the main loop is made global, so that rl_watchdog_f()
* can change its message type to fake an interrupt message.
*/
PRIVATE message m;
PRIVATE int int_event_check; /* set to TRUE if events arrived */
static message m;
static int int_event_check; /* set to TRUE if events arrived */
u32_t system_hz;
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
FORWARD void sef_cb_signal_handler(int signo);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_cb_signal_handler(int signo);
/*===========================================================================*
* main *
@@ -303,7 +303,7 @@ int main(int argc, char *argv[])
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -324,7 +324,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
{
/* Initialize the rtl8169 driver. */
long v;
@@ -347,7 +347,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
re_t *rep;

View File

@@ -16,7 +16,7 @@ Created: Dec 2005 by Philip Homburg
/* The use of interrupts is not yet ready for prime time */
#define USE_INTS 0
PRIVATE struct port
static struct port
{
int p_devind;
u8_t p_cb_busnr;
@@ -28,16 +28,16 @@ PRIVATE struct port
volatile struct csr *csr_ptr;
} port;
PRIVATE int instance;
PRIVATE int debug;
static int instance;
static int debug;
FORWARD int hw_probe(int skip);
FORWARD void hw_init(struct port *pp, int devind);
FORWARD void do_int(struct port *pp);
static int hw_probe(int skip);
static void hw_init(struct port *pp, int devind);
static void do_int(struct port *pp);
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
/*===========================================================================*
* main *
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -84,7 +84,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize the ti1225 driver. */
int r, devind;
@@ -114,7 +114,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
/*===========================================================================*
* hw_probe *
*===========================================================================*/
PRIVATE int hw_probe(int skip)
static int hw_probe(int skip)
{
u16_t vid, did;
int devind;
@@ -139,7 +139,7 @@ PRIVATE int hw_probe(int skip)
/*===========================================================================*
* hw_init *
*===========================================================================*/
PRIVATE void hw_init(struct port *pp, int devind)
static void hw_init(struct port *pp, int devind)
{
u8_t v8;
u16_t v16;
@@ -247,7 +247,7 @@ PRIVATE void hw_init(struct port *pp, int devind)
/*===========================================================================*
* do_int *
*===========================================================================*/
PRIVATE void do_int(struct port *pp)
static void do_int(struct port *pp)
{
int devind, vcc_5v, vcc_3v, vcc_Xv, vcc_Yv,
socket_5v, socket_3v, socket_Xv, socket_Yv;

View File

@@ -38,33 +38,33 @@
#define TIMER_FREQ 1193182L /* clock frequency for timer in PC and AT */
/* Global variables used by the console driver and assembly support. */
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 */
static phys_bytes vid_size; /* 0x2000 for color or 0x0800 for mono */
static phys_bytes vid_base;
static unsigned vid_mask; /* 0x1FFF for color or 0x07FF for mono */
static 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 */
PRIVATE int wrap; /* hardware can wrap? */
PRIVATE int softscroll; /* 1 = software scrolling, 0 = hardware */
PRIVATE int beeping; /* speaker is beeping? */
PRIVATE unsigned font_lines; /* font lines per character */
PRIVATE unsigned scr_width; /* # characters on a line */
PRIVATE unsigned scr_lines; /* # lines on the screen */
PRIVATE unsigned scr_size; /* # characters on the screen */
static int vid_port; /* I/O port for accessing 6845 */
static int wrap; /* hardware can wrap? */
static int softscroll; /* 1 = software scrolling, 0 = hardware */
static int beeping; /* speaker is beeping? */
static unsigned font_lines; /* font lines per character */
static unsigned scr_width; /* # characters on a line */
static unsigned scr_lines; /* # lines on the screen */
static unsigned scr_size; /* # characters on the screen */
/* tells mem_vid_copy() to blank the screen */
#define BLANK_MEM ((vir_bytes) 0)
PRIVATE int disabled_vc = -1; /* Virtual console that was active when
static int disabled_vc = -1; /* Virtual console that was active when
* disable_console was called.
*/
PRIVATE int disabled_sm; /* Scroll mode to be restored when re-enabling
static int disabled_sm; /* Scroll mode to be restored when re-enabling
* console
*/
PRIVATE char *console_memory = NULL;
PRIVATE char *font_memory = NULL;
static char *console_memory = NULL;
static char *font_memory = NULL;
/* Per console data. */
typedef struct console {
@@ -99,17 +99,17 @@ typedef struct console {
set_6845(VID_ORG, ccons->c_org); \
}
PRIVATE int nr_cons= 1; /* actual number of consoles */
PRIVATE console_t cons_table[NR_CONS];
PRIVATE console_t *curcons = NULL; /* currently visible */
static int nr_cons= 1; /* actual number of consoles */
static console_t cons_table[NR_CONS];
static console_t *curcons = NULL; /* currently visible */
PRIVATE int shutting_down = FALSE; /* don't allow console switches */
static int shutting_down = FALSE; /* don't allow console switches */
/* Color if using a color controller. */
#define color (vid_port == C_6845)
/* Map from ANSI colors to the attributes used by the PC */
PRIVATE int ansi_colors[8] = {0, 4, 2, 6, 1, 5, 3, 7};
static int ansi_colors[8] = {0, 4, 2, 6, 1, 5, 3, 7};
/* Structure used for font management */
struct sequence {
@@ -118,33 +118,33 @@ struct sequence {
unsigned char value;
};
FORWARD int cons_write(struct tty *tp, int try);
FORWARD void cons_echo(tty_t *tp, int c);
FORWARD void out_char(console_t *cons, int c);
FORWARD void cons_putk(int c);
FORWARD void beep(void);
FORWARD void do_escape(console_t *cons, int c);
FORWARD void flush(console_t *cons);
FORWARD void parse_escape(console_t *cons, int c);
FORWARD void scroll_screen(console_t *cons, int dir);
FORWARD void set_6845(int reg, unsigned val);
FORWARD void stop_beep(timer_t *tmrp);
FORWARD void cons_org0(void);
FORWARD void disable_console(void);
FORWARD void reenable_console(void);
FORWARD int ga_program(struct sequence *seq);
FORWARD int cons_ioctl(tty_t *tp, int);
FORWARD void mem_vid_copy(vir_bytes src, int dst, int count);
FORWARD void vid_vid_copy(int src, int dst, int count);
static int cons_write(struct tty *tp, int try);
static void cons_echo(tty_t *tp, int c);
static void out_char(console_t *cons, int c);
static void cons_putk(int c);
static void beep(void);
static void do_escape(console_t *cons, int c);
static void flush(console_t *cons);
static void parse_escape(console_t *cons, int c);
static void scroll_screen(console_t *cons, int dir);
static void set_6845(int reg, unsigned val);
static void stop_beep(timer_t *tmrp);
static void cons_org0(void);
static void disable_console(void);
static void reenable_console(void);
static int ga_program(struct sequence *seq);
static int cons_ioctl(tty_t *tp, int);
static void mem_vid_copy(vir_bytes src, int dst, int count);
static void vid_vid_copy(int src, int dst, int count);
#if 0
FORWARD void get_6845(int reg, unsigned *val);
static void get_6845(int reg, unsigned *val);
#endif
/*===========================================================================*
* cons_write *
*===========================================================================*/
PRIVATE int cons_write(tp, try)
static int cons_write(tp, try)
register struct tty *tp; /* tells which terminal is to be used */
int try;
{
@@ -222,7 +222,7 @@ int try;
/*===========================================================================*
* cons_echo *
*===========================================================================*/
PRIVATE void cons_echo(tp, c)
static void cons_echo(tp, c)
register tty_t *tp; /* pointer to tty struct */
int c; /* character to be echoed */
{
@@ -236,7 +236,7 @@ int c; /* character to be echoed */
/*===========================================================================*
* out_char *
*===========================================================================*/
PRIVATE void out_char(cons, c)
static void out_char(cons, c)
register console_t *cons; /* pointer to console struct */
int c; /* character to be output */
{
@@ -331,7 +331,7 @@ int c; /* character to be output */
/*===========================================================================*
* scroll_screen *
*===========================================================================*/
PRIVATE void scroll_screen(cons, dir)
static void scroll_screen(cons, dir)
register console_t *cons; /* pointer to console struct */
int dir; /* SCROLL_UP or SCROLL_DOWN */
{
@@ -383,7 +383,7 @@ int dir; /* SCROLL_UP or SCROLL_DOWN */
/*===========================================================================*
* flush *
*===========================================================================*/
PRIVATE void flush(cons)
static void flush(cons)
register console_t *cons; /* pointer to console struct */
{
/* Send characters buffered in 'ramqueue' to screen memory, check the new
@@ -415,7 +415,7 @@ register console_t *cons; /* pointer to console struct */
/*===========================================================================*
* parse_escape *
*===========================================================================*/
PRIVATE void parse_escape(cons, c)
static void parse_escape(cons, c)
register console_t *cons; /* pointer to console struct */
char c; /* next character in escape sequence */
{
@@ -474,7 +474,7 @@ char c; /* next character in escape sequence */
/*===========================================================================*
* do_escape *
*===========================================================================*/
PRIVATE void do_escape(cons, c)
static void do_escape(cons, c)
register console_t *cons; /* pointer to console struct */
char c; /* next character in escape sequence */
{
@@ -716,7 +716,7 @@ char c; /* next character in escape sequence */
/*===========================================================================*
* set_6845 *
*===========================================================================*/
PRIVATE void set_6845(reg, val)
static void set_6845(reg, val)
int reg; /* which register pair to set */
unsigned val; /* 16-bit value to set it to */
{
@@ -736,7 +736,7 @@ unsigned val; /* 16-bit value to set it to */
/*===========================================================================*
* get_6845 *
*===========================================================================*/
PRIVATE void get_6845(reg, val)
static void get_6845(reg, val)
int reg; /* which register pair to set */
unsigned *val; /* 16-bit value to set it to */
{
@@ -756,7 +756,7 @@ unsigned *val; /* 16-bit value to set it to */
/*===========================================================================*
* beep *
*===========================================================================*/
PRIVATE void beep()
static void beep()
{
/* Making a beeping sound on the speaker (output for CRTL-G).
* This routine works by turning on the bits 0 and 1 in port B of the 8255
@@ -786,7 +786,7 @@ PRIVATE void beep()
/*===========================================================================*
* do_video *
*===========================================================================*/
PUBLIC void do_video(message *m)
void do_video(message *m)
{
int r;
@@ -861,7 +861,7 @@ PUBLIC void do_video(message *m)
/*===========================================================================*
* beep_x *
*===========================================================================*/
PUBLIC void beep_x(freq, dur)
void beep_x(freq, dur)
unsigned freq;
clock_t dur;
{
@@ -896,7 +896,7 @@ clock_t dur;
/*===========================================================================*
* stop_beep *
*===========================================================================*/
PRIVATE void stop_beep(timer_t *UNUSED(tmrp))
static void stop_beep(timer_t *UNUSED(tmrp))
{
/* Turn off the beeper by turning off bits 0 and 1 in PORT_B. */
u32_t port_b_val;
@@ -908,7 +908,7 @@ PRIVATE void stop_beep(timer_t *UNUSED(tmrp))
/*===========================================================================*
* scr_init *
*===========================================================================*/
PUBLIC void scr_init(tp)
void scr_init(tp)
tty_t *tp;
{
/* Initialize the screen driver. */
@@ -1010,7 +1010,7 @@ tty_t *tp;
/*===========================================================================*
* do_new_kmess *
*===========================================================================*/
PUBLIC void do_new_kmess()
void do_new_kmess()
{
/* Notification for a new kernel message. */
static struct kmessages kmess; /* kmessages structure */
@@ -1057,7 +1057,7 @@ PUBLIC void do_new_kmess()
/*===========================================================================*
* cons_putk *
*===========================================================================*/
PRIVATE void cons_putk(c)
static void cons_putk(c)
int c; /* character to print */
{
/* This procedure is used to print a character on the console.
@@ -1076,7 +1076,7 @@ int c; /* character to print */
/*===========================================================================*
* toggle_scroll *
*===========================================================================*/
PUBLIC void toggle_scroll()
void toggle_scroll()
{
/* Toggle between hardware and software scroll. */
@@ -1088,7 +1088,7 @@ PUBLIC void toggle_scroll()
/*===========================================================================*
* cons_stop *
*===========================================================================*/
PUBLIC void cons_stop()
void cons_stop()
{
/* Prepare for halt or reboot. */
cons_org0();
@@ -1101,7 +1101,7 @@ PUBLIC void cons_stop()
/*===========================================================================*
* cons_org0 *
*===========================================================================*/
PRIVATE void cons_org0()
static void cons_org0()
{
/* Scroll video memory back to put the origin at 0. */
int cons_line;
@@ -1125,7 +1125,7 @@ PRIVATE void cons_org0()
/*===========================================================================*
* disable_console *
*===========================================================================*/
PRIVATE void disable_console()
static void disable_console()
{
if (disabled_vc != -1)
return;
@@ -1143,7 +1143,7 @@ PRIVATE void disable_console()
/*===========================================================================*
* reenable_console *
*===========================================================================*/
PRIVATE void reenable_console()
static void reenable_console()
{
if (disabled_vc == -1)
return;
@@ -1156,7 +1156,7 @@ PRIVATE void reenable_console()
/*===========================================================================*
* select_console *
*===========================================================================*/
PUBLIC void select_console(int cons_line)
void select_console(int cons_line)
{
/* Set the current console to console number 'cons_line'. */
@@ -1174,7 +1174,7 @@ PUBLIC void select_console(int cons_line)
/*===========================================================================*
* con_loadfont *
*===========================================================================*/
PUBLIC int con_loadfont(m)
int con_loadfont(m)
message *m;
{
@@ -1217,7 +1217,7 @@ message *m;
/*===========================================================================*
* ga_program *
*===========================================================================*/
PRIVATE int ga_program(seq)
static int ga_program(seq)
struct sequence *seq;
{
pvb_pair_t char_out[14];
@@ -1233,7 +1233,7 @@ struct sequence *seq;
/*===========================================================================*
* cons_ioctl *
*===========================================================================*/
PRIVATE int cons_ioctl(tty_t *tp, int UNUSED(try))
static int cons_ioctl(tty_t *tp, int UNUSED(try))
{
/* Set the screen dimensions. */
@@ -1254,7 +1254,7 @@ PRIVATE int cons_ioctl(tty_t *tp, int UNUSED(try))
/*===========================================================================*
* mem_vid_copy *
*===========================================================================*/
PRIVATE void mem_vid_copy(vir_bytes src, int dst_index, int count)
static void mem_vid_copy(vir_bytes src, int dst_index, int count)
{
u16_t *src_mem = (u16_t *) src;
while(count > 0) {
@@ -1276,7 +1276,7 @@ PRIVATE void mem_vid_copy(vir_bytes src, int dst_index, int count)
/*===========================================================================*
* vid_vid_copy *
*===========================================================================*/
PRIVATE void vid_vid_copy(int src_index, int dst_index, int count)
static void vid_vid_copy(int src_index, int dst_index, int count)
{
int backwards = 0;
if(src_index < dst_index)

View File

@@ -25,16 +25,16 @@
#include "kernel/type.h"
#include "kernel/proc.h"
PRIVATE u16_t keymap[NR_SCAN_CODES * MAP_COLS] = {
static u16_t keymap[NR_SCAN_CODES * MAP_COLS] = {
#include "keymaps/us-std.src"
};
PRIVATE u16_t keymap_escaped[NR_SCAN_CODES * MAP_COLS] = {
static u16_t keymap_escaped[NR_SCAN_CODES * MAP_COLS] = {
#include "keymaps/us-std-esc.src"
};
PRIVATE int irq_hook_id = -1;
PRIVATE int aux_irq_hook_id = -1;
static int irq_hook_id = -1;
static 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 */
@@ -76,31 +76,31 @@ PRIVATE int aux_irq_hook_id = -1;
#define CONSOLE 0 /* line number for console */
#define KB_IN_BYTES 32 /* size of keyboard input buffer */
PRIVATE char injbuf[KB_IN_BYTES];
PRIVATE char *injhead = injbuf;
PRIVATE char *injtail = injbuf;
PRIVATE int injcount;
static char injbuf[KB_IN_BYTES];
static char *injhead = injbuf;
static char *injtail = injbuf;
static int injcount;
PRIVATE char ibuf[KB_IN_BYTES]; /* input buffer */
PRIVATE char *ihead = ibuf; /* next free spot in input buffer */
PRIVATE char *itail = ibuf; /* scan code to return to TTY */
PRIVATE int icount; /* # codes in buffer */
static char ibuf[KB_IN_BYTES]; /* input buffer */
static char *ihead = ibuf; /* next free spot in input buffer */
static char *itail = ibuf; /* scan code to return to TTY */
static int icount; /* # codes in buffer */
PRIVATE int esc; /* escape scan code detected? */
PRIVATE int alt_l; /* left alt key state */
PRIVATE int alt_r; /* right alt key state */
PRIVATE int alt; /* either alt key */
PRIVATE int ctrl_l; /* left control key state */
PRIVATE int ctrl_r; /* right control key state */
PRIVATE int ctrl; /* either control key */
PRIVATE int shift_l; /* left shift key state */
PRIVATE int shift_r; /* right shift key state */
PRIVATE int shift; /* either shift key */
PRIVATE int num_down; /* num lock key depressed */
PRIVATE int caps_down; /* caps lock key depressed */
PRIVATE int scroll_down; /* scroll lock key depressed */
PRIVATE int alt_down; /* alt key depressed */
PRIVATE int locks[NR_CONS]; /* per console lock keys state */
static int esc; /* escape scan code detected? */
static int alt_l; /* left alt key state */
static int alt_r; /* right alt key state */
static int alt; /* either alt key */
static int ctrl_l; /* left control key state */
static int ctrl_r; /* right control key state */
static int ctrl; /* either control key */
static int shift_l; /* left shift key state */
static int shift_r; /* right shift key state */
static int shift; /* either shift key */
static int num_down; /* num lock key depressed */
static int caps_down; /* caps lock key depressed */
static int scroll_down; /* scroll lock key depressed */
static int alt_down; /* alt key depressed */
static int locks[NR_CONS]; /* per console lock keys state */
/* Lock key active bits. Chosen to be equal to the keyboard LED bits. */
#define SCROLL_LOCK 0x01
@@ -108,19 +108,19 @@ PRIVATE int locks[NR_CONS]; /* per console lock keys state */
#define CAPS_LOCK 0x04
#define ALT_LOCK 0x08
PRIVATE char numpad_map[12] =
static char numpad_map[12] =
{'H', 'Y', 'A', 'B', 'D', 'C', 'V', 'U', 'G', 'S', 'T', '@'};
PRIVATE char *fkey_map[12] =
static char *fkey_map[12] =
{"11", "12", "13", "14", "15", "17", /* F1-F6 */
"18", "19", "20", "21", "23", "24"}; /* F7-F12 */
/* Variables and definition for observed function keys. */
typedef struct observer { int proc_nr; int events; } obs_t;
PRIVATE obs_t fkey_obs[12]; /* observers for F1-F12 */
PRIVATE obs_t sfkey_obs[12]; /* observers for SHIFT F1-F12 */
static obs_t fkey_obs[12]; /* observers for F1-F12 */
static obs_t sfkey_obs[12]; /* observers for SHIFT F1-F12 */
PRIVATE struct kbd
static struct kbd
{
int minor;
int nr_open;
@@ -139,7 +139,7 @@ PRIVATE struct kbd
/* Data that is to be sent to the keyboard. Each byte is ACKed by the
* keyboard.
*/
PRIVATE struct kbd_outack
static struct kbd_outack
{
unsigned char buf[KBD_OUT_BUFSZ];
int offset;
@@ -147,28 +147,28 @@ PRIVATE struct kbd_outack
int expect_ack;
} kbdout;
PRIVATE int kbd_watchdog_set= 0;
PRIVATE int kbd_alive= 1;
PRIVATE long sticky_alt_mode = 0;
PRIVATE long debug_fkeys = 1;
PRIVATE timer_t tmr_kbd_wd;
static int kbd_watchdog_set= 0;
static int kbd_alive= 1;
static long sticky_alt_mode = 0;
static long debug_fkeys = 1;
static timer_t tmr_kbd_wd;
FORWARD void handle_req(struct kbd *kbdp, message *m);
FORWARD int handle_status(struct kbd *kbdp, message *m);
FORWARD void kbc_cmd0(int cmd);
FORWARD void kbc_cmd1(int cmd, int data);
FORWARD int kbc_read(void);
FORWARD void kbd_send(void);
FORWARD int kb_ack(void);
FORWARD int kb_wait(void);
FORWARD int func_key(int scode);
FORWARD int scan_keyboard(unsigned char *bp, int *isauxp);
FORWARD unsigned make_break(int scode);
FORWARD void set_leds(void);
FORWARD void show_key_mappings(void);
FORWARD int kb_read(struct tty *tp, int try);
FORWARD unsigned map_key(int scode);
FORWARD void kbd_watchdog(timer_t *tmrp);
static void handle_req(struct kbd *kbdp, message *m);
static int handle_status(struct kbd *kbdp, message *m);
static void kbc_cmd0(int cmd);
static void kbc_cmd1(int cmd, int data);
static int kbc_read(void);
static void kbd_send(void);
static int kb_ack(void);
static int kb_wait(void);
static int func_key(int scode);
static int scan_keyboard(unsigned char *bp, int *isauxp);
static unsigned make_break(int scode);
static void set_leds(void);
static void show_key_mappings(void);
static int kb_read(struct tty *tp, int try);
static unsigned map_key(int scode);
static void kbd_watchdog(timer_t *tmrp);
int micro_delay(u32_t usecs)
{
@@ -180,7 +180,7 @@ int micro_delay(u32_t usecs)
/*===========================================================================*
* do_kbd *
*===========================================================================*/
PUBLIC void do_kbd(message *m)
void do_kbd(message *m)
{
handle_req(&kbd, m);
}
@@ -189,7 +189,7 @@ PUBLIC void do_kbd(message *m)
/*===========================================================================*
* kbd_status *
*===========================================================================*/
PUBLIC int kbd_status(message *m)
int kbd_status(message *m)
{
int r;
@@ -203,7 +203,7 @@ PUBLIC int kbd_status(message *m)
/*===========================================================================*
* do_kbdaux *
*===========================================================================*/
PUBLIC void do_kbdaux(message *m)
void do_kbdaux(message *m)
{
handle_req(&kbdaux, m);
}
@@ -212,7 +212,7 @@ PUBLIC void do_kbdaux(message *m)
/*===========================================================================*
* handle_req *
*===========================================================================*/
PRIVATE void handle_req(kbdp, m)
static void handle_req(kbdp, m)
struct kbd *kbdp;
message *m;
{
@@ -393,7 +393,7 @@ message *m;
/*===========================================================================*
* handle_status *
*===========================================================================*/
PRIVATE int handle_status(kbdp, m)
static int handle_status(kbdp, m)
struct kbd *kbdp;
message *m;
{
@@ -443,7 +443,7 @@ message *m;
/*===========================================================================*
* map_key *
*===========================================================================*/
PRIVATE unsigned map_key(scode)
static unsigned map_key(scode)
int scode;
{
/* Map a scan code to an ASCII code. */
@@ -481,7 +481,7 @@ int scode;
/*===========================================================================*
* kbd_interrupt *
*===========================================================================*/
PUBLIC void kbd_interrupt(message *UNUSED(m_ptr))
void kbd_interrupt(message *UNUSED(m_ptr))
{
/* A keyboard interrupt has occurred. Process it. */
int o, isaux;
@@ -534,7 +534,7 @@ PUBLIC void kbd_interrupt(message *UNUSED(m_ptr))
}
PUBLIC void do_kb_inject(message *msg)
void do_kb_inject(message *msg)
{
unsigned char scode;
/* only handle keyboard events */
@@ -561,7 +561,7 @@ PUBLIC void do_kb_inject(message *msg)
/*===========================================================================*
* kb_read *
*===========================================================================*/
PRIVATE int kb_read(tp, try)
static int kb_read(tp, try)
tty_t *tp;
int try;
{
@@ -673,7 +673,7 @@ int try;
/*===========================================================================*
* kbd_send *
*===========================================================================*/
PRIVATE void kbd_send()
static void kbd_send()
{
u32_t sb;
int r;
@@ -725,7 +725,7 @@ PRIVATE void kbd_send()
/*===========================================================================*
* make_break *
*===========================================================================*/
PRIVATE unsigned make_break(scode)
static unsigned make_break(scode)
int scode; /* scan code of key just struck or released */
{
/* This routine can handle keyboards that interrupt only on key depression,
@@ -833,7 +833,7 @@ int scode; /* scan code of key just struck or released */
/*===========================================================================*
* set_leds *
*===========================================================================*/
PRIVATE void set_leds()
static void set_leds()
{
/* Set the LEDs on the caps, num, and scroll lock keys */
int s;
@@ -854,7 +854,7 @@ PRIVATE void set_leds()
/*===========================================================================*
* kbc_cmd0 *
*===========================================================================*/
PRIVATE void kbc_cmd0(cmd)
static void kbc_cmd0(cmd)
int cmd;
{
kb_wait();
@@ -865,7 +865,7 @@ int cmd;
/*===========================================================================*
* kbc_cmd1 *
*===========================================================================*/
PRIVATE void kbc_cmd1(cmd, data)
static void kbc_cmd1(cmd, data)
int cmd;
int data;
{
@@ -881,7 +881,7 @@ int data;
/*===========================================================================*
* kbc_read *
*===========================================================================*/
PRIVATE int kbc_read()
static int kbc_read()
{
int i;
u32_t byte, st;
@@ -929,7 +929,7 @@ PRIVATE int kbc_read()
/*===========================================================================*
* kb_wait *
*===========================================================================*/
PRIVATE int kb_wait()
static int kb_wait()
{
/* Wait until the controller is ready; return zero if this times out. */
@@ -960,7 +960,7 @@ PRIVATE int kb_wait()
/*===========================================================================*
* kb_ack *
*===========================================================================*/
PRIVATE int kb_ack()
static int kb_ack()
{
/* Wait until kbd acknowledges last command; return zero if this times out. */
@@ -982,7 +982,7 @@ PRIVATE int kb_ack()
/*===========================================================================*
* kb_init *
*===========================================================================*/
PUBLIC void kb_init(tp)
void kb_init(tp)
tty_t *tp;
{
/* Initialize the keyboard driver. */
@@ -993,7 +993,7 @@ tty_t *tp;
/*===========================================================================*
* kb_init_once *
*===========================================================================*/
PUBLIC void kb_init_once(void)
void kb_init_once(void)
{
int i;
u8_t ccb;
@@ -1053,7 +1053,7 @@ PUBLIC void kb_init_once(void)
/*===========================================================================*
* kbd_loadmap *
*===========================================================================*/
PUBLIC int kbd_loadmap(m)
int kbd_loadmap(m)
message *m;
{
/* Load a new keymap. */
@@ -1064,7 +1064,7 @@ message *m;
/*===========================================================================*
* do_fkey_ctl *
*===========================================================================*/
PUBLIC void do_fkey_ctl(m_ptr)
void do_fkey_ctl(m_ptr)
message *m_ptr; /* pointer to the request message */
{
/* This procedure allows processes to register a function key to receive
@@ -1165,7 +1165,7 @@ message *m_ptr; /* pointer to the request message */
/*===========================================================================*
* func_key *
*===========================================================================*/
PRIVATE int func_key(scode)
static int func_key(scode)
int scode; /* scan code for a function key */
{
/* This procedure traps function keys for debugging purposes. Observers of
@@ -1210,7 +1210,7 @@ int scode; /* scan code for a function key */
/*===========================================================================*
* show_key_mappings *
*===========================================================================*/
PRIVATE void show_key_mappings()
static void show_key_mappings()
{
int i,s;
struct proc proc;
@@ -1249,7 +1249,7 @@ PRIVATE void show_key_mappings()
/*===========================================================================*
* scan_keyboard *
*===========================================================================*/
PRIVATE int scan_keyboard(bp, isauxp)
static int scan_keyboard(bp, isauxp)
unsigned char *bp;
int *isauxp;
{
@@ -1294,7 +1294,7 @@ int *isauxp;
/*===========================================================================*
* kbd_watchdog *
*===========================================================================*/
PRIVATE void kbd_watchdog(timer_t *UNUSED(tmrp))
static void kbd_watchdog(timer_t *UNUSED(tmrp))
{
kbd_watchdog_set= 0;

View File

@@ -65,22 +65,22 @@ typedef struct pty {
#define TTY_CLOSED 0x02 /* tty side has closed down */
#define PTY_CLOSED 0x04 /* pty side has closed down */
PRIVATE pty_t pty_table[NR_PTYS]; /* PTY bookkeeping */
static pty_t pty_table[NR_PTYS]; /* PTY bookkeeping */
FORWARD int pty_write(tty_t *tp, int try);
FORWARD void pty_echo(tty_t *tp, int c);
FORWARD void pty_start(pty_t *pp);
FORWARD void pty_finish(pty_t *pp);
FORWARD int pty_read(tty_t *tp, int try);
FORWARD int pty_close(tty_t *tp, int try);
FORWARD int pty_icancel(tty_t *tp, int try);
FORWARD int pty_ocancel(tty_t *tp, int try);
FORWARD int pty_select(tty_t *tp, message *m);
static int pty_write(tty_t *tp, int try);
static void pty_echo(tty_t *tp, int c);
static void pty_start(pty_t *pp);
static void pty_finish(pty_t *pp);
static int pty_read(tty_t *tp, int try);
static int pty_close(tty_t *tp, int try);
static int pty_icancel(tty_t *tp, int try);
static int pty_ocancel(tty_t *tp, int try);
static int pty_select(tty_t *tp, message *m);
/*===========================================================================*
* do_pty *
*===========================================================================*/
PUBLIC void do_pty(tty_t *tp, message *m_ptr)
void do_pty(tty_t *tp, message *m_ptr)
{
/* Perform an open/close/read/write call on a /dev/ptypX device. */
pty_t *pp = tp->tty_priv;
@@ -194,7 +194,7 @@ PUBLIC void do_pty(tty_t *tp, message *m_ptr)
/*===========================================================================*
* pty_write *
*===========================================================================*/
PRIVATE int pty_write(tty_t *tp, int try)
static int pty_write(tty_t *tp, int try)
{
/* (*dev_write)() routine for PTYs. Transfer bytes from the writer on
* /dev/ttypX to the output buffer.
@@ -270,7 +270,7 @@ PRIVATE int pty_write(tty_t *tp, int try)
/*===========================================================================*
* pty_echo *
*===========================================================================*/
PRIVATE void pty_echo(tty_t *tp, int c)
static void pty_echo(tty_t *tp, int c)
{
/* Echo one character. (Like pty_write, but only one character, optionally.) */
@@ -293,7 +293,7 @@ PRIVATE void pty_echo(tty_t *tp, int c)
/*===========================================================================*
* pty_start *
*===========================================================================*/
PRIVATE void pty_start(pty_t *pp)
static void pty_start(pty_t *pp)
{
/* Transfer bytes written to the output buffer to the PTY reader. */
int count;
@@ -324,7 +324,7 @@ PRIVATE void pty_start(pty_t *pp)
/*===========================================================================*
* pty_finish *
*===========================================================================*/
PRIVATE void pty_finish(pty_t *pp)
static void pty_finish(pty_t *pp)
{
/* Finish the read request of a PTY reader if there is at least one byte
* transferred.
@@ -343,7 +343,7 @@ PRIVATE void pty_finish(pty_t *pp)
/*===========================================================================*
* pty_read *
*===========================================================================*/
PRIVATE int pty_read(tty_t *tp, int try)
static int pty_read(tty_t *tp, int try)
{
/* Offer bytes from the PTY writer for input on the TTY. (Do it one byte at
* a time, 99% of the writes will be for one byte, so no sense in being smart.)
@@ -405,7 +405,7 @@ PRIVATE int pty_read(tty_t *tp, int try)
/*===========================================================================*
* pty_close *
*===========================================================================*/
PRIVATE int pty_close(tty_t *tp, int UNUSED(try))
static int pty_close(tty_t *tp, int UNUSED(try))
{
/* The tty side has closed, so shut down the pty side. */
pty_t *pp = tp->tty_priv;
@@ -430,7 +430,7 @@ PRIVATE int pty_close(tty_t *tp, int UNUSED(try))
/*===========================================================================*
* pty_icancel *
*===========================================================================*/
PRIVATE int pty_icancel(tty_t *tp, int UNUSED(try))
static int pty_icancel(tty_t *tp, int UNUSED(try))
{
/* Discard waiting input. */
pty_t *pp = tp->tty_priv;
@@ -447,7 +447,7 @@ PRIVATE int pty_icancel(tty_t *tp, int UNUSED(try))
/*===========================================================================*
* pty_ocancel *
*===========================================================================*/
PRIVATE int pty_ocancel(tty_t *tp, int UNUSED(try))
static int pty_ocancel(tty_t *tp, int UNUSED(try))
{
/* Drain the output buffer. */
pty_t *pp = tp->tty_priv;
@@ -461,7 +461,7 @@ PRIVATE int pty_ocancel(tty_t *tp, int UNUSED(try))
/*===========================================================================*
* pty_init *
*===========================================================================*/
PUBLIC void pty_init(tty_t *tp)
void pty_init(tty_t *tp)
{
pty_t *pp;
int line;
@@ -488,7 +488,7 @@ PUBLIC void pty_init(tty_t *tp)
/*===========================================================================*
* pty_status *
*===========================================================================*/
PUBLIC int pty_status(message *m_ptr)
int pty_status(message *m_ptr)
{
int i, event_found;
pty_t *pp;
@@ -541,7 +541,7 @@ PUBLIC int pty_status(message *m_ptr)
/*===========================================================================*
* select_try_pty *
*===========================================================================*/
PRIVATE int select_try_pty(tty_t *tp, int ops)
static int select_try_pty(tty_t *tp, int ops)
{
pty_t *pp = tp->tty_priv;
int r = 0;
@@ -566,7 +566,7 @@ PRIVATE int select_try_pty(tty_t *tp, int ops)
/*===========================================================================*
* select_retry_pty *
*===========================================================================*/
PUBLIC void select_retry_pty(tty_t *tp)
void select_retry_pty(tty_t *tp)
{
pty_t *pp = tp->tty_priv;
int r;
@@ -582,7 +582,7 @@ PUBLIC void select_retry_pty(tty_t *tp)
/*===========================================================================*
* pty_select *
*===========================================================================*/
PRIVATE int pty_select(tty_t *tp, message *m)
static int pty_select(tty_t *tp, message *m)
{
pty_t *pp = tp->tty_priv;
int ops, ready_ops = 0, watch;

View File

@@ -166,11 +166,11 @@ typedef struct rs232 {
char obuf[RS_OBUFSIZE]; /* output buffer */
} rs232_t;
PRIVATE rs232_t rs_lines[NR_RS_LINES];
static rs232_t rs_lines[NR_RS_LINES];
#if (MACHINE == IBM_PC)
/* 8250 base addresses. */
PRIVATE port_t addr_8250[] = {
static port_t addr_8250[] = {
0x3F8, /* COM1 */
0x2F8, /* COM2 */
0x3E8, /* COM3 */
@@ -178,27 +178,27 @@ PRIVATE port_t addr_8250[] = {
};
#endif
FORWARD void in_int(rs232_t *rs);
FORWARD void line_int(rs232_t *rs);
FORWARD void modem_int(rs232_t *rs);
FORWARD int rs_write(tty_t *tp, int try);
FORWARD void rs_echo(tty_t *tp, int c);
FORWARD int rs_ioctl(tty_t *tp, int try);
FORWARD void rs_config(rs232_t *rs);
FORWARD int rs_read(tty_t *tp, int try);
FORWARD int rs_icancel(tty_t *tp, int try);
FORWARD int rs_ocancel(tty_t *tp, int try);
FORWARD void rs_ostart(rs232_t *rs);
FORWARD int rs_break(tty_t *tp, int try);
FORWARD int rs_close(tty_t *tp, int try);
FORWARD void out_int(rs232_t *rs);
FORWARD void rs232_handler(rs232_t *rs);
static void in_int(rs232_t *rs);
static void line_int(rs232_t *rs);
static void modem_int(rs232_t *rs);
static int rs_write(tty_t *tp, int try);
static void rs_echo(tty_t *tp, int c);
static int rs_ioctl(tty_t *tp, int try);
static void rs_config(rs232_t *rs);
static int rs_read(tty_t *tp, int try);
static int rs_icancel(tty_t *tp, int try);
static int rs_ocancel(tty_t *tp, int try);
static void rs_ostart(rs232_t *rs);
static int rs_break(tty_t *tp, int try);
static int rs_close(tty_t *tp, int try);
static void out_int(rs232_t *rs);
static void rs232_handler(rs232_t *rs);
/* XXX */
PRIVATE void lock(void) {}
PRIVATE void unlock(void) {}
static void lock(void) {}
static void unlock(void) {}
PRIVATE int my_inb(port_t port)
static int my_inb(port_t port)
{
int r;
u32_t v = 0;
@@ -212,7 +212,7 @@ PRIVATE int my_inb(port_t port)
/*===========================================================================*
* rs_write *
*===========================================================================*/
PRIVATE int rs_write(register tty_t *tp, int try)
static int rs_write(register tty_t *tp, int try)
{
/* (*devwrite)() routine for RS232. */
@@ -297,7 +297,7 @@ PRIVATE int rs_write(register tty_t *tp, int try)
/*===========================================================================*
* rs_echo *
*===========================================================================*/
PRIVATE void rs_echo(tp, c)
static void rs_echo(tp, c)
tty_t *tp; /* which TTY */
int c; /* character to echo */
{
@@ -324,7 +324,7 @@ int c; /* character to echo */
/*===========================================================================*
* rs_ioctl *
*===========================================================================*/
PRIVATE int rs_ioctl(tty_t *tp, int UNUSED(dummy))
static int rs_ioctl(tty_t *tp, int UNUSED(dummy))
/* tp; which TTY */
{
/* Reconfigure the line as soon as the output has drained. */
@@ -337,7 +337,7 @@ PRIVATE int rs_ioctl(tty_t *tp, int UNUSED(dummy))
/*===========================================================================*
* rs_config *
*===========================================================================*/
PRIVATE void rs_config(rs232_t *rs)
static void rs_config(rs232_t *rs)
/* rs which line */
{
/* Set various line control parameters for RS232 I/O.
@@ -423,7 +423,7 @@ PRIVATE void rs_config(rs232_t *rs)
/*===========================================================================*
* rs_init *
*===========================================================================*/
PUBLIC void rs_init(tty_t *tp)
void rs_init(tty_t *tp)
/* tp which TTY */
{
u32_t dummy;
@@ -527,7 +527,7 @@ PUBLIC void rs_init(tty_t *tp)
/*===========================================================================*
* rs_interrupt *
*===========================================================================*/
PUBLIC void rs_interrupt(message *m)
void rs_interrupt(message *m)
{
unsigned long irq_set;
int i;
@@ -544,7 +544,7 @@ PUBLIC void rs_interrupt(message *m)
/*===========================================================================*
* rs_icancel *
*===========================================================================*/
PRIVATE int rs_icancel(tty_t *tp, int UNUSED(dummy))
static int rs_icancel(tty_t *tp, int UNUSED(dummy))
{
/* Cancel waiting input. */
rs232_t *rs = tp->tty_priv;
@@ -561,7 +561,7 @@ PRIVATE int rs_icancel(tty_t *tp, int UNUSED(dummy))
/*===========================================================================*
* rs_ocancel *
*===========================================================================*/
PRIVATE int rs_ocancel(tty_t *tp, int UNUSED(dummy))
static int rs_ocancel(tty_t *tp, int UNUSED(dummy))
{
/* Cancel pending output. */
rs232_t *rs = tp->tty_priv;
@@ -578,7 +578,7 @@ PRIVATE int rs_ocancel(tty_t *tp, int UNUSED(dummy))
/*===========================================================================*
* rs_read *
*===========================================================================*/
PRIVATE int rs_read(tty_t *tp, int try)
static int rs_read(tty_t *tp, int try)
{
/* Process characters from the circular input buffer. */
@@ -625,7 +625,7 @@ PRIVATE int rs_read(tty_t *tp, int try)
/*===========================================================================*
* rs_ostart *
*===========================================================================*/
PRIVATE void rs_ostart(rs232_t *rs)
static void rs_ostart(rs232_t *rs)
{
/* Tell RS232 there is something waiting in the output buffer. */
@@ -636,7 +636,7 @@ PRIVATE void rs_ostart(rs232_t *rs)
/*===========================================================================*
* rs_break *
*===========================================================================*/
PRIVATE int rs_break(tty_t *tp, int UNUSED(dummy))
static int rs_break(tty_t *tp, int UNUSED(dummy))
{
/* Generate a break condition by setting the BREAK bit for 0.4 sec. */
rs232_t *rs = tp->tty_priv;
@@ -654,7 +654,7 @@ PRIVATE int rs_break(tty_t *tp, int UNUSED(dummy))
/*===========================================================================*
* rs_close *
*===========================================================================*/
PRIVATE int rs_close(tty_t *tp, int UNUSED(dummy))
static int rs_close(tty_t *tp, int UNUSED(dummy))
{
/* The line is closed; optionally hang up. */
rs232_t *rs = tp->tty_priv;
@@ -670,7 +670,7 @@ PRIVATE int rs_close(tty_t *tp, int UNUSED(dummy))
/*===========================================================================*
* rs232_handler *
*===========================================================================*/
PRIVATE void rs232_handler(struct rs232 *rs)
static void rs232_handler(struct rs232 *rs)
{
/* Interrupt hander for RS232. */
@@ -703,7 +703,7 @@ PRIVATE void rs232_handler(struct rs232 *rs)
/*===========================================================================*
* in_int *
*===========================================================================*/
PRIVATE void in_int(register rs232_t *rs)
static void in_int(register rs232_t *rs)
/* rs line with input interrupt */
{
/* Read the data which just arrived.
@@ -751,7 +751,7 @@ PRIVATE void in_int(register rs232_t *rs)
/*===========================================================================*
* line_int *
*===========================================================================*/
PRIVATE void line_int(register rs232_t *rs)
static void line_int(register rs232_t *rs)
/* rs line with line status interrupt */
{
/* Check for and record errors. */
@@ -768,7 +768,7 @@ PRIVATE void line_int(register rs232_t *rs)
/*===========================================================================*
* modem_int *
*===========================================================================*/
PRIVATE void modem_int(register rs232_t *rs)
static void modem_int(register rs232_t *rs)
/* rs line with modem interrupt */
{
/* Get possibly new device-ready status, and clear ODEVREADY if necessary.
@@ -792,7 +792,7 @@ PRIVATE void modem_int(register rs232_t *rs)
/*===========================================================================*
* out_int *
*===========================================================================*/
PRIVATE void out_int(register rs232_t *rs)
static void out_int(register rs232_t *rs)
/* rs; line with output interrupt */
{
/* If there is output to do and everything is ready, do it (local device is

View File

@@ -101,28 +101,28 @@ unsigned long rs_irq_set = 0;
struct kmessages kmess;
FORWARD void tty_timed_out(timer_t *tp);
FORWARD void settimer(tty_t *tty_ptr, int enable);
FORWARD void do_cancel(tty_t *tp, message *m_ptr);
FORWARD void do_ioctl(tty_t *tp, message *m_ptr);
FORWARD void do_open(tty_t *tp, message *m_ptr);
FORWARD void do_close(tty_t *tp, message *m_ptr);
FORWARD void do_read(tty_t *tp, message *m_ptr);
FORWARD void do_write(tty_t *tp, message *m_ptr);
FORWARD void do_select(tty_t *tp, message *m_ptr);
FORWARD void do_status(message *m_ptr);
FORWARD void in_transfer(tty_t *tp);
FORWARD int tty_echo(tty_t *tp, int ch);
FORWARD void rawecho(tty_t *tp, int ch);
FORWARD int back_over(tty_t *tp);
FORWARD void reprint(tty_t *tp);
FORWARD void dev_ioctl(tty_t *tp);
FORWARD void setattr(tty_t *tp);
FORWARD void tty_icancel(tty_t *tp);
FORWARD void tty_init(void);
static void tty_timed_out(timer_t *tp);
static void settimer(tty_t *tty_ptr, int enable);
static void do_cancel(tty_t *tp, message *m_ptr);
static void do_ioctl(tty_t *tp, message *m_ptr);
static void do_open(tty_t *tp, message *m_ptr);
static void do_close(tty_t *tp, message *m_ptr);
static void do_read(tty_t *tp, message *m_ptr);
static void do_write(tty_t *tp, message *m_ptr);
static void do_select(tty_t *tp, message *m_ptr);
static void do_status(message *m_ptr);
static void in_transfer(tty_t *tp);
static int tty_echo(tty_t *tp, int ch);
static void rawecho(tty_t *tp, int ch);
static int back_over(tty_t *tp);
static void reprint(tty_t *tp);
static void dev_ioctl(tty_t *tp);
static void setattr(tty_t *tp);
static void tty_icancel(tty_t *tp);
static void tty_init(void);
/* Default attributes. */
PRIVATE struct termios termios_defaults = {
static struct termios termios_defaults = {
TINPUT_DEF, TOUTPUT_DEF, TCTRL_DEF, TLOCAL_DEF, TSPEED_DEF, TSPEED_DEF,
{
TEOF_DEF, TEOL_DEF, TERASE_DEF, TINTR_DEF, TKILL_DEF, TMIN_DEF,
@@ -130,23 +130,23 @@ PRIVATE struct termios termios_defaults = {
TREPRINT_DEF, TLNEXT_DEF, TDISCARD_DEF,
},
};
PRIVATE struct winsize winsize_defaults; /* = all zeroes */
static struct winsize winsize_defaults; /* = all zeroes */
/* Global variables for the TTY task (declared extern in tty.h). */
PUBLIC tty_t tty_table[NR_CONS+NR_RS_LINES+NR_PTYS];
PUBLIC int ccurrent; /* currently active console */
PUBLIC struct machine machine; /* kernel environment variables */
PUBLIC u32_t system_hz;
tty_t tty_table[NR_CONS+NR_RS_LINES+NR_PTYS];
int ccurrent; /* currently active console */
struct machine machine; /* kernel environment variables */
u32_t system_hz;
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
FORWARD void sef_cb_signal_handler(int signo);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_cb_signal_handler(int signo);
/*===========================================================================*
* tty_task *
*===========================================================================*/
PUBLIC int main(void)
int main(void)
{
/* Main routine of the terminal task. */
@@ -291,7 +291,7 @@ PUBLIC int main(void)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -309,7 +309,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize the tty driver. */
int r;
@@ -331,7 +331,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
/* Check for known signals, ignore anything else. */
switch(signo) {
@@ -349,7 +349,7 @@ PRIVATE void sef_cb_signal_handler(int signo)
/*===========================================================================*
* do_status *
*===========================================================================*/
PRIVATE void do_status(m_ptr)
static void do_status(m_ptr)
message *m_ptr;
{
register struct tty *tp;
@@ -436,7 +436,7 @@ message *m_ptr;
/*===========================================================================*
* do_read *
*===========================================================================*/
PRIVATE void do_read(tp, m_ptr)
static void do_read(tp, m_ptr)
register tty_t *tp; /* pointer to tty struct */
register message *m_ptr; /* pointer to message sent to the task */
{
@@ -503,7 +503,7 @@ register message *m_ptr; /* pointer to message sent to the task */
/*===========================================================================*
* do_write *
*===========================================================================*/
PRIVATE void do_write(tp, m_ptr)
static void do_write(tp, m_ptr)
register tty_t *tp;
register message *m_ptr; /* pointer to message sent to the task */
{
@@ -544,7 +544,7 @@ register message *m_ptr; /* pointer to message sent to the task */
/*===========================================================================*
* do_ioctl *
*===========================================================================*/
PRIVATE void do_ioctl(tp, m_ptr)
static void do_ioctl(tp, m_ptr)
register tty_t *tp;
message *m_ptr; /* pointer to message sent to task */
{
@@ -704,7 +704,7 @@ message *m_ptr; /* pointer to message sent to task */
/*===========================================================================*
* do_open *
*===========================================================================*/
PRIVATE void do_open(tp, m_ptr)
static void do_open(tp, m_ptr)
register tty_t *tp;
message *m_ptr; /* pointer to message sent to task */
{
@@ -730,7 +730,7 @@ message *m_ptr; /* pointer to message sent to task */
/*===========================================================================*
* do_close *
*===========================================================================*/
PRIVATE void do_close(tp, m_ptr)
static void do_close(tp, m_ptr)
register tty_t *tp;
message *m_ptr; /* pointer to message sent to task */
{
@@ -751,7 +751,7 @@ message *m_ptr; /* pointer to message sent to task */
/*===========================================================================*
* do_cancel *
*===========================================================================*/
PRIVATE void do_cancel(tp, m_ptr)
static void do_cancel(tp, m_ptr)
register tty_t *tp;
message *m_ptr; /* pointer to message sent to task */
{
@@ -787,7 +787,7 @@ message *m_ptr; /* pointer to message sent to task */
tty_reply(TASK_REPLY, m_ptr->m_source, proc_nr, r);
}
PUBLIC int select_try(struct tty *tp, int ops)
int select_try(struct tty *tp, int ops)
{
int ready_ops = 0;
@@ -821,7 +821,7 @@ PUBLIC int select_try(struct tty *tp, int ops)
return ready_ops;
}
PUBLIC int select_retry(struct tty *tp)
int select_retry(struct tty *tp)
{
if (tp->tty_select_ops && select_try(tp, tp->tty_select_ops))
notify(tp->tty_select_proc);
@@ -831,7 +831,7 @@ PUBLIC int select_retry(struct tty *tp)
/*===========================================================================*
* handle_events *
*===========================================================================*/
PUBLIC void handle_events(tp)
void handle_events(tp)
tty_t *tp; /* TTY to check for events. */
{
/* Handle any events pending on a TTY. These events are usually device
@@ -888,7 +888,7 @@ tty_t *tp; /* TTY to check for events. */
/*===========================================================================*
* in_transfer *
*===========================================================================*/
PRIVATE void in_transfer(tp)
static void in_transfer(tp)
register tty_t *tp; /* pointer to terminal to read from */
{
/* Transfer bytes from the input queue to a process reading from a terminal. */
@@ -960,7 +960,7 @@ register tty_t *tp; /* pointer to terminal to read from */
/*===========================================================================*
* in_process *
*===========================================================================*/
PRIVATE void in_process_send_byte(
static void in_process_send_byte(
tty_t *tp, /* terminal on which character has arrived */
int ch /* input character */
)
@@ -976,7 +976,7 @@ PRIVATE void in_process_send_byte(
if (tp->tty_incount == buflen(tp->tty_inbuf)) in_transfer(tp);
}
PUBLIC int in_process(tp, buf, count, scode)
int in_process(tp, buf, count, scode)
register tty_t *tp; /* terminal on which character has arrived */
char *buf; /* buffer with input characters */
int count; /* number of input characters */
@@ -1137,7 +1137,7 @@ int scode; /* scan code */
/*===========================================================================*
* echo *
*===========================================================================*/
PRIVATE int tty_echo(tp, ch)
static int tty_echo(tp, ch)
register tty_t *tp; /* terminal on which to echo */
register int ch; /* pointer to character to echo */
{
@@ -1198,7 +1198,7 @@ register int ch; /* pointer to character to echo */
/*===========================================================================*
* rawecho *
*===========================================================================*/
PRIVATE void rawecho(tp, ch)
static void rawecho(tp, ch)
register tty_t *tp;
int ch;
{
@@ -1211,7 +1211,7 @@ int ch;
/*===========================================================================*
* back_over *
*===========================================================================*/
PRIVATE int back_over(tp)
static int back_over(tp)
register tty_t *tp;
{
/* Backspace to previous character on screen and erase it. */
@@ -1240,7 +1240,7 @@ register tty_t *tp;
/*===========================================================================*
* reprint *
*===========================================================================*/
PRIVATE void reprint(tp)
static void reprint(tp)
register tty_t *tp; /* pointer to tty struct */
{
/* Restore what has been echoed to screen before if the user input has been
@@ -1279,7 +1279,7 @@ register tty_t *tp; /* pointer to tty struct */
/*===========================================================================*
* out_process *
*===========================================================================*/
PUBLIC void out_process(tp, bstart, bpos, bend, icount, ocount)
void out_process(tp, bstart, bpos, bend, icount, ocount)
tty_t *tp;
char *bstart, *bpos, *bend; /* start/pos/end of circular buffer */
int *icount; /* # input chars / input chars used */
@@ -1364,7 +1364,7 @@ out_done:
/*===========================================================================*
* dev_ioctl *
*===========================================================================*/
PRIVATE void dev_ioctl(tp)
static void dev_ioctl(tp)
tty_t *tp;
{
/* The ioctl's TCSETSW, TCSETSF and TCDRAIN wait for output to finish to make
@@ -1391,7 +1391,7 @@ tty_t *tp;
/*===========================================================================*
* setattr *
*===========================================================================*/
PRIVATE void setattr(tp)
static void setattr(tp)
tty_t *tp;
{
/* Apply the new line attributes (raw/canonical, line speed, etc.) */
@@ -1447,7 +1447,7 @@ tty_t *tp;
/*===========================================================================*
* tty_reply *
*===========================================================================*/
PUBLIC void
void
tty_reply_f(
file, line, code, replyee, proc_nr, status)
char *file;
@@ -1481,7 +1481,7 @@ int status; /* reply code */
/*===========================================================================*
* sigchar *
*===========================================================================*/
PUBLIC void sigchar(tp, sig, mayflush)
void sigchar(tp, sig, mayflush)
register tty_t *tp;
int sig; /* SIGINT, SIGQUIT, SIGKILL or SIGHUP */
int mayflush;
@@ -1511,7 +1511,7 @@ int mayflush;
/*===========================================================================*
* tty_icancel *
*===========================================================================*/
PRIVATE void tty_icancel(tp)
static void tty_icancel(tp)
register tty_t *tp;
{
/* Discard all pending input, tty buffer or device. */
@@ -1524,7 +1524,7 @@ register tty_t *tp;
/*===========================================================================*
* tty_devnop *
*===========================================================================*/
PRIVATE int tty_devnop(tty_t *UNUSED(tp), int UNUSED(try))
static int tty_devnop(tty_t *UNUSED(tp), int UNUSED(try))
{
/* Some functions need not be implemented at the device level. */
return 0;
@@ -1533,7 +1533,7 @@ PRIVATE int tty_devnop(tty_t *UNUSED(tp), int UNUSED(try))
/*===========================================================================*
* tty_init *
*===========================================================================*/
PRIVATE void tty_init()
static void tty_init()
{
/* Initialize tty structure and call device initialization routines. */
@@ -1576,7 +1576,7 @@ PRIVATE void tty_init()
/*===========================================================================*
* tty_timed_out *
*===========================================================================*/
PRIVATE void tty_timed_out(timer_t *tp)
static void tty_timed_out(timer_t *tp)
{
/* This timer has expired. Set the events flag, to force processing. */
tty_t *tty_ptr;
@@ -1588,7 +1588,7 @@ PRIVATE void tty_timed_out(timer_t *tp)
/*===========================================================================*
* settimer *
*===========================================================================*/
PRIVATE void settimer(tty_ptr, enable)
static void settimer(tty_ptr, enable)
tty_t *tty_ptr; /* line to set or unset a timer on */
int enable; /* set timer if true, otherwise unset */
{
@@ -1608,7 +1608,7 @@ int enable; /* set timer if true, otherwise unset */
/*===========================================================================*
* do_select *
*===========================================================================*/
PRIVATE void do_select(tp, m_ptr)
static void do_select(tp, m_ptr)
register tty_t *tp; /* pointer to tty struct */
register message *m_ptr; /* pointer to message sent to the task */
{

View File

@@ -10,14 +10,14 @@
#define DEFAULT_INTERVAL 1 /* check host time every second */
#define DEFAULT_DRIFT 2 /* update time if delta is >= 2 secs */
PRIVATE void *vir_ptr;
PRIVATE phys_bytes phys_ptr;
PRIVATE port_t port;
PRIVATE u32_t ticks;
PRIVATE int interval;
PRIVATE int drift;
static void *vir_ptr;
static phys_bytes phys_ptr;
static port_t port;
static u32_t ticks;
static int interval;
static int drift;
PRIVATE struct optset optset_table[] = {
static struct optset optset_table[] = {
{ "interval", OPT_INT, &interval, 10 },
{ "drift", OPT_INT, &drift, 10 },
{ NULL, 0, NULL, 0 }
@@ -26,7 +26,7 @@ PRIVATE struct optset optset_table[] = {
/*===========================================================================*
* vbox_request *
*===========================================================================*/
PRIVATE int vbox_request(int req_nr, size_t size)
static int vbox_request(int req_nr, size_t size)
{
/* Perform a VirtualBox backdoor request. */
struct VMMDevRequestHeader *hdr;
@@ -47,7 +47,7 @@ PRIVATE int vbox_request(int req_nr, size_t size)
/*===========================================================================*
* vbox_init *
*===========================================================================*/
PRIVATE int vbox_init(int UNUSED(type), sef_init_info_t *UNUSED(info))
static int vbox_init(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize the device. */
int devind;
@@ -100,7 +100,7 @@ PRIVATE int vbox_init(int UNUSED(type), sef_init_info_t *UNUSED(info))
/*===========================================================================*
* vbox_update_time *
*===========================================================================*/
PRIVATE void vbox_update_time(void)
static void vbox_update_time(void)
{
/* Update the current time if it has drifted too far. */
struct VMMDevReqHostTime *req;
@@ -126,7 +126,7 @@ PRIVATE void vbox_update_time(void)
/*===========================================================================*
* vbox_signal *
*===========================================================================*/
PRIVATE void vbox_signal(int signo)
static void vbox_signal(int signo)
{
/* Process a signal. If it is a SIGTERM, terminate immediately. */
@@ -138,7 +138,7 @@ PRIVATE void vbox_signal(int signo)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup(void)
static void sef_local_startup(void)
{
/* Perform local SEF initialization. */
@@ -153,7 +153,7 @@ PRIVATE void sef_local_startup(void)
/*===========================================================================*
* main *
*===========================================================================*/
PUBLIC int main(int argc, char **argv)
int main(int argc, char **argv)
{
/* The main message loop. */
message m;