Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Serial] Split serial console from serial driver
- Loading branch information
Showing
5 changed files
with
62 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <gpxe/init.h> | ||
#include <gpxe/serial.h> | ||
#include "console.h" | ||
|
||
/** @file | ||
* | ||
* Serial console | ||
* | ||
*/ | ||
|
||
struct console_driver serial_console __console_driver; | ||
|
||
static void serial_console_init ( void ) { | ||
/* Serial driver initialization should already be done, | ||
* time to enable the serial console. */ | ||
serial_console.disabled = 0; | ||
} | ||
|
||
struct console_driver serial_console __console_driver = { | ||
.putchar = serial_putc, | ||
.getchar = serial_getc, | ||
.iskey = serial_ischar, | ||
.disabled = 1, | ||
}; | ||
|
||
/** | ||
* Serial console initialisation function | ||
*/ | ||
struct init_fn serial_console_init_fn __init_fn ( INIT_CONSOLE ) = { | ||
.initialise = serial_console_init, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef _GPXE_SERIAL_H | ||
#define _GPXE_SERIAL_H | ||
|
||
/** @file | ||
* | ||
* Serial driver functions | ||
* | ||
*/ | ||
|
||
extern void serial_putc ( int ch ); | ||
extern int serial_getc ( void ); | ||
extern int serial_ischar ( void ); | ||
|
||
#endif /* _GPXE_SERIAL_H */ |