coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
sys.c File Reference
#include <arch/io.h>
#include <x86emu/x86emu.h>
#include <x86emu/regs.h>
#include <device/oprom/include/io.h>
#include "debug.h"
#include "prim_ops.h"
Include dependency graph for sys.c:

Go to the source code of this file.

Functions

static u8mem_ptr (u32 addr, int size)
 
u8 X86API rdb (u32 addr)
 
u16 X86API rdw (u32 addr)
 
u32 X86API rdl (u32 addr)
 
void X86API wrb (u32 addr, u8 val)
 
void X86API wrw (u32 addr, u16 val)
 
void X86API wrl (u32 addr, u32 val)
 
static u8 X86API p_inb (X86EMU_pioAddr addr)
 
static u16 X86API p_inw (X86EMU_pioAddr addr)
 
static u32 X86API p_inl (X86EMU_pioAddr addr)
 
static void X86API p_outb (X86EMU_pioAddr addr, u8 val)
 
static void X86API p_outw (X86EMU_pioAddr addr, u16 val)
 
static void X86API p_outl (X86EMU_pioAddr addr, u32 val)
 
 u8 (X86APIP sys_rdb)(u32 addr)
 
 u16 (X86APIP sys_rdw)(u32 addr)
 
 u32 (X86APIP sys_rdl)(u32 addr)
 
 void (X86APIP sys_wrb)(u32 addr
 
void X86EMU_setupMemFuncs (X86EMU_memFuncs *funcs)
 
void X86EMU_setupPioFuncs (X86EMU_pioFuncs *funcs)
 
void X86EMU_setupIntrFuncs (X86EMU_intrFuncs funcs[])
 
void X86EMU_prepareForInt (int num)
 
void X86EMU_setMemBase (void *base, size_t size)
 

Variables

X86EMU_sysEnv _X86EMU_env
 
X86EMU_intrFuncs _X86EMU_intrTab [256]
 
u8 val = wrb
 

Function Documentation

◆ mem_ptr()

static u8* mem_ptr ( u32  addr,
int  size 
)
static

Definition at line 62 of file sys.c.

References addr, DB, HALT_SYS, M, and printf.

Referenced by rdb(), rdl(), rdw(), wrb(), wrl(), and wrw().

Here is the caller graph for this function:

◆ p_inb()

static u8 X86API p_inb ( X86EMU_pioAddr  addr)
static

Definition at line 212 of file sys.c.

References addr, DB, DEBUG_IO_TRACE, inb(), and printf.

Here is the call graph for this function:

◆ p_inl()

static u32 X86API p_inl ( X86EMU_pioAddr  addr)
static

Definition at line 242 of file sys.c.

References addr, DB, DEBUG_IO_TRACE, inl(), and printf.

Here is the call graph for this function:

◆ p_inw()

static u16 X86API p_inw ( X86EMU_pioAddr  addr)
static

Definition at line 227 of file sys.c.

References addr, DB, DEBUG_IO_TRACE, inw(), and printf.

Here is the call graph for this function:

◆ p_outb()

static void X86API p_outb ( X86EMU_pioAddr  addr,
u8  val 
)
static

Definition at line 256 of file sys.c.

References addr, DB, DEBUG_IO_TRACE, outb(), printf, and val.

Here is the call graph for this function:

◆ p_outl()

static void X86API p_outl ( X86EMU_pioAddr  addr,
u32  val 
)
static

Definition at line 286 of file sys.c.

References addr, DB, DEBUG_IO_TRACE, outl(), printf, and val.

Here is the call graph for this function:

◆ p_outw()

static void X86API p_outw ( X86EMU_pioAddr  addr,
u16  val 
)
static

Definition at line 271 of file sys.c.

References addr, DB, DEBUG_IO_TRACE, outw(), printf, and val.

Here is the call graph for this function:

◆ rdb()

u8 X86API rdb ( u32  addr)

Definition at line 89 of file sys.c.

References addr, DB, DEBUG_MEM_TRACE, mem_ptr(), printf, and val.

Here is the call graph for this function:

◆ rdl()

u32 X86API rdl ( u32  addr)

Definition at line 134 of file sys.c.

References addr, DB, DEBUG_MEM_TRACE, mem_ptr(), printf, and val.

Here is the call graph for this function:

◆ rdw()

u16 X86API rdw ( u32  addr)

Definition at line 112 of file sys.c.

References addr, DB, DEBUG_MEM_TRACE, mem_ptr(), printf, and val.

Here is the call graph for this function:

◆ u16()

u16 ( X86APIP  sys_rdw)

◆ u32()

u32 ( X86APIP  sys_rdl)

◆ u8()

u8 ( X86APIP  sys_rdb)

◆ void()

void ( X86APIP  sys_wrb)

◆ wrb()

void X86API wrb ( u32  addr,
u8  val 
)

Definition at line 155 of file sys.c.

References addr, DB, DEBUG_MEM_TRACE, mem_ptr(), printf, and val.

Here is the call graph for this function:

◆ wrl()

void X86API wrl ( u32  addr,
u32  val 
)

Definition at line 193 of file sys.c.

References addr, DB, DEBUG_MEM_TRACE, mem_ptr(), printf, and val.

Here is the call graph for this function:

◆ wrw()

void X86API wrw ( u32  addr,
u16  val 
)

Definition at line 174 of file sys.c.

References addr, DB, DEBUG_MEM_TRACE, mem_ptr(), printf, and val.

Here is the call graph for this function:

◆ X86EMU_prepareForInt()

void X86EMU_prepareForInt ( int  num)

Definition at line 387 of file sys.c.

References CLEAR_FLAG, F_IF, F_TF, M, mem_access_word(), and push_word().

Referenced by void().

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

◆ X86EMU_setMemBase()

void X86EMU_setMemBase ( void base,
size_t  size 
)

Definition at line 399 of file sys.c.

References base, and M.

Referenced by biosemu(), and void().

Here is the caller graph for this function:

◆ X86EMU_setupIntrFuncs()

void X86EMU_setupIntrFuncs ( X86EMU_intrFuncs  funcs[])

Definition at line 363 of file sys.c.

References _X86EMU_intrTab, and NULL.

Referenced by biosemu(), and void().

Here is the caller graph for this function:

◆ X86EMU_setupMemFuncs()

void X86EMU_setupMemFuncs ( X86EMU_memFuncs funcs)

Definition at line 321 of file sys.c.

Referenced by biosemu(), and void().

Here is the caller graph for this function:

◆ X86EMU_setupPioFuncs()

void X86EMU_setupPioFuncs ( X86EMU_pioFuncs funcs)

Definition at line 340 of file sys.c.

Referenced by biosemu(), and void().

Here is the caller graph for this function:

Variable Documentation

◆ _X86EMU_env

X86EMU_sysEnv _X86EMU_env

Definition at line 56 of file sys.c.

◆ _X86EMU_intrTab

X86EMU_intrFuncs _X86EMU_intrTab[256]

◆ val

u32 val = wrb

Definition at line 300 of file sys.c.

Referenced by __blsp_spi_read(), __blsp_spi_write(), acpi_fill_fadt(), acpigen_soc_set_gpio_val(), acpigen_write_acquire(), acpigen_write_debug_integer(), acpigen_write_if_lequal_namestr_int(), acpigen_write_if_lequal_op_int(), acpigen_write_name_byte(), acpigen_write_name_dword(), acpigen_write_name_integer(), acpigen_write_name_qword(), ahci_raid_init(), align_down(), align_up(), alink_ab_indx(), alink_ax_indx(), alink_rc_indx(), anx7625_api_dsi_config(), anx7625_power_on_init(), anx7625_reg_read(), anx7625_start_dp_work(), anx7625_swap_dsi_lane3(), anx7625_write_and(), anx7625_write_or(), as3722_read(), as3722_write(), ast_set_index_reg(), ast_set_index_reg_mask(), azalia_set_bits(), bcd2bin(), bin2bcd(), board_BeforeAgesa(), bochs_vga_write(), bochs_write(), bootblock_mainboard_early_init(), bootblock_soc_init(), buffer_from_fifo32(), buffer_to_fifo32_prefix(), busmaster_disable_on_bus(), check_bit_state(), check_fifo_status(), clamp_u32(), clock_grp_enable_clear_reset(), cmos_write(), cmos_write_inner(), config_spi_state(), configure_l2actlr(), configure_l2ctlr(), controller_write8(), CS_change(), dccisw(), dccsw(), dcisw(), ddr3_mem_ctrl_init(), dmc_config_zq(), do_fsm(), do_smbus_send_byte(), do_smbus_write_byte(), dptx_hal_set_color_depth(), dram_memorymap(), dram_zones(), dramc_dle_factor_handler(), dramc_set_rx_dly_factor(), drive_scl(), dt_add_u32_prop(), dt_add_u64_prop(), dump_pci_device(), ec_check_mbox_and_int_status(), ec_early_hwm_init(), ec_hwm_init_late(), ec_init_gpios(), ec_read_write_reg_timeout(), em64t100_smm_save_state_set_reg(), enable_gpmr(), enable_hpet(), enable_smp(), espi_enable_decode(), espi_is_decode_enabled(), espi_write16(), espi_write32(), espi_write8(), exynos5250_config_l2_cache(), fast_spi_flash_ctrlr_reg_write(), fast_spi_get_bios_region(), fb_init(), fch_smbus_enable_decode(), fch_spi_configure_4dw_burst(), fch_spi_set_read_mode(), fill_pattern5(), find_cas_tck(), find_highest_bit_set(), find_lowest_bit_set32(), flowctrl_cpu_off(), flowctrl_cpu_suspend(), flowctrl_write_cc4_ctrl(), flowctrl_write_cpu_csr(), flowctrl_write_cpu_halt(), fsps_update_emmc_config(), get_bits_420(), get_clock(), get_data(), get_dqs_flyby_adjust(), get_fw_config(), get_power_down_mode(), get_ssfc(), gpio_direction_output(), gpio_set_value(), gpio_tlmm_config_get(), gpio_tlmm_config_set(), gpmr_write32(), graphics_gtt_rmw(), gtt_read(), gtt_rmw(), h8_usb_always_on_enable(), hdmi_clear_overflow(), hdmi_ddc_wait_i2c_done(), hdmi_get_plug_in_status(), hdmi_phy_configure(), hdmi_phy_wait_i2c_done(), hdmi_read_edid(), hdmi_video_packetize(), hdmi_video_sample(), i2c_ch_init(), i2c_dev_readb(), i2c_dev_readb_at(), i2c_dev_writeb(), i2c_dev_writeb_at(), i2c_init(), iio_dmi_en_masks(), iio_write_mask(), in16le(), in32le(), init(), init_frb2_wdt(), ioe_p2sb_sbi_write(), iosf_aunit_write(), iosf_bunit_write(), iosf_ccu_write(), iosf_cpu_bus_write(), iosf_cunit_write(), iosf_dunit_write(), iosf_lpss_write(), iosf_port45_write(), iosf_port46_write(), iosf_port47_write(), iosf_port55_write(), iosf_port58_write(), iosf_port59_write(), iosf_port5a_write(), iosf_porta2_write(), iosf_punit_write(), iosf_scc_write(), iosf_score_write(), iosf_sec_write(), iosf_ssus_write(), iosf_usbphy_write(), iosf_ushphy_write(), iosf_write_port(), iowrite16(), iowrite32(), iowrite8(), iowrite_cbio16(), iowrite_cbio32(), iowrite_cbio8(), is_mmio_reg_disabled(), itss_irq_init(), kbc1126_kbdled(), kempld_uart_read_resources(), lm96000_update(), lpss_is_controller_in_reset(), lsbpos(), lsmbus_send_byte(), mainboard_config_upd(), mainboard_memory_init_params(), mainboard_smi_apmc(), max77686_disable_backup_batt(), max77686_i2c_read(), max77686_i2c_write(), mbist_workaround(), mmc_write_dll_reg(), msbpos(), msdc_reset_hw(), msdc_set_buswidth(), msdc_set_field(), mt6311_probe(), mt6315_init_setting(), mt6315_write_field(), mt6358_init_setting(), mt6358_lp_setting(), mt6359p_write_field(), mt6360_config_interface(), mt6360_ldo_enable(), mt6360_ldo_get_voltage(), mt6360_ldo_is_enabled(), mt6360_ldo_set_voltage(), mt6360_pmic_enable(), mt6360_pmic_get_voltage(), mt6360_pmic_is_enabled(), mt6360_pmic_set_voltage(), mt6360_read_interface(), mt6366_init_scp_voltage(), mt6366_init_setting(), mt6366_lp_setting(), mtk_dp_mask(), mtk_dp_write(), mtk_dp_write_byte(), mtk_dpintf_config_bit_num(), mtk_dpintf_config_channel_swap(), mtk_dpintf_mask(), mtk_nor_execute_cmd(), mtk_pcie_domain_enable(), mtk_pcie_reset(), mux_set_sel(), my_outb(), my_outl(), my_outw(), my_wrb(), my_wrl(), my_wrw(), nct7802y_update(), npcd378_hwm_write(), out16le(), out32le(), p2sb_dev_sbi_read(), p2sb_dev_sbi_write(), p2sb_dev_set_hide_bit(), p_outb(), p_outl(), p_outw(), pad_set_gpio_out(), pca9538_set_output(), pch_log_pme_internal_wake_source(), pch_log_rp_wake_source(), pci_cfg_write(), pci_map_bus(), pci_read_config_byte(), pci_read_config_dword(), pci_write_config16(), pci_write_config32(), pci_write_config8(), pci_write_config_dword(), pll_calc_values(), pll_set_rate_regs(), pmc_override_pwr_det(), pmh7_register_clear_bit(), pmh7_register_set_bit(), pmh7_register_write(), pmic_init_scp_voltage(), pmic_init_setting(), pmic_lp_setting(), pmic_protect_key_setting(), pmic_set_vcn33_vol(), pmic_set_vmc_vol(), pmic_set_vmch_vol(), pmic_write_reg(), pmic_write_reg_77620(), pmic_write_reg_77621(), pmif_spi_write_field(), pmif_spmi_write_field(), pnp_raw_resource(), polling_cmd(), prepare_for_hwm_ec_sequence(), print_ns(), print_property(), print_us(), ps8640_backlight_enable(), ptn3460_init(), ptn_select_edid(), pwrap_write_field(), pwrmgt_enable(), qscratch_write(), qscratch_write_readback(), rdb(), rdl(), rdw(), read16(), read32(), read64(), read8(), read_1d0(), read_500(), read_actlr(), read_adfsr(), read_aifsr(), read_be64(), read_ccsidr(), read_clidr(), read_csselr(), read_dfar(), read_dfsr(), read_ifar(), read_ifsr(), read_l2actlr(), read_l2ctlr(), read_le64(), read_msr(), read_scom_direct(), read_sctlr(), read_spr(), read_ttbcr(), reg_script_read_res(), rk_display_init(), rk_edp_dpcd_transfer(), rk_edp_get_pll_lock_status(), rk_edp_hw_link_training(), rk_edp_init_video(), rk_edp_is_video_stream_clock_on(), rk_edp_is_video_stream_on(), rk_edp_read_bytes_from_i2c(), rk_edp_select_i2c_device(), rk_edp_set_video_cr_mn(), rk_edp_start_aux_transaction(), rk_hdmi_init(), rk_mipi_dsi_check_fifo(), rk_mipi_dsi_dcs_cmd(), rk_mipi_dsi_gen_pkt_hdr_write(), rk_mipi_dsi_phy_init(), rk_mipi_dsi_wait_phy_lock(), rk_mipi_dsi_write(), rmw_500(), rockchip_edp_force_hpd(), rockchip_edp_get_plug_in_status(), round(), rtc_eosc_cali(), rtc_get_frequency_meter(), rtc_write_field(), rtc_xosc_write(), run_ap_work(), rw_test(), rx6110sa_write(), sch5545_ec_hwm_early_init(), sch5545_ec_hwm_init(), sch5545_get_ec_fw_version(), sch5545_set_iobase(), sch5545_set_led(), scp_rsi_enable(), sdhci_writeb(), sdhci_writel(), sdhci_writew(), sdram_jedecinit(), sdram_set_clock_enable_signal(), send_jedec_cmd(), ser16(), ser32(), ser8(), serial_setbrg_dev(), set_10b(), set_178(), set_4cf(), set_cpu_ack_width(), set_mmc_clk(), set_msip(), set_read_write_timings(), set_vga_enable_reg(), setup_dirqs(), setup_usb_host(), sgx_resource(), smbus_wait_until_done(), smbus_wait_until_ready(), smbus_write_byte(), smn_write32(), sn65dsi86_backlight_enable(), sp_tx_get_edid_block(), spd_decode_ddr3(), spi_ctrlr_claim_bus(), spi_ctrlr_release_bus(), spi_dma_fix(), spi_set_mode(), spi_write(), spi_write16(), spi_write32(), spi_write8(), spm_set_wakeup_event(), stack_push(), store_data_byte(), store_data_byte_abs(), store_data_long(), store_data_long_abs(), store_data_word(), store_data_word_abs(), sync_dll_search_tap(), sync_dll_test_tap(), system_clock_init(), te_relocate(), tegra_dp_hpd_config(), tegra_dp_hpd_plug(), tegra_dp_lt_config(), tegra_dpaux_writel(), tegra_sor_precharge_lanes(), tegra_sor_write_field(), tegra_sor_writel(), timestamp_get(), tps65090_get_status(), tps65090_is_charging(), tps65090_set_charge_enable(), tps65913_read(), tps65913_write(), tracker_setup(), transfer_to_reg_control(), tristate_gpios(), update_reset_dll(), update_window(), variant_memory_sku(), vpd_get_bool(), vpd_get_int(), w83627dhg_enable_i2c(), wait_aux_op_finish(), watchdog_is_running(), winbond_flash_cmd_status(), wrb(), write16(), write32(), write64(), write8(), write_1d0(), write_500(), write_actlr(), write_at_be16(), write_at_be32(), write_at_be64(), write_at_be8(), write_at_ble8(), write_at_le16(), write_at_le32(), write_at_le64(), write_at_le8(), write_bar(), write_be16(), write_be32(), write_be64(), write_be8(), write_ble8(), write_byte(), write_csselr(), write_dacr(), write_iobp(), write_l2actlr(), write_l2ctlr(), write_le16(), write_le32(), write_le64(), write_le8(), write_leveling(), write_mair0(), write_oem_word(), write_pmbase16(), write_pmbase32(), write_pmbase8(), write_pmpaddr(), write_sctlr(), write_slot(), write_spr(), write_ttbcr(), write_ttbr0(), wrl(), wrw(), x86emuOp_movs_byte(), x86emuOp_movs_word(), and x86emuOp_scas_word().