coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
exception.c File Reference
#include <arch/cpu.h>
#include <arch/exception.h>
#include <commonlib/helpers.h>
#include <console/console.h>
#include <console/streams.h>
#include <cpu/x86/cr.h>
#include <cpu/x86/lapic.h>
#include <stdint.h>
#include <string.h>
#include <arch/registers.h>
Include dependency graph for exception.c:

Go to the source code of this file.

Data Structures

struct  intr_gate
 
struct  lidtarg
 

Macros

#define MDUMP_SIZE   0x80
 
#define GATE_P   (1 << 15)
 
#define GATE_DPL(x)   (((x) & 0x3) << 13)
 
#define GATE_SIZE_16   (0 << 11)
 
#define GATE_SIZE_32   (1 << 11)
 
#define IGATE_FLAGS   (GATE_P | GATE_DPL(0) | GATE_SIZE_32 | (0x6 << 8))
 

Functions

void x86_exception (struct eregs *info)
 
static struct intr_gate idt[ARRAY_SIZE(intr_entries)] __aligned (8)
 
static uint16_t get_cs (void)
 
static void load_idt (void *table, size_t sz)
 
asmlinkage void exception_init (void)
 

Variables

struct intr_gate __packed
 
u8 vec0 []
 
u8 vec1 []
 
u8 vec2 []
 
u8 vec3 []
 
u8 vec4 []
 
u8 vec5 []
 
u8 vec6 []
 
u8 vec7 []
 
u8 vec8 []
 
u8 vec9 []
 
u8 vec10 []
 
u8 vec11 []
 
u8 vec12 []
 
u8 vec13 []
 
u8 vec14 []
 
u8 vec15 []
 
u8 vec16 []
 
u8 vec17 []
 
u8 vec18 []
 
u8 vec19 []
 
static const uintptr_t intr_entries []
 
struct lidtarg idtarg
 

Macro Definition Documentation

◆ GATE_DPL

#define GATE_DPL (   x)    (((x) & 0x3) << 13)

Definition at line 559 of file exception.c.

◆ GATE_P

#define GATE_P   (1 << 15)

Definition at line 558 of file exception.c.

◆ GATE_SIZE_16

#define GATE_SIZE_16   (0 << 11)

Definition at line 560 of file exception.c.

◆ GATE_SIZE_32

#define GATE_SIZE_32   (1 << 11)

Definition at line 561 of file exception.c.

◆ IGATE_FLAGS

#define IGATE_FLAGS   (GATE_P | GATE_DPL(0) | GATE_SIZE_32 | (0x6 << 8))

Definition at line 563 of file exception.c.

◆ MDUMP_SIZE

#define MDUMP_SIZE   0x80

Function Documentation

◆ __aligned()

static struct intr_gate idt [ARRAY_SIZE(intr_entries)] __aligned ( )
static

◆ exception_init()

asmlinkage void exception_init ( void  )

Definition at line 641 of file exception.c.

References ARRAY_SIZE, get_cs(), IGATE_FLAGS, intr_entries, and load_idt().

Here is the call graph for this function:

◆ get_cs()

static uint16_t get_cs ( void  )
inlinestatic

Definition at line 596 of file exception.c.

Referenced by exception_init().

Here is the caller graph for this function:

◆ load_idt()

static void load_idt ( void table,
size_t  sz 
)
static

Definition at line 623 of file exception.c.

References ENV_RAMSTAGE, idtarg, lidtarg::limit, and memcpy().

Referenced by exception_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ x86_exception()

void x86_exception ( struct eregs info)

Definition at line 378 of file exception.c.

References addr, ALIGN_DOWN, ARRAY_SIZE, BIOS_EMERG, CONFIG, cpu_index(), die(), info, lapicid(), length, MDUMP_SIZE, memcpy(), printk, and read_cr2().

Referenced by intXX_exception_handler().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ __packed

struct lidtarg __packed

◆ idtarg

struct lidtarg idtarg

Definition at line 596 of file exception.c.

Referenced by load_idt(), and setup_default_sipi_vector_params().

◆ intr_entries

const uintptr_t intr_entries[]
static
Initial value:
= {
}
unsigned long uintptr_t
Definition: stdint.h:21
u8 vec7[]
Definition: exception.c:582
u8 vec2[]
Definition: exception.c:582
u8 vec9[]
Definition: exception.c:583
u8 vec15[]
Definition: exception.c:583
u8 vec19[]
Definition: exception.c:584
u8 vec8[]
u8 vec1[]
Definition: exception.c:582
u8 vec12[]
Definition: exception.c:583
u8 vec5[]
Definition: exception.c:582
u8 vec10[]
Definition: exception.c:583
u8 vec0[]
u8 vec18[]
Definition: exception.c:584
u8 vec11[]
Definition: exception.c:583
u8 vec4[]
Definition: exception.c:582
u8 vec16[]
u8 vec17[]
Definition: exception.c:584
u8 vec3[]
Definition: exception.c:582
u8 vec14[]
Definition: exception.c:583
u8 vec13[]
Definition: exception.c:583
u8 vec6[]
Definition: exception.c:582

Definition at line 586 of file exception.c.

Referenced by exception_init().

◆ vec0

u8 vec0[]
extern

◆ vec1

u8 vec1[]

Definition at line 582 of file exception.c.

◆ vec10

u8 vec10[]

Definition at line 583 of file exception.c.

◆ vec11

u8 vec11[]

Definition at line 583 of file exception.c.

◆ vec12

u8 vec12[]

Definition at line 583 of file exception.c.

◆ vec13

u8 vec13[]

Definition at line 583 of file exception.c.

◆ vec14

u8 vec14[]

Definition at line 583 of file exception.c.

◆ vec15

u8 vec15[]

Definition at line 583 of file exception.c.

◆ vec16

u8 vec16[]
extern

◆ vec17

u8 vec17[]

Definition at line 584 of file exception.c.

◆ vec18

u8 vec18[]

Definition at line 584 of file exception.c.

◆ vec19

u8 vec19[]

Definition at line 584 of file exception.c.

◆ vec2

u8 vec2[]

Definition at line 582 of file exception.c.

◆ vec3

u8 vec3[]

Definition at line 582 of file exception.c.

◆ vec4

u8 vec4[]

Definition at line 582 of file exception.c.

◆ vec5

u8 vec5[]

Definition at line 582 of file exception.c.

◆ vec6

u8 vec6[]

Definition at line 582 of file exception.c.

◆ vec7

u8 vec7[]

Definition at line 582 of file exception.c.

◆ vec8

u8 vec8[]
extern

◆ vec9

u8 vec9[]

Definition at line 583 of file exception.c.