Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37035 )
Change subject: lib/cbmem_console.c: Drop CAR_GLOBAL_MIGRATION support ......................................................................
lib/cbmem_console.c: Drop CAR_GLOBAL_MIGRATION support
Change-Id: I5c970a07c7114bff81f0048cac8eafaec35a2386 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/lib/cbmem_console.c 1 file changed, 15 insertions(+), 25 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/37035/1
diff --git a/src/lib/cbmem_console.c b/src/lib/cbmem_console.c index 7876ff5..a75541c 100644 --- a/src/lib/cbmem_console.c +++ b/src/lib/cbmem_console.c @@ -49,7 +49,7 @@ _Static_assert(CONFIG_CONSOLE_CBMEM_BUFFER_SIZE <= MAX_SIZE, "cbmem_console format cannot support buffers larger than 256MB!");
-static struct cbmem_console *cbmem_console_p CAR_GLOBAL; +static struct cbmem_console *cbmem_console_p;
/* * While running from ROM, before DRAM is initialized, some area in cache as @@ -65,11 +65,6 @@ #define STATIC_CONSOLE_SIZE 1024 static u8 static_console[STATIC_CONSOLE_SIZE];
-static struct cbmem_console *current_console(void) -{ - return car_get_ptr(cbmem_console_p); -} - static void current_console_set(struct cbmem_console *new_console_p) { car_set_ptr(cbmem_console_p, new_console_p); @@ -112,21 +107,19 @@
void cbmemc_tx_byte(unsigned char data) { - struct cbmem_console *cbm_cons_p = current_console(); - - if (!cbm_cons_p || !cbm_cons_p->size) + if (!cbmem_console_p || !cbmem_console_p->size) return;
- u32 flags = cbm_cons_p->cursor & ~CURSOR_MASK; - u32 cursor = cbm_cons_p->cursor & CURSOR_MASK; + u32 flags = cbmem_console_p->cursor & ~CURSOR_MASK; + u32 cursor = cbmem_console_p->cursor & CURSOR_MASK;
- cbm_cons_p->body[cursor++] = data; - if (cursor >= cbm_cons_p->size) { + cbmem_console_p->body[cursor++] = data; + if (cursor >= cbmem_console_p->size) { cursor = 0; flags |= OVERFLOW; }
- cbm_cons_p->cursor = flags | cursor; + cbmem_console_p->cursor = flags | cursor; }
/* @@ -166,7 +159,7 @@ const size_t size = CONFIG_CONSOLE_CBMEM_BUFFER_SIZE; /* If CBMEM entry already existed, old contents are not altered. */ struct cbmem_console *cbmem_cons_p = cbmem_add(CBMEM_ID_CONSOLE, size); - struct cbmem_console *previous_cons_p = current_console(); + struct cbmem_console *previous_cons_p = cbmem_console_p;
init_console_ptr(cbmem_cons_p, size); copy_console_buffer(previous_cons_p); @@ -178,19 +171,16 @@ #if CONFIG(CONSOLE_CBMEM_DUMP_TO_UART) void cbmem_dump_console(void) { - struct cbmem_console *cbm_cons_p; u32 cursor; - - cbm_cons_p = current_console(); - if (!cbm_cons_p) + if (!cbmem_console_p) return;
uart_init(0); - if (cbm_cons_p->cursor & OVERFLOW) - for (cursor = cbm_cons_p->cursor & CURSOR_MASK; - cursor < cbm_cons_p->size; cursor++) - uart_tx_byte(0, cbm_cons_p->body[cursor]); - for (cursor = 0; cursor < (cbm_cons_p->cursor & CURSOR_MASK); cursor++) - uart_tx_byte(0, cbm_cons_p->body[cursor]); + if (cbmem_console_p->cursor & OVERFLOW) + for (cursor = cbmem_console_p->cursor & CURSOR_MASK; + cursor < cbmem_console_p->size; cursor++) + uart_tx_byte(0, cbmem_console_p->body[cursor]); + for (cursor = 0; cursor < (cbmem_console_p->cursor & CURSOR_MASK); cursor++) + uart_tx_byte(0, cbmem_console_p->body[cursor]); } #endif