1 |
/* serial.c - serial device interface */ |
/* serial.c - serial device interface */ |
2 |
/* |
/* |
3 |
* GRUB -- GRand Unified Bootloader |
* GRUB -- GRand Unified Bootloader |
4 |
* Copyright (C) 2000 Free Software Foundation, Inc. |
* Copyright (C) 2000, 2001 Free Software Foundation, Inc. |
5 |
* |
* |
6 |
* This program is free software; you can redistribute it and/or modify |
* This program is free software; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
31 |
}; |
}; |
32 |
|
|
33 |
/* Store the port number of a serial unit. */ |
/* Store the port number of a serial unit. */ |
34 |
static unsigned short serial_port; |
static unsigned short serial_port = -1; |
35 |
|
|
36 |
/* The table which lists common configurations. */ |
/* The table which lists common configurations. */ |
37 |
static struct divisor divisor_tab[] = |
static struct divisor divisor_tab[] = |
102 |
outb (serial_port + UART_TX, c); |
outb (serial_port + UART_TX, c); |
103 |
} |
} |
104 |
|
|
105 |
|
/* Check if a serial port is set up. */ |
106 |
|
int |
107 |
|
serial_exists (void) |
108 |
|
{ |
109 |
|
return serial_port != -1; |
110 |
|
} |
111 |
|
|
112 |
/* Return the port number for the UNITth serial device. */ |
/* Return the port number for the UNITth serial device. */ |
113 |
unsigned short |
unsigned short |
114 |
serial_get_port (int unit) |
serial_get_port (int unit) |