Macros | Functions | Variables
vram_settings.c File Reference

Video RAM dump. More...

#include <ipxe/uaccess.h>
#include <ipxe/settings.h>

Go to the source code of this file.


#define VRAM_BASE   0xb8000
 Video RAM base address. More...
#define VRAM_LEN   ( 80 /* columns */ * 25 /* rows */ * 2 /* bytes per character */ )
 Video RAM length. More...


static int vram_fetch (void *data, size_t len)
 Fetch video RAM setting. More...
const struct setting vram_setting __setting (SETTING_MISC, vram)
 Video RAM setting. More...


struct builtin_setting vram_builtin_setting __builtin_setting
 Video RAM built-in setting. More...

Detailed Description

Video RAM dump.

Definition in file vram_settings.c.

Macro Definition Documentation


#define VRAM_BASE   0xb8000

Video RAM base address.

Definition at line 36 of file vram_settings.c.


#define VRAM_LEN   ( 80 /* columns */ * 25 /* rows */ * 2 /* bytes per character */ )

Video RAM length.

Definition at line 39 of file vram_settings.c.

Function Documentation



◆ vram_fetch()

static int vram_fetch ( void *  data,
size_t  len 

Fetch video RAM setting.

dataBuffer to fill with setting data
lenLength of buffer
Return values
lenLength of setting data, or negative error

Definition at line 49 of file vram_settings.c.

49  {
50  userptr_t vram = phys_to_user ( VRAM_BASE );
52  /* Copy video RAM */
53  if ( len > VRAM_LEN )
54  len = VRAM_LEN;
55  copy_from_user ( data, vram, 0, len );
57  return VRAM_LEN;
58 }
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
Definition: uaccess.h:337
userptr_t phys_to_user(unsigned long phys_addr)
Convert physical address to user pointer.
uint32_t len
Definition: ena.h:14
#define VRAM_BASE
Video RAM base address.
Definition: vram_settings.c:36
uint8_t data[48]
Additional event data.
Definition: ena.h:22
#define VRAM_LEN
Video RAM length.
Definition: vram_settings.c:39
unsigned long userptr_t
A pointer to a user buffer.
Definition: uaccess.h:33

References copy_from_user(), data, len, phys_to_user(), VRAM_BASE, and VRAM_LEN.

◆ __setting()

const struct setting vram_setting __setting ( SETTING_MISC  ,

Video RAM setting.

Variable Documentation

◆ __builtin_setting

struct builtin_setting vram_builtin_setting __builtin_setting
Initial value:
= {
.setting = &vram_setting,
.fetch = vram_fetch,
static int vram_fetch(void *data, size_t len)
Fetch video RAM setting.
Definition: vram_settings.c:49

Video RAM built-in setting.

Definition at line 69 of file vram_settings.c.