retire PUBLIC, PRIVATE and FORWARD
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user