iPXE
vram_settings.c File Reference

Video RAM dump. More...

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

Go to the source code of this file.

Macros

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

Functions

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

Variables

struct builtin_setting vram_builtin_setting __builtin_setting
 Video RAM built-in setting.

Detailed Description

Video RAM dump.

Definition in file vram_settings.c.

Macro Definition Documentation

◆ VRAM_BASE

#define VRAM_BASE   0xb8000

Video RAM base address.

Definition at line 37 of file vram_settings.c.

Referenced by vram_fetch().

◆ VRAM_LEN

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

Video RAM length.

Definition at line 40 of file vram_settings.c.

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

Referenced by vram_fetch().

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ vram_fetch()

int vram_fetch ( void * data,
size_t len )
static

Fetch video RAM setting.

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

Definition at line 50 of file vram_settings.c.

50 {
51 const void *vram = phys_to_virt ( VRAM_BASE );
52
53 /* Copy video RAM */
54 if ( len > VRAM_LEN )
55 len = VRAM_LEN;
56 memcpy ( data, vram, len );
57
58 return VRAM_LEN;
59}
ring len
Length.
Definition dwmac.h:226
uint8_t data[48]
Additional event data.
Definition ena.h:11
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define VRAM_LEN
Video RAM length.
#define VRAM_BASE
Video RAM base address.

References data, len, memcpy(), VRAM_BASE, and VRAM_LEN.

◆ __setting()

const struct setting vram_setting __setting ( SETTING_MISC ,
vram  )

Video RAM setting.

References __setting, builtin_scope, and SETTING_MISC.

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.

Video RAM built-in setting.

Definition at line 70 of file vram_settings.c.

70 {
71 .setting = &vram_setting,
72 .fetch = vram_fetch,
73};