34 #define MAX_SIZE (1 << 28)
35 #define CURSOR_MASK (MAX_SIZE - 1)
36 #define OVERFLOW (1UL << 31)
38 "cbmem_console format cannot support buffers larger than 256MB!");
55 #define STATIC_CONSOLE_SIZE 1024
69 if (!cbm_cons_p || total_space <=
sizeof(
struct cbmem_console)) {
89 size_t cbmemc_size = 0;
132 const char overflow_warning[] =
"\n*** Pre-CBMEM " ENV_STRING
133 " console overflowed, log truncated! ***\n";
134 for (
c = 0;
c <
sizeof(overflow_warning) - 1;
c++)
137 c < src_cons_p->
size;
c++)
146 src_cons_p->
size = 0;
161 const size_t size = CONFIG_CONSOLE_CBMEM_BUFFER_SIZE;
177 #if CONFIG(CONSOLE_CBMEM_DUMP_TO_UART)
181 unsigned int console_index;
void * cbmem_add(u32 id, u64 size)
#define ROMSTAGE_CBMEM_INIT_HOOK_EARLY(init_fn_)
static struct cbmem_console * current_console
static bool console_paused
static void init_console_ptr(void *storage, u32 total_space)
_Static_assert(CONFIG_CONSOLE_CBMEM_BUFFER_SIZE<=MAX_SIZE, "cbmem_console format cannot support buffers larger than 256MB!")
static void cbmemc_reinit(int is_recovery)
void cbmemc_tx_byte(unsigned char data)
static u8 static_console[STATIC_CONSOLE_SIZE]
struct cbmem_console __packed
static void copy_console_buffer(struct cbmem_console *src_cons_p)
void cbmem_dump_console(void)
static int buffer_valid(struct cbmem_console *cbm_cons_p, u32 total_space)
void cbmemc_copy_in(void *buffer, size_t size)
#define STATIC_CONSOLE_SIZE
void cbmem_dump_console_to_uart(void)
void do_putchar(unsigned char byte)
POSTCAR_CBMEM_INIT_HOOK(migrate_ehci_debug)
RAMSTAGE_CBMEM_INIT_HOOK(migrate_ehci_debug)
#define REGION_SIZE(name)
#define BIOS_LOG_IS_MARKER(c)
void uart_init(unsigned int idx)
void uart_tx_byte(unsigned int idx, unsigned char data)
u8 buffer[C2P_BUFFER_MAXSIZE]
#define ENV_ROMSTAGE_OR_BEFORE
void smm_get_cbmemc_buffer(void **buffer_out, size_t *size_out)
#define c(value, pmcreg, dst_bits)
unsigned int get_uart_for_console(void)