coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pae.h File Reference
#include <stdint.h>
#include <stddef.h>
Include dependency graph for pae.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PAT_UC   0
 
#define PAT_WC   1
 
#define PAT_WT   4
 
#define PAT_WP   5
 
#define PAT_WB   6
 
#define PAT_UC_MINUS   7
 
#define PAT_ENCODE(type, idx)   (((uint64_t)PAT_ ## type) << 8*(idx))
 
#define MAPPING_ERROR   ((void *)0xffffffffUL)
 
#define MEMSET_PAE_VMEM_ALIGN   (2 * MiB)
 
#define MEMSET_PAE_VMEM_SIZE   (2 * MiB)
 
#define MEMSET_PAE_PGTL_ALIGN   (4 * KiB)
 
#define MEMSET_PAE_PGTL_SIZE   (20 * KiB)
 

Functions

void paging_enable_pae_cr3 (uintptr_t cr3)
 
void paging_enable_pae (void)
 
void paging_disable_pae (void)
 
void paging_set_nxe (int enable)
 
void paging_set_pat (uint64_t pat)
 
void paging_set_default_pat (void)
 
int paging_enable_for_car (const char *pdpt_name, const char *pt_name)
 
int paging_identity_map_addr (uintptr_t base, size_t size, int pat)
 
voidmap_2M_page (unsigned long page)
 
int memset_pae (uint64_t dest, unsigned char pat, uint64_t length, void *pgtbl, void *vmem_addr)
 

Macro Definition Documentation

◆ MAPPING_ERROR

#define MAPPING_ERROR   ((void *)0xffffffffUL)

Definition at line 43 of file pae.h.

◆ MEMSET_PAE_PGTL_ALIGN

#define MEMSET_PAE_PGTL_ALIGN   (4 * KiB)

Definition at line 49 of file pae.h.

◆ MEMSET_PAE_PGTL_SIZE

#define MEMSET_PAE_PGTL_SIZE   (20 * KiB)

Definition at line 50 of file pae.h.

◆ MEMSET_PAE_VMEM_ALIGN

#define MEMSET_PAE_VMEM_ALIGN   (2 * MiB)

Definition at line 47 of file pae.h.

◆ MEMSET_PAE_VMEM_SIZE

#define MEMSET_PAE_VMEM_SIZE   (2 * MiB)

Definition at line 48 of file pae.h.

◆ PAT_ENCODE

#define PAT_ENCODE (   type,
  idx 
)    (((uint64_t)PAT_ ## type) << 8*(idx))

Definition at line 26 of file pae.h.

◆ PAT_UC

#define PAT_UC   0

Definition at line 20 of file pae.h.

◆ PAT_UC_MINUS

#define PAT_UC_MINUS   7

Definition at line 25 of file pae.h.

◆ PAT_WB

#define PAT_WB   6

Definition at line 24 of file pae.h.

◆ PAT_WC

#define PAT_WC   1

Definition at line 21 of file pae.h.

◆ PAT_WP

#define PAT_WP   5

Definition at line 23 of file pae.h.

◆ PAT_WT

#define PAT_WT   4

Definition at line 22 of file pae.h.

Function Documentation

◆ map_2M_page()

void* map_2M_page ( unsigned long  page)

◆ memset_pae()

int memset_pae ( uint64_t  dest,
unsigned char  pat,
uint64_t  length,
void pgtbl,
void vmem_addr 
)

◆ paging_disable_pae()

void paging_disable_pae ( void  )

Definition at line 87 of file pgtbl.c.

References CR0_PG, CR4_PAE, CRx_TYPE, read_cr0(), read_cr4(), write_cr0(), and write_cr4().

Referenced by memset_pae().

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

◆ paging_enable_for_car()

int paging_enable_for_car ( const char *  pdpt_name,
const char *  pt_name 
)

Definition at line 324 of file pgtbl.c.

References BIOS_ERR, cbfs_load(), paging_enable_pae_cr3(), preram_symbols_available(), printk, and REGION_SIZE.

Referenced by bootblock_soc_early_init().

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

◆ paging_enable_pae()

void paging_enable_pae ( void  )

Definition at line 71 of file pgtbl.c.

References CR0_PG, CR4_PAE, CRx_TYPE, read_cr0(), read_cr4(), write_cr0(), and write_cr4().

Referenced by paging_enable_pae_cr3().

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

◆ paging_enable_pae_cr3()

void paging_enable_pae_cr3 ( uintptr_t  cr3)

Definition at line 64 of file pgtbl.c.

References paging_enable_pae(), and write_cr3().

Referenced by memset_pae(), and paging_enable_for_car().

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

◆ paging_identity_map_addr()

int paging_identity_map_addr ( uintptr_t  base,
size_t  size,
int  pat 
)

Definition at line 494 of file pgtbl.c.

References _paging_identity_map_addr(), base, BIOS_ERR, IS_ALIGNED, paging_is_enabled(), printk, s2MiB, and s4KiB.

Here is the call graph for this function:

◆ paging_set_default_pat()

void paging_set_default_pat ( void  )

Definition at line 315 of file pgtbl.c.

References paging_set_pat(), PAT_ENCODE, UC, WB, WC, WP, and WT.

Referenced by bootblock_soc_early_init().

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

◆ paging_set_nxe()

void paging_set_nxe ( int  enable)

Definition at line 279 of file pgtbl.c.

References EFER_NXE, IA32_EFER, msr_struct::lo, rdmsr(), and wrmsr().

Referenced by bootblock_soc_early_init().

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

◆ paging_set_pat()

void paging_set_pat ( uint64_t  pat)

Definition at line 291 of file pgtbl.c.

References msr_struct::hi, IA32_PAT, msr_struct::lo, and wrmsr().

Referenced by paging_set_default_pat().

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