linux/drivers/firmware/google/memconsole-coreboot.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * memconsole-coreboot.c
 *
 * Memory based BIOS console accessed through coreboot table.
 *
 * Copyright 2017 Google Inc.
 */

#include <linux/device.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>

#include "memconsole.h"
#include "coreboot_table.h"

#define CB_TAG_CBMEM_CONSOLE

/* CBMEM firmware console log descriptor. */
struct cbmem_cons {} __packed;

#define CURSOR_MASK
#define OVERFLOW

static struct cbmem_cons *cbmem_console;
static u32 cbmem_console_size;

/*
 * The cbmem_console structure is read again on every access because it may
 * change at any time if runtime firmware logs new messages. This may rarely
 * lead to race conditions where the firmware overwrites the beginning of the
 * ring buffer with more lines after we have already read |cursor|. It should be
 * rare and harmless enough that we don't spend extra effort working around it.
 */
static ssize_t memconsole_coreboot_read(char *buf, loff_t pos, size_t count)
{}

static int memconsole_probe(struct coreboot_device *dev)
{}

static void memconsole_remove(struct coreboot_device *dev)
{}

static const struct coreboot_device_id memconsole_ids[] =;
MODULE_DEVICE_TABLE(coreboot, memconsole_ids);

static struct coreboot_driver memconsole_driver =;
module_coreboot_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();