a6boot: smallify more
parent
2f0da76696
commit
b04b193bc8
|
@ -41,8 +41,8 @@ void console_init(void)
|
|||
|
||||
void console_fini(void)
|
||||
{
|
||||
console_dbgcon_fini();
|
||||
console_68681_fini();
|
||||
console_dbgcon_fini();
|
||||
}
|
||||
|
||||
void console_putc(char c)
|
||||
|
|
|
@ -22,12 +22,10 @@ static_assert(GD_DBGCON_RXLEN >= 0, "GD_DBGCON_RXLEN must be non-negative");
|
|||
#define DBGCON_CMD_EN_DIS_RX 0x1600 // Enable (!=0) or disable (==0) receive
|
||||
#define DBGCON_CMD_SET_VECTOR 0x1700 // Set the vector number for the IRQ
|
||||
|
||||
typedef struct __attribute__((aligned(2), packed)) {
|
||||
typedef struct __attribute__((aligned(2))) {
|
||||
uint16_t head;
|
||||
uint16_t tail;
|
||||
uint8_t data[GD_DBGCON_RXLEN];
|
||||
// End shared memory. Following is local state.
|
||||
bool rxen;
|
||||
} dbgcon_buf_t;
|
||||
|
||||
#define DBGCON_W (*(uint16_t volatile *)(GD_DBGCON_BASE))
|
||||
|
@ -43,8 +41,6 @@ void gd_dbgcon_init(void)
|
|||
|
||||
#if GD_DBGCON_RXLEN
|
||||
uintptr_t pbuf = (uintptr_t) &_buf;
|
||||
_buf.head = 0;
|
||||
_buf.tail = 0;
|
||||
DBGCON_W = DBGCON_CMD_SET_RXBUF_3 | ((pbuf >> 24) & 0xFF);
|
||||
DBGCON_W = DBGCON_CMD_SET_RXBUF_2 | ((pbuf >> 16) & 0xFF);
|
||||
DBGCON_W = DBGCON_CMD_SET_RXBUF_1 | ((pbuf >> 8) & 0xFF);
|
||||
|
@ -65,7 +61,6 @@ void gd_dbgcon_set_rxen(bool rxen)
|
|||
#if GD_DBGCON_RXLEN
|
||||
DBGCON_W = DBGCON_CMD_EN_DIS_RX | (rxen ? 1 : 0);
|
||||
#endif
|
||||
_buf.rxen = rxen;
|
||||
}
|
||||
|
||||
void gd_dbgcon_set_rxvec(uint8_t nvec)
|
||||
|
@ -80,15 +75,6 @@ void gd_dbgcon_putc(char c)
|
|||
DBGCON_B = c;
|
||||
}
|
||||
|
||||
void gd_dbgcon_puts(char const * s, size_t len)
|
||||
{
|
||||
if (len == (size_t) -1)
|
||||
while ((DBGCON_B = *s++));
|
||||
else
|
||||
for (size_t i = 0; i < len; i++)
|
||||
DBGCON_B = s[i];
|
||||
}
|
||||
|
||||
int gd_dbgcon_getc(void)
|
||||
{
|
||||
#if GD_DBGCON_RXLEN
|
||||
|
|
|
@ -57,9 +57,6 @@ void gd_dbgcon_set_rxvec(uint8_t nvec);
|
|||
// Transmit one character
|
||||
void gd_dbgcon_putc(char c);
|
||||
|
||||
// Transmit a string, either nul-terminated (len = -1) or by length
|
||||
void gd_dbgcon_puts(char const * s, size_t len);
|
||||
|
||||
// Receive one character, or -1 if none are available. This function still works
|
||||
// if the receiver is disabled - you can disable the receiver and then still
|
||||
// pull down characters that had been queued.
|
||||
|
|
Loading…
Reference in New Issue