├── .github └── workflows │ ├── build.yml │ └── coverity.yml ├── COPYING ├── COPYING.GPLv2 ├── COPYING.UBDL ├── README ├── contrib ├── README ├── cloud │ ├── aws-import │ ├── aws-int13con │ ├── gce-import │ └── gce-int13con ├── coverity │ └── model.c ├── crypto │ └── cmsdetach ├── errdb │ ├── .gitignore │ └── errdb.pl └── vm │ ├── .gitignore │ ├── Makefile │ ├── bochs-writable-ROM-patch │ ├── bochsrc.txt │ ├── cow │ ├── serial-console │ └── serial-console.1 └── src ├── .gitignore ├── Makefile ├── Makefile.efi ├── Makefile.housekeeping ├── Makefile.linux ├── arch ├── arm │ ├── Makefile │ ├── Makefile.efi │ ├── Makefile.linux │ ├── core │ │ └── arm_io.c │ └── include │ │ ├── bits │ │ ├── endian.h │ │ ├── errfile.h │ │ ├── io.h │ │ ├── nap.h │ │ └── xen.h │ │ └── ipxe │ │ └── arm_io.h ├── arm32 │ ├── Makefile │ ├── Makefile.efi │ ├── Makefile.linux │ ├── core │ │ ├── pmccntr.S │ │ └── setjmp.S │ ├── include │ │ ├── bits │ │ │ ├── bigint.h │ │ │ ├── bitops.h │ │ │ ├── byteswap.h │ │ │ ├── compiler.h │ │ │ ├── profile.h │ │ │ ├── setjmp.h │ │ │ ├── stdint.h │ │ │ ├── string.h │ │ │ └── strings.h │ │ ├── ipxe │ │ │ └── efi │ │ │ │ └── dhcparch.h │ │ └── limits.h │ └── libgcc │ │ ├── lldivmod.S │ │ └── llshift.S ├── arm64 │ ├── Makefile │ ├── Makefile.efi │ ├── Makefile.linux │ ├── core │ │ ├── arm64_string.c │ │ ├── arm64_tcpip.c │ │ └── setjmp.S │ └── include │ │ ├── bits │ │ ├── bigint.h │ │ ├── bitops.h │ │ ├── byteswap.h │ │ ├── compiler.h │ │ ├── profile.h │ │ ├── setjmp.h │ │ ├── stdint.h │ │ ├── string.h │ │ ├── strings.h │ │ └── tcpip.h │ │ ├── ipxe │ │ └── efi │ │ │ └── dhcparch.h │ │ └── limits.h ├── i386 │ ├── Makefile │ ├── Makefile.efi │ ├── Makefile.linux │ ├── Makefile.pcbios │ ├── README.i386 │ ├── core │ │ ├── gdbidt.S │ │ ├── nulltrap.c │ │ └── setjmp.S │ ├── include │ │ ├── bits │ │ │ ├── byteswap.h │ │ │ ├── compiler.h │ │ │ ├── gdbmach.h │ │ │ ├── hyperv.h │ │ │ ├── profile.h │ │ │ ├── setjmp.h │ │ │ ├── stdint.h │ │ │ └── strings.h │ │ ├── ipxe │ │ │ ├── efi │ │ │ │ └── dhcparch.h │ │ │ └── msr.h │ │ └── limits.h │ ├── kir-Makefile │ ├── scripts │ │ └── i386-kir.lds │ └── tests │ │ ├── gdbstub_test.S │ │ └── gdbstub_test.gdb ├── loong64 │ ├── Makefile │ ├── Makefile.efi │ ├── Makefile.linux │ ├── core │ │ ├── loong64_io.c │ │ ├── loong64_string.c │ │ └── setjmp.S │ └── include │ │ ├── bits │ │ ├── bigint.h │ │ ├── bitops.h │ │ ├── byteswap.h │ │ ├── compiler.h │ │ ├── endian.h │ │ ├── errfile.h │ │ ├── io.h │ │ ├── nap.h │ │ ├── profile.h │ │ ├── setjmp.h │ │ ├── stdint.h │ │ ├── string.h │ │ └── strings.h │ │ ├── ipxe │ │ ├── efi │ │ │ └── dhcparch.h │ │ └── loong64_io.h │ │ └── limits.h ├── riscv │ ├── Makefile │ ├── Makefile.efi │ ├── Makefile.linux │ ├── Makefile.sbi │ ├── core │ │ ├── hart.c │ │ ├── riscv_io.c │ │ ├── riscv_string.c │ │ ├── riscv_strings.S │ │ ├── setjmp.S │ │ ├── stack.S │ │ ├── zicntr.c │ │ └── zkr.c │ ├── include │ │ ├── bits │ │ │ ├── bigint.h │ │ │ ├── bitops.h │ │ │ ├── byteswap.h │ │ │ ├── compiler.h │ │ │ ├── endian.h │ │ │ ├── errfile.h │ │ │ ├── io.h │ │ │ ├── nap.h │ │ │ ├── profile.h │ │ │ ├── reboot.h │ │ │ ├── setjmp.h │ │ │ ├── stdint.h │ │ │ ├── string.h │ │ │ ├── strings.h │ │ │ └── umalloc.h │ │ └── ipxe │ │ │ ├── csr.h │ │ │ ├── errno │ │ │ └── sbi.h │ │ │ ├── hart.h │ │ │ ├── riscv_io.h │ │ │ ├── sbi.h │ │ │ ├── sbi_reboot.h │ │ │ └── sbi_umalloc.h │ ├── interface │ │ └── sbi │ │ │ ├── sbi_console.c │ │ │ ├── sbi_reboot.c │ │ │ └── sbi_umalloc.c │ ├── prefix │ │ └── sbiprefix.S │ └── scripts │ │ └── sbi.lds ├── riscv32 │ ├── Makefile │ ├── Makefile.efi │ ├── Makefile.linux │ ├── Makefile.sbi │ ├── core │ │ └── riscv32_byteswap.S │ ├── include │ │ ├── ipxe │ │ │ ├── efi │ │ │ │ └── dhcparch.h │ │ │ └── sbi │ │ │ │ └── dhcparch.h │ │ └── limits.h │ └── libgcc │ │ └── llshift.S ├── riscv64 │ ├── Makefile │ ├── Makefile.efi │ ├── Makefile.linux │ ├── Makefile.sbi │ ├── core │ │ └── riscv64_byteswap.S │ └── include │ │ ├── ipxe │ │ ├── efi │ │ │ └── dhcparch.h │ │ └── sbi │ │ │ └── dhcparch.h │ │ └── limits.h ├── x86 │ ├── Makefile │ ├── Makefile.efi │ ├── Makefile.linux │ ├── Makefile.pcbios │ ├── core │ │ ├── basemem_packet.c │ │ ├── cpuid.c │ │ ├── cpuid_settings.c │ │ ├── debugcon.c │ │ ├── dumpregs.c │ │ ├── gdbmach.c │ │ ├── mpcall.S │ │ ├── patch_cf.S │ │ ├── pci_autoboot.c │ │ ├── pcidirect.c │ │ ├── pic8259.c │ │ ├── pit8254.c │ │ ├── rdrand.c │ │ ├── rdtsc_timer.c │ │ ├── relocate.c │ │ ├── runtime.c │ │ ├── stack.S │ │ ├── stack16.S │ │ ├── ucode_mp.S │ │ ├── video_subr.c │ │ ├── vram_settings.c │ │ ├── x86_io.c │ │ ├── x86_string.c │ │ ├── x86_tcpip.c │ │ └── x86_uart.c │ ├── drivers │ │ ├── hyperv │ │ │ ├── hyperv.c │ │ │ └── hyperv.h │ │ ├── net │ │ │ ├── undi.c │ │ │ ├── undiisr.S │ │ │ ├── undiload.c │ │ │ ├── undinet.c │ │ │ ├── undionly.c │ │ │ ├── undipreload.c │ │ │ └── undirom.c │ │ └── xen │ │ │ ├── hvm.c │ │ │ └── hvm.h │ ├── hci │ │ └── commands │ │ │ ├── cpuid_cmd.c │ │ │ └── pxe_cmd.c │ ├── image │ │ ├── bootsector.c │ │ ├── bzimage.c │ │ ├── com32.c │ │ ├── comboot.c │ │ ├── elfboot.c │ │ ├── initrd.c │ │ ├── multiboot.c │ │ ├── nbi.c │ │ ├── pxe_image.c │ │ ├── sdi.c │ │ └── ucode.c │ ├── include │ │ ├── basemem.h │ │ ├── basemem_packet.h │ │ ├── bios.h │ │ ├── bios_disks.h │ │ ├── biosint.h │ │ ├── bits │ │ │ ├── acpi.h │ │ │ ├── bigint.h │ │ │ ├── bitops.h │ │ │ ├── endian.h │ │ │ ├── errfile.h │ │ │ ├── io.h │ │ │ ├── iomap.h │ │ │ ├── mp.h │ │ │ ├── nap.h │ │ │ ├── pci_io.h │ │ │ ├── reboot.h │ │ │ ├── sanboot.h │ │ │ ├── smbios.h │ │ │ ├── string.h │ │ │ ├── tcpip.h │ │ │ ├── time.h │ │ │ ├── uaccess.h │ │ │ ├── uart.h │ │ │ ├── umalloc.h │ │ │ └── xen.h │ │ ├── bochs.h │ │ ├── bootsector.h │ │ ├── bzimage.h │ │ ├── comboot.h │ │ ├── fakee820.h │ │ ├── initrd.h │ │ ├── int13.h │ │ ├── ipxe │ │ │ ├── acpipwr.h │ │ │ ├── apm.h │ │ │ ├── bios_mp.h │ │ │ ├── bios_nap.h │ │ │ ├── bios_reboot.h │ │ │ ├── bios_sanboot.h │ │ │ ├── bios_smbios.h │ │ │ ├── cpuid.h │ │ │ ├── errno │ │ │ │ └── pcbios.h │ │ │ ├── guestrpc.h │ │ │ ├── iomap_pages.h │ │ │ ├── memtop_umalloc.h │ │ │ ├── pcbios │ │ │ │ └── dhcparch.h │ │ │ ├── pcibios.h │ │ │ ├── pcicloud.h │ │ │ ├── pcidirect.h │ │ │ ├── pit8254.h │ │ │ ├── rsdp.h │ │ │ ├── rtc_time.h │ │ │ ├── ucode.h │ │ │ ├── vesafb.h │ │ │ ├── vmware.h │ │ │ └── x86_io.h │ │ ├── kir.h │ │ ├── libkir.h │ │ ├── librm.h │ │ ├── memsizes.h │ │ ├── multiboot.h │ │ ├── pic8259.h │ │ ├── pnpbios.h │ │ ├── pxe.h │ │ ├── pxe_api.h │ │ ├── pxe_call.h │ │ ├── pxe_error.h │ │ ├── pxe_types.h │ │ ├── realmode.h │ │ ├── registers.h │ │ ├── rmsetjmp.h │ │ ├── rtc.h │ │ ├── sdi.h │ │ ├── undi.h │ │ ├── undiload.h │ │ ├── undinet.h │ │ ├── undipreload.h │ │ ├── undirom.h │ │ └── vga.h │ ├── interface │ │ ├── pcbios │ │ │ ├── acpi_timer.c │ │ │ ├── acpipwr.c │ │ │ ├── apm.c │ │ │ ├── basemem.c │ │ │ ├── bios_cachedhcp.c │ │ │ ├── bios_console.c │ │ │ ├── bios_mp.c │ │ │ ├── bios_nap.c │ │ │ ├── bios_reboot.c │ │ │ ├── bios_smbios.c │ │ │ ├── bios_timer.c │ │ │ ├── biosint.c │ │ │ ├── e820mangler.S │ │ │ ├── fakee820.c │ │ │ ├── hidemem.c │ │ │ ├── int13.c │ │ │ ├── int13con.c │ │ │ ├── memmap.c │ │ │ ├── memtop_umalloc.c │ │ │ ├── pcibios.c │ │ │ ├── pcicloud.c │ │ │ ├── pnpbios.c │ │ │ ├── rsdp.c │ │ │ ├── rtc_entropy.c │ │ │ ├── rtc_time.c │ │ │ └── vesafb.c │ │ ├── pxe │ │ │ ├── pxe_call.c │ │ │ ├── pxe_entry.S │ │ │ ├── pxe_exit_hook.c │ │ │ ├── pxe_file.c │ │ │ ├── pxe_loader.c │ │ │ ├── pxe_preboot.c │ │ │ ├── pxe_tftp.c │ │ │ ├── pxe_udp.c │ │ │ └── pxe_undi.c │ │ ├── syslinux │ │ │ ├── com32_call.c │ │ │ ├── com32_wrapper.S │ │ │ ├── comboot_call.c │ │ │ └── comboot_resolv.c │ │ └── vmware │ │ │ ├── guestinfo.c │ │ │ ├── guestrpc.c │ │ │ ├── vmconsole.c │ │ │ └── vmware.c │ ├── prefix │ │ ├── bootpart.S │ │ ├── dskprefix.S │ │ ├── exeprefix.S │ │ ├── hdprefix.S │ │ ├── isaromprefix.S │ │ ├── kkkpxeprefix.S │ │ ├── kkpxeprefix.S │ │ ├── kpxeprefix.S │ │ ├── libprefix.S │ │ ├── lkrnprefix.S │ │ ├── mbr.S │ │ ├── mromprefix.S │ │ ├── nbiprefix.S │ │ ├── nullprefix.S │ │ ├── pciromprefix.S │ │ ├── pxeprefix.S │ │ ├── rawprefix.S │ │ ├── romprefix.S │ │ ├── undiloader.S │ │ ├── unlzma.S │ │ ├── unlzma16.S │ │ └── usbdisk.S │ ├── scripts │ │ ├── pcbios.lds │ │ └── prefixonly.lds │ ├── tests │ │ └── comboot │ │ │ ├── shuffle-simple.asm │ │ │ └── version.asm │ └── transitions │ │ ├── liba20.S │ │ ├── libkir.S │ │ ├── libpm.S │ │ ├── librm.S │ │ ├── librm_mgmt.c │ │ └── librm_test.c └── x86_64 │ ├── Makefile │ ├── Makefile.efi │ ├── Makefile.linux │ ├── Makefile.pcbios │ ├── core │ ├── gdbidt.S │ └── setjmp.S │ └── include │ ├── bits │ ├── byteswap.h │ ├── compiler.h │ ├── gdbmach.h │ ├── hyperv.h │ ├── profile.h │ ├── setjmp.h │ ├── stdint.h │ └── strings.h │ ├── ipxe │ ├── efi │ │ └── dhcparch.h │ └── msr.h │ └── limits.h ├── bin └── .gitignore ├── config ├── branding.h ├── cloud │ ├── aws.ipxe │ ├── colour.h │ ├── console.h │ ├── crypto.h │ ├── gce.ipxe │ ├── general.h │ ├── ioapi.h │ ├── serial.h │ ├── settings.h │ ├── sideband.h │ └── usb.h ├── colour.h ├── config.c ├── config_archive.c ├── config_asn1.c ├── config_crypto.c ├── config_eap.c ├── config_efi.c ├── config_entropy.c ├── config_ethernet.c ├── config_fc.c ├── config_fdt.c ├── config_http.c ├── config_infiniband.c ├── config_linux.c ├── config_net80211.c ├── config_pcbios.c ├── config_pci.c ├── config_pixbuf.c ├── config_romprefix.c ├── config_route.c ├── config_sbi.c ├── config_timer.c ├── config_usb.c ├── console.h ├── crypto.h ├── defaults.h ├── defaults │ ├── efi.h │ ├── linux.h │ ├── pcbios.h │ └── sbi.h ├── dhcp.h ├── entropy.h ├── fault.h ├── fdt.h ├── general.h ├── ioapi.h ├── isa.h ├── local │ └── .gitignore ├── named.h ├── nap.h ├── qemu │ ├── colour.h │ ├── console.h │ ├── crypto.h │ ├── general.h │ ├── ioapi.h │ ├── serial.h │ ├── settings.h │ ├── sideband.h │ └── usb.h ├── reboot.h ├── rpi │ ├── colour.h │ ├── console.h │ ├── crypto.h │ ├── general.h │ ├── ioapi.h │ ├── serial.h │ ├── settings.h │ ├── sideband.h │ └── usb.h ├── sanboot.h ├── serial.h ├── settings.h ├── sideband.h ├── time.h ├── timer.h ├── umalloc.h ├── usb.h └── vbox │ ├── README │ ├── colour.h │ ├── console.h │ ├── crypto.h │ ├── general.h │ ├── ioapi.h │ ├── serial.h │ ├── settings.h │ ├── sideband.h │ └── usb.h ├── core ├── acpi.c ├── acpi_settings.c ├── acpimac.c ├── ansicol.c ├── ansicoldef.c ├── ansiesc.c ├── archive.c ├── asprintf.c ├── assert.c ├── base16.c ├── base64.c ├── basename.c ├── bitmap.c ├── blockdev.c ├── blocktrans.c ├── cachedhcp.c ├── console.c ├── cpio.c ├── ctype.c ├── cwuri.c ├── debug.c ├── debug_md5.c ├── device.c ├── dma.c ├── downloader.c ├── dummy_sanboot.c ├── dynkeymap.c ├── dynui.c ├── edd.c ├── errno.c ├── exec.c ├── fault.c ├── fbcon.c ├── fdt.c ├── fnrec.c ├── gdbserial.c ├── gdbstub.c ├── gdbudp.c ├── getkey.c ├── getopt.c ├── hw.c ├── i82365.c ├── image.c ├── init.c ├── interface.c ├── iobuf.c ├── iomap_virt.c ├── isqrt.c ├── job.c ├── keymap.c ├── linebuf.c ├── lineconsole.c ├── list.c ├── log.c ├── main.c ├── malloc.c ├── memmap_settings.c ├── monojob.c ├── mp.c ├── netbios.c ├── null_acpi.c ├── null_mp.c ├── null_nap.c ├── null_pci.c ├── null_reboot.c ├── null_sanboot.c ├── null_smbios.c ├── null_time.c ├── nvo.c ├── open.c ├── params.c ├── parseopt.c ├── pc_kbd.c ├── pcmcia.c ├── pending.c ├── pinger.c ├── pixbuf.c ├── pool.c ├── posix_io.c ├── process.c ├── profile.c ├── quiesce.c ├── random.c ├── refcnt.c ├── resolv.c ├── sanboot.c ├── serial.c ├── settings.c ├── string.c ├── stringextra.c ├── time.c ├── timer.c ├── uaccess.c ├── uart.c ├── uri.c ├── utf8.c ├── uuid.c ├── version.c ├── vsprintf.c ├── wchar.c ├── xfer.c └── xferbuf.c ├── crypto ├── aes.c ├── aes_wrap.c ├── arc4.c ├── asn1.c ├── bigint.c ├── cbc.c ├── certstore.c ├── chap.c ├── cms.c ├── crc32.c ├── crypto_null.c ├── deflate.c ├── des.c ├── dhe.c ├── drbg.c ├── ecb.c ├── ecdhe.c ├── entropy.c ├── gcm.c ├── hash_df.c ├── hmac.c ├── hmac_drbg.c ├── md4.c ├── md5.c ├── mishmash │ ├── dhe_rsa_aes_cbc_sha1.c │ ├── dhe_rsa_aes_cbc_sha256.c │ ├── dhe_rsa_aes_gcm_sha256.c │ ├── dhe_rsa_aes_gcm_sha384.c │ ├── ecdhe_rsa_aes_cbc_sha1.c │ ├── ecdhe_rsa_aes_cbc_sha256.c │ ├── ecdhe_rsa_aes_cbc_sha384.c │ ├── ecdhe_rsa_aes_gcm_sha256.c │ ├── ecdhe_rsa_aes_gcm_sha384.c │ ├── oid_aes_cbc.c │ ├── oid_aes_gcm.c │ ├── oid_md4.c │ ├── oid_md5.c │ ├── oid_p256.c │ ├── oid_p384.c │ ├── oid_rsa.c │ ├── oid_sha1.c │ ├── oid_sha224.c │ ├── oid_sha256.c │ ├── oid_sha384.c │ ├── oid_sha512.c │ ├── oid_sha512_224.c │ ├── oid_sha512_256.c │ ├── oid_x25519.c │ ├── rsa_aes_cbc_sha1.c │ ├── rsa_aes_cbc_sha256.c │ ├── rsa_aes_gcm_sha256.c │ ├── rsa_aes_gcm_sha384.c │ ├── rsa_md5.c │ ├── rsa_sha1.c │ ├── rsa_sha224.c │ ├── rsa_sha256.c │ ├── rsa_sha384.c │ └── rsa_sha512.c ├── mschapv2.c ├── ntlm.c ├── ocsp.c ├── p256.c ├── p384.c ├── privkey.c ├── random_nz.c ├── rbg.c ├── rootcert.c ├── rsa.c ├── sha1.c ├── sha1extra.c ├── sha224.c ├── sha256.c ├── sha384.c ├── sha512.c ├── sha512_224.c ├── sha512_256.c ├── weierstrass.c ├── x25519.c └── x509.c ├── doc ├── build_sys.dox └── pxe_extensions ├── doxygen.cfg ├── drivers ├── bitbash │ ├── bitbash.c │ ├── i2c_bit.c │ ├── mii_bit.c │ └── spi_bit.c ├── block │ ├── ata.c │ ├── ibft.c │ ├── scsi.c │ └── srp.c ├── bus │ ├── cdc.c │ ├── ecam.c │ ├── eisa.c │ ├── isa.c │ ├── isa_ids.c │ ├── isapnp.c │ ├── mca.c │ ├── pci.c │ ├── pci_settings.c │ ├── pcibackup.c │ ├── pcibridge.c │ ├── pciea.c │ ├── pciextra.c │ ├── pcimsix.c │ ├── pcivpd.c │ ├── usb.c │ ├── usb_settings.c │ ├── virtio-pci.c │ └── virtio-ring.c ├── infiniband │ ├── CIB_PRM.h │ ├── MT25218_PRM.h │ ├── MT25408_PRM.h │ ├── arbel.c │ ├── arbel.h │ ├── flexboot_nodnic.c │ ├── flexboot_nodnic.h │ ├── golan.c │ ├── golan.h │ ├── hermon.c │ ├── hermon.h │ ├── linda.c │ ├── linda.h │ ├── linda_fw.c │ ├── mlx_bitops.h │ ├── mlx_nodnic │ │ ├── include │ │ │ ├── mlx_cmd.h │ │ │ ├── mlx_device.h │ │ │ ├── mlx_nodnic_data_structures.h │ │ │ └── mlx_port.h │ │ └── src │ │ │ ├── mlx_cmd.c │ │ │ ├── mlx_device.c │ │ │ └── mlx_port.c │ ├── mlx_utils │ │ ├── include │ │ │ ├── private │ │ │ │ ├── mlx_memory_priv.h │ │ │ │ ├── mlx_pci_priv.h │ │ │ │ └── mlx_utils_priv.h │ │ │ └── public │ │ │ │ ├── mlx_bail.h │ │ │ │ ├── mlx_icmd.h │ │ │ │ ├── mlx_logging.h │ │ │ │ ├── mlx_memory.h │ │ │ │ ├── mlx_pci.h │ │ │ │ ├── mlx_pci_gw.h │ │ │ │ ├── mlx_types.h │ │ │ │ └── mlx_utils.h │ │ ├── mlx_lib │ │ │ ├── mlx_blink_leds │ │ │ │ ├── mlx_blink_leds.c │ │ │ │ └── mlx_blink_leds.h │ │ │ ├── mlx_link_speed │ │ │ │ ├── mlx_link_speed.c │ │ │ │ └── mlx_link_speed.h │ │ │ ├── mlx_mtu │ │ │ │ ├── mlx_mtu.c │ │ │ │ └── mlx_mtu.h │ │ │ ├── mlx_nvconfig │ │ │ │ ├── mlx_nvconfig.c │ │ │ │ ├── mlx_nvconfig.h │ │ │ │ ├── mlx_nvconfig_defaults.c │ │ │ │ ├── mlx_nvconfig_defaults.h │ │ │ │ └── mlx_nvconfig_prm.h │ │ │ ├── mlx_reg_access │ │ │ │ ├── mlx_reg_access.c │ │ │ │ └── mlx_reg_access.h │ │ │ └── mlx_vmac │ │ │ │ ├── mlx_vmac.c │ │ │ │ └── mlx_vmac.h │ │ └── src │ │ │ └── public │ │ │ ├── mlx_icmd.c │ │ │ ├── mlx_memory.c │ │ │ ├── mlx_pci.c │ │ │ ├── mlx_pci_gw.c │ │ │ └── mlx_utils.c │ ├── mlx_utils_flexboot │ │ ├── include │ │ │ ├── mlx_logging_priv.h │ │ │ └── mlx_types_priv.h │ │ └── src │ │ │ ├── mlx_memory_priv.c │ │ │ ├── mlx_pci_priv.c │ │ │ └── mlx_utils_priv.c │ ├── nodnic_prm.h │ ├── nodnic_shomron_prm.h │ ├── qib7322.c │ ├── qib7322.h │ ├── qib_7220_regs.h │ ├── qib_7322_regs.h │ └── qib_genbits.pl ├── linux │ ├── af_packet.c │ ├── linux.c │ ├── slirp.c │ └── tap.c ├── net │ ├── 3c503.c │ ├── 3c509-eisa.c │ ├── 3c509.c │ ├── 3c509.h │ ├── 3c515.c │ ├── 3c515.txt │ ├── 3c529.c │ ├── 3c595.c │ ├── 3c595.h │ ├── 3c5x9.c │ ├── 3c90x.c │ ├── 3c90x.h │ ├── acm.c │ ├── acm.h │ ├── amd8111e.c │ ├── amd8111e.h │ ├── ath │ │ ├── ath.h │ │ ├── ath5k │ │ │ ├── ath5k.c │ │ │ ├── ath5k.h │ │ │ ├── ath5k_attach.c │ │ │ ├── ath5k_caps.c │ │ │ ├── ath5k_desc.c │ │ │ ├── ath5k_dma.c │ │ │ ├── ath5k_eeprom.c │ │ │ ├── ath5k_gpio.c │ │ │ ├── ath5k_initvals.c │ │ │ ├── ath5k_pcu.c │ │ │ ├── ath5k_phy.c │ │ │ ├── ath5k_qcu.c │ │ │ ├── ath5k_reset.c │ │ │ ├── ath5k_rfkill.c │ │ │ ├── base.h │ │ │ ├── desc.h │ │ │ ├── eeprom.h │ │ │ ├── reg.h │ │ │ ├── rfbuffer.h │ │ │ └── rfgain.h │ │ ├── ath9k │ │ │ ├── ani.h │ │ │ ├── ar5008_initvals.h │ │ │ ├── ar9001_initvals.h │ │ │ ├── ar9002_initvals.h │ │ │ ├── ar9002_phy.h │ │ │ ├── ar9003_2p2_initvals.h │ │ │ ├── ar9003_eeprom.h │ │ │ ├── ar9003_mac.h │ │ │ ├── ar9003_phy.h │ │ │ ├── ar9340_initvals.h │ │ │ ├── ar9485_initvals.h │ │ │ ├── ath9k.c │ │ │ ├── ath9k.h │ │ │ ├── ath9k_ani.c │ │ │ ├── ath9k_ar5008_phy.c │ │ │ ├── ath9k_ar9002_calib.c │ │ │ ├── ath9k_ar9002_hw.c │ │ │ ├── ath9k_ar9002_mac.c │ │ │ ├── ath9k_ar9002_phy.c │ │ │ ├── ath9k_ar9003_calib.c │ │ │ ├── ath9k_ar9003_eeprom.c │ │ │ ├── ath9k_ar9003_hw.c │ │ │ ├── ath9k_ar9003_mac.c │ │ │ ├── ath9k_ar9003_phy.c │ │ │ ├── ath9k_calib.c │ │ │ ├── ath9k_common.c │ │ │ ├── ath9k_eeprom.c │ │ │ ├── ath9k_eeprom_4k.c │ │ │ ├── ath9k_eeprom_9287.c │ │ │ ├── ath9k_eeprom_def.c │ │ │ ├── ath9k_hw.c │ │ │ ├── ath9k_init.c │ │ │ ├── ath9k_mac.c │ │ │ ├── ath9k_main.c │ │ │ ├── ath9k_recv.c │ │ │ ├── ath9k_xmit.c │ │ │ ├── calib.h │ │ │ ├── common.h │ │ │ ├── eeprom.h │ │ │ ├── hw-ops.h │ │ │ ├── hw.h │ │ │ ├── mac.h │ │ │ ├── phy.h │ │ │ └── reg.h │ │ ├── ath_hw.c │ │ ├── ath_key.c │ │ ├── ath_regd.c │ │ ├── reg.h │ │ ├── regd.h │ │ └── regd_common.h │ ├── atl1e.c │ ├── atl1e.h │ ├── axge.c │ ├── axge.h │ ├── b44.c │ ├── b44.h │ ├── bnx2.c │ ├── bnx2.h │ ├── bnx2_fw.h │ ├── bnxt │ │ ├── bnxt.c │ │ ├── bnxt.h │ │ ├── bnxt_dbg.h │ │ └── bnxt_hsi.h │ ├── cs89x0.c │ ├── cs89x0.h │ ├── cs89x0.txt │ ├── davicom.c │ ├── depca.c │ ├── dm96xx.c │ ├── dm96xx.h │ ├── dmfe.c │ ├── ecm.c │ ├── ecm.h │ ├── eepro.c │ ├── eepro100.c │ ├── eepro100.h │ ├── efi │ │ ├── mnp.c │ │ ├── mnpnet.c │ │ ├── nii.c │ │ ├── nii.h │ │ ├── snp.c │ │ ├── snpnet.c │ │ ├── snpnet.h │ │ └── snponly.c │ ├── ena.c │ ├── ena.h │ ├── eoib.c │ ├── epic100.c │ ├── epic100.h │ ├── etherfabric.c │ ├── etherfabric.h │ ├── etherfabric_nic.h │ ├── exanic.c │ ├── exanic.h │ ├── forcedeth.c │ ├── forcedeth.h │ ├── gve.c │ ├── gve.h │ ├── hfa384x.h │ ├── ice.c │ ├── ice.h │ ├── icplus.c │ ├── icplus.h │ ├── igbvf │ │ ├── igbvf.h │ │ ├── igbvf_defines.h │ │ ├── igbvf_main.c │ │ ├── igbvf_mbx.c │ │ ├── igbvf_mbx.h │ │ ├── igbvf_osdep.h │ │ ├── igbvf_regs.h │ │ ├── igbvf_vf.c │ │ └── igbvf_vf.h │ ├── intel.c │ ├── intel.h │ ├── intelvf.c │ ├── intelvf.h │ ├── intelx.c │ ├── intelx.h │ ├── intelxl.c │ ├── intelxl.h │ ├── intelxlvf.c │ ├── intelxlvf.h │ ├── intelxvf.c │ ├── intelxvf.h │ ├── iphone.c │ ├── iphone.h │ ├── ipoib.c │ ├── jme.c │ ├── jme.h │ ├── lan78xx.c │ ├── lan78xx.h │ ├── legacy.c │ ├── marvell │ │ ├── aqc1xx.c │ │ ├── aqc1xx.h │ │ ├── atl2_hw.c │ │ ├── atl2_hw.h │ │ ├── atl_hw.c │ │ └── atl_hw.h │ ├── mii.c │ ├── myri10ge.c │ ├── myri10ge_mcp.h │ ├── myson.c │ ├── myson.h │ ├── natsemi.c │ ├── natsemi.h │ ├── ncm.c │ ├── ncm.h │ ├── ne.c │ ├── ne2k_isa.c │ ├── netfront.c │ ├── netfront.h │ ├── netvsc.c │ ├── netvsc.h │ ├── ns8390.c │ ├── ns8390.h │ ├── p80211hdr.h │ ├── pcnet32.c │ ├── pcnet32.h │ ├── phantom │ │ ├── nx_bitops.h │ │ ├── nxhal_nic_interface.h │ │ ├── phantom.c │ │ ├── phantom.h │ │ └── phantom_hw.h │ ├── pnic.c │ ├── pnic_api.h │ ├── prism2.c │ ├── prism2_pci.c │ ├── prism2_plx.c │ ├── rdc.c │ ├── rdc.h │ ├── realtek.c │ ├── realtek.h │ ├── rhine.c │ ├── rhine.h │ ├── rtl818x │ │ ├── rtl8180.c │ │ ├── rtl8180_grf5101.c │ │ ├── rtl8180_max2820.c │ │ ├── rtl8180_sa2400.c │ │ ├── rtl8185.c │ │ ├── rtl8185_rtl8225.c │ │ ├── rtl818x.c │ │ └── rtl818x.h │ ├── sfc │ │ ├── ef10_regs.h │ │ ├── efx_bitfield.h │ │ ├── efx_common.c │ │ ├── efx_common.h │ │ ├── efx_hunt.c │ │ ├── efx_hunt.h │ │ ├── mc_driver_pcol.h │ │ ├── mcdi.h │ │ └── sfc_hunt.c │ ├── sis190.c │ ├── sis190.h │ ├── sis900.c │ ├── sis900.h │ ├── skeleton.c │ ├── skeleton.h │ ├── skge.c │ ├── skge.h │ ├── sky2.c │ ├── sky2.h │ ├── smc9000.c │ ├── smc9000.h │ ├── smsc75xx.c │ ├── smsc75xx.h │ ├── smsc95xx.c │ ├── smsc95xx.h │ ├── smscusb.c │ ├── smscusb.h │ ├── sundance.c │ ├── tg3 │ │ ├── tg3.c │ │ ├── tg3.h │ │ ├── tg3_hw.c │ │ └── tg3_phy.c │ ├── thunderx.c │ ├── thunderx.h │ ├── thunderxcfg.h │ ├── tlan.c │ ├── tlan.h │ ├── tulip.c │ ├── tulip.txt │ ├── velocity.c │ ├── velocity.h │ ├── virtio-net.c │ ├── virtio-net.h │ ├── vmxnet3.c │ ├── vmxnet3.h │ ├── vxge │ │ ├── vxge.c │ │ ├── vxge_config.c │ │ ├── vxge_config.h │ │ ├── vxge_main.c │ │ ├── vxge_main.h │ │ ├── vxge_reg.h │ │ ├── vxge_traffic.c │ │ ├── vxge_traffic.h │ │ └── vxge_version.h │ ├── w89c840.c │ ├── wd.c │ └── wlan_compat.h ├── nvs │ ├── nvs.c │ ├── nvsvpd.c │ ├── spi.c │ └── threewire.c └── usb │ ├── ehci.c │ ├── ehci.h │ ├── uhci.c │ ├── uhci.h │ ├── usbblk.c │ ├── usbblk.h │ ├── usbhid.c │ ├── usbhub.c │ ├── usbhub.h │ ├── usbio.c │ ├── usbio.h │ ├── usbkbd.c │ ├── usbkbd.h │ ├── usbnet.c │ ├── xhci.c │ └── xhci.h ├── hci ├── commands │ ├── autoboot_cmd.c │ ├── cert_cmd.c │ ├── config_cmd.c │ ├── console_cmd.c │ ├── dhcp_cmd.c │ ├── digest_cmd.c │ ├── dynui_cmd.c │ ├── fcmgmt_cmd.c │ ├── gdbstub_cmd.c │ ├── ibmgmt_cmd.c │ ├── ifmgmt_cmd.c │ ├── image_archive_cmd.c │ ├── image_cmd.c │ ├── image_crypt_cmd.c │ ├── image_mem_cmd.c │ ├── image_trust_cmd.c │ ├── ipstat_cmd.c │ ├── iwmgmt_cmd.c │ ├── login_cmd.c │ ├── lotest_cmd.c │ ├── neighbour_cmd.c │ ├── nslookup_cmd.c │ ├── ntp_cmd.c │ ├── nvo_cmd.c │ ├── param_cmd.c │ ├── pci_cmd.c │ ├── ping_cmd.c │ ├── poweroff_cmd.c │ ├── profstat_cmd.c │ ├── reboot_cmd.c │ ├── route_cmd.c │ ├── sanboot_cmd.c │ ├── shim_cmd.c │ ├── sync_cmd.c │ ├── time_cmd.c │ ├── usb_cmd.c │ └── vlan_cmd.c ├── editstring.c ├── jumpscroll.c ├── keymap │ ├── keymap_al.c │ ├── keymap_by.c │ ├── keymap_cf.c │ ├── keymap_cz.c │ ├── keymap_de.c │ ├── keymap_dk.c │ ├── keymap_es.c │ ├── keymap_et.c │ ├── keymap_fi.c │ ├── keymap_fr.c │ ├── keymap_gr.c │ ├── keymap_hu.c │ ├── keymap_il.c │ ├── keymap_it.c │ ├── keymap_lt.c │ ├── keymap_mk.c │ ├── keymap_mt.c │ ├── keymap_nl.c │ ├── keymap_no-latin1.c │ ├── keymap_no.c │ ├── keymap_pl.c │ ├── keymap_pt.c │ ├── keymap_ro.c │ ├── keymap_ru.c │ ├── keymap_se.c │ ├── keymap_sg.c │ ├── keymap_sr-latin.c │ ├── keymap_ua.c │ ├── keymap_uk.c │ └── keymap_us.c ├── linux_args.c ├── mucurses │ ├── alert.c │ ├── ansi_screen.c │ ├── clear.c │ ├── colour.c │ ├── cursor.h │ ├── edging.c │ ├── kb.c │ ├── mucurses.c │ ├── mucurses.h │ ├── print.c │ ├── print_nadv.c │ ├── slk.c │ ├── widgets │ │ └── editbox.c │ ├── winattrs.c │ ├── windows.c │ └── wininit.c ├── readline.c ├── shell.c ├── strerror.c ├── tui │ ├── form_ui.c │ ├── login_ui.c │ ├── menu_ui.c │ ├── message.c │ └── settings_ui.c └── wireless_errors.c ├── image ├── der.c ├── efi_image.c ├── elf.c ├── embedded.c ├── gzip.c ├── pem.c ├── png.c ├── pnm.c ├── script.c ├── segment.c └── zlib.c ├── include ├── alloca.h ├── assert.h ├── bits │ ├── acpi.h │ ├── gdbmach.h │ ├── hyperv.h │ ├── iomap.h │ ├── mp.h │ ├── nap.h │ ├── pci_io.h │ ├── reboot.h │ ├── sanboot.h │ ├── smbios.h │ ├── tcpip.h │ ├── time.h │ ├── uaccess.h │ ├── uart.h │ ├── umalloc.h │ └── xen.h ├── byteswap.h ├── coff.h ├── compiler.h ├── cpu.h ├── ctype.h ├── curses.h ├── elf.h ├── endian.h ├── errno.h ├── etherboot.h ├── fs.h ├── getopt.h ├── hci │ └── ifmgmt_cmd.h ├── i82365.h ├── ipxe │ ├── acpi.h │ ├── acpimac.h │ ├── aes.h │ ├── ansicol.h │ ├── ansiesc.h │ ├── aoe.h │ ├── api.h │ ├── arc4.h │ ├── arp.h │ ├── asn1.h │ ├── ata.h │ ├── base16.h │ ├── base64.h │ ├── bigint.h │ ├── bitbash.h │ ├── bitmap.h │ ├── bitops.h │ ├── blockdev.h │ ├── blocktrans.h │ ├── bofm.h │ ├── cachedhcp.h │ ├── cbc.h │ ├── cdc.h │ ├── certstore.h │ ├── chap.h │ ├── cms.h │ ├── command.h │ ├── console.h │ ├── cpio.h │ ├── crc32.h │ ├── crypto.h │ ├── deflate.h │ ├── der.h │ ├── des.h │ ├── device.h │ ├── dhcp.h │ ├── dhcparch.h │ ├── dhcpopts.h │ ├── dhcppkt.h │ ├── dhcpv6.h │ ├── dhe.h │ ├── dma.h │ ├── dns.h │ ├── downloader.h │ ├── drbg.h │ ├── dummy_pio.h │ ├── dummy_sanboot.h │ ├── dynui.h │ ├── eap.h │ ├── eapol.h │ ├── ecam.h │ ├── ecam_io.h │ ├── ecb.h │ ├── ecdhe.h │ ├── edd.h │ ├── editbox.h │ ├── editstring.h │ ├── efi │ │ ├── AArch64 │ │ │ └── ProcessorBind.h │ │ ├── Arm │ │ │ └── ProcessorBind.h │ │ ├── Base.h │ │ ├── Guid │ │ │ ├── Acpi.h │ │ │ ├── FileInfo.h │ │ │ ├── FileSystemInfo.h │ │ │ ├── HiiFormMapMethodGuid.h │ │ │ ├── HiiPlatformSetupFormset.h │ │ │ ├── MdeModuleHii.h │ │ │ ├── PcAnsi.h │ │ │ ├── Rng.h │ │ │ ├── SmBios.h │ │ │ └── WinCertificate.h │ │ ├── Ia32 │ │ │ └── ProcessorBind.h │ │ ├── IndustryStandard │ │ │ ├── Acpi10.h │ │ │ ├── Acpi20.h │ │ │ ├── Acpi30.h │ │ │ ├── Acpi40.h │ │ │ ├── Acpi50.h │ │ │ ├── Acpi51.h │ │ │ ├── Acpi60.h │ │ │ ├── AcpiAml.h │ │ │ ├── Bluetooth.h │ │ │ ├── Pci22.h │ │ │ ├── PeImage.h │ │ │ ├── Tpm12.h │ │ │ ├── Tpm20.h │ │ │ ├── UefiTcgPlatform.h │ │ │ └── Usb.h │ │ ├── LICENCE │ │ ├── Library │ │ │ └── BaseLib.h │ │ ├── LoongArch64 │ │ │ └── ProcessorBind.h │ │ ├── Pi │ │ │ ├── PiBootMode.h │ │ │ ├── PiDependency.h │ │ │ ├── PiDxeCis.h │ │ │ ├── PiFirmwareFile.h │ │ │ ├── PiFirmwareVolume.h │ │ │ ├── PiHob.h │ │ │ ├── PiMultiPhase.h │ │ │ ├── PiS3BootScript.h │ │ │ └── PiStatusCode.h │ │ ├── PiDxe.h │ │ ├── ProcessorBind.h │ │ ├── Protocol │ │ │ ├── AbsolutePointer.h │ │ │ ├── AcpiTable.h │ │ │ ├── AppleNetBoot.h │ │ │ ├── Arp.h │ │ │ ├── BlockIo.h │ │ │ ├── BlockIo2.h │ │ │ ├── BusSpecificDriverOverride.h │ │ │ ├── ComponentName.h │ │ │ ├── ComponentName2.h │ │ │ ├── ConsoleControl │ │ │ │ └── ConsoleControl.h │ │ │ ├── DebugSupport.h │ │ │ ├── DevicePath.h │ │ │ ├── DevicePathToText.h │ │ │ ├── Dhcp4.h │ │ │ ├── Dhcp6.h │ │ │ ├── DiskIo.h │ │ │ ├── Dns4.h │ │ │ ├── Dns6.h │ │ │ ├── DriverBinding.h │ │ │ ├── FormBrowser2.h │ │ │ ├── GraphicsOutput.h │ │ │ ├── HiiConfigAccess.h │ │ │ ├── HiiDatabase.h │ │ │ ├── HiiFont.h │ │ │ ├── HiiImage.h │ │ │ ├── Http.h │ │ │ ├── Ip4.h │ │ │ ├── Ip4Config.h │ │ │ ├── Ip4Config2.h │ │ │ ├── Ip6.h │ │ │ ├── Ip6Config.h │ │ │ ├── LoadFile.h │ │ │ ├── LoadFile2.h │ │ │ ├── LoadedImage.h │ │ │ ├── ManagedNetwork.h │ │ │ ├── MpService.h │ │ │ ├── Mtftp4.h │ │ │ ├── Mtftp6.h │ │ │ ├── NetworkInterfaceIdentifier.h │ │ │ ├── PciIo.h │ │ │ ├── PciRootBridgeIo.h │ │ │ ├── PxeBaseCode.h │ │ │ ├── Rng.h │ │ │ ├── SerialIo.h │ │ │ ├── ServiceBinding.h │ │ │ ├── ShimLock.h │ │ │ ├── SimpleFileSystem.h │ │ │ ├── SimpleNetwork.h │ │ │ ├── SimplePointer.h │ │ │ ├── SimpleTextIn.h │ │ │ ├── SimpleTextInEx.h │ │ │ ├── SimpleTextOut.h │ │ │ ├── Tcg2Protocol.h │ │ │ ├── TcgService.h │ │ │ ├── Tcp4.h │ │ │ ├── Tcp6.h │ │ │ ├── Udp4.h │ │ │ ├── Udp6.h │ │ │ ├── UgaDraw.h │ │ │ ├── UnicodeCollation.h │ │ │ ├── Usb2HostController.h │ │ │ ├── UsbHostController.h │ │ │ ├── UsbIo.h │ │ │ └── VlanConfig.h │ │ ├── RiscV64 │ │ │ └── ProcessorBind.h │ │ ├── Uefi.h │ │ ├── Uefi │ │ │ ├── UefiBaseType.h │ │ │ ├── UefiGpt.h │ │ │ ├── UefiInternalFormRepresentation.h │ │ │ ├── UefiMultiPhase.h │ │ │ ├── UefiPxe.h │ │ │ └── UefiSpec.h │ │ ├── X64 │ │ │ └── ProcessorBind.h │ │ ├── efi.h │ │ ├── efi_acpi.h │ │ ├── efi_autoboot.h │ │ ├── efi_autoexec.h │ │ ├── efi_block.h │ │ ├── efi_cachedhcp.h │ │ ├── efi_cmdline.h │ │ ├── efi_download.h │ │ ├── efi_driver.h │ │ ├── efi_file.h │ │ ├── efi_hii.h │ │ ├── efi_image.h │ │ ├── efi_mp.h │ │ ├── efi_nap.h │ │ ├── efi_null.h │ │ ├── efi_path.h │ │ ├── efi_pci.h │ │ ├── efi_pci_api.h │ │ ├── efi_pxe.h │ │ ├── efi_reboot.h │ │ ├── efi_service.h │ │ ├── efi_shim.h │ │ ├── efi_smbios.h │ │ ├── efi_snp.h │ │ ├── efi_strings.h │ │ ├── efi_time.h │ │ ├── efi_umalloc.h │ │ ├── efi_usb.h │ │ ├── efi_utils.h │ │ ├── efi_veto.h │ │ ├── efi_watchdog.h │ │ ├── efi_wrap.h │ │ ├── import.pl │ │ └── mnpnet.h │ ├── eisa.h │ ├── elf.h │ ├── eltorito.h │ ├── entropy.h │ ├── eoib.h │ ├── errfile.h │ ├── errno │ │ ├── efi.h │ │ └── linux.h │ ├── errortab.h │ ├── eth_slow.h │ ├── ethernet.h │ ├── fakedhcp.h │ ├── fault.h │ ├── fbcon.h │ ├── fc.h │ ├── fcels.h │ ├── fcns.h │ ├── fcoe.h │ ├── fcp.h │ ├── fdt.h │ ├── features.h │ ├── fip.h │ ├── fragment.h │ ├── ftp.h │ ├── gcm.h │ ├── gdbserial.h │ ├── gdbstub.h │ ├── gdbudp.h │ ├── gzip.h │ ├── hash_df.h │ ├── hidemem.h │ ├── hmac.h │ ├── hmac_drbg.h │ ├── http.h │ ├── hyperv.h │ ├── i2c.h │ ├── ib_cm.h │ ├── ib_cmrc.h │ ├── ib_mad.h │ ├── ib_mcast.h │ ├── ib_mi.h │ ├── ib_packet.h │ ├── ib_pathrec.h │ ├── ib_service.h │ ├── ib_sma.h │ ├── ib_smc.h │ ├── ib_srp.h │ ├── ibft.h │ ├── icmp.h │ ├── icmpv6.h │ ├── ieee80211.h │ ├── if_arp.h │ ├── if_ether.h │ ├── image.h │ ├── in.h │ ├── infiniband.h │ ├── init.h │ ├── interface.h │ ├── io.h │ ├── iobuf.h │ ├── iomap.h │ ├── iomap_virt.h │ ├── ip.h │ ├── ipoib.h │ ├── ipstat.h │ ├── ipv6.h │ ├── isa.h │ ├── isa_ids.h │ ├── isapnp.h │ ├── iscsi.h │ ├── iso9660.h │ ├── isqrt.h │ ├── job.h │ ├── jumpscroll.h │ ├── keymap.h │ ├── keys.h │ ├── label.h │ ├── linebuf.h │ ├── lineconsole.h │ ├── linux.h │ ├── linux │ │ ├── dhcparch.h │ │ ├── linux_acpi.h │ │ ├── linux_nap.h │ │ ├── linux_pci.h │ │ ├── linux_smbios.h │ │ ├── linux_time.h │ │ ├── linux_uaccess.h │ │ └── linux_umalloc.h │ ├── linux_api.h │ ├── linux_sysfs.h │ ├── list.h │ ├── lldp.h │ ├── login_ui.h │ ├── malloc.h │ ├── mca.h │ ├── md4.h │ ├── md5.h │ ├── memblock.h │ ├── message.h │ ├── mii.h │ ├── mii_bit.h │ ├── monojob.h │ ├── mount.h │ ├── mp.h │ ├── mschapv2.h │ ├── nap.h │ ├── ndp.h │ ├── neighbour.h │ ├── net80211.h │ ├── net80211_err.h │ ├── netbios.h │ ├── netdevice.h │ ├── nfs.h │ ├── nfs_open.h │ ├── nfs_uri.h │ ├── nonxen.h │ ├── ntlm.h │ ├── ntp.h │ ├── null_acpi.h │ ├── null_mp.h │ ├── null_nap.h │ ├── null_pci.h │ ├── null_reboot.h │ ├── null_sanboot.h │ ├── null_smbios.h │ ├── null_time.h │ ├── nvo.h │ ├── nvs.h │ ├── nvsvpd.h │ ├── ocsp.h │ ├── oncrpc.h │ ├── oncrpc_iob.h │ ├── open.h │ ├── p256.h │ ├── p384.h │ ├── params.h │ ├── parseopt.h │ ├── pccrc.h │ ├── pccrd.h │ ├── pccrr.h │ ├── pci.h │ ├── pci_io.h │ ├── pcibackup.h │ ├── pcibridge.h │ ├── pciea.h │ ├── pcimsix.h │ ├── pcivpd.h │ ├── peerblk.h │ ├── peerdisc.h │ ├── peermux.h │ ├── pem.h │ ├── pending.h │ ├── ping.h │ ├── pinger.h │ ├── pixbuf.h │ ├── png.h │ ├── pnm.h │ ├── pool.h │ ├── portmap.h │ ├── posix_io.h │ ├── privkey.h │ ├── process.h │ ├── profile.h │ ├── pseudobit.h │ ├── quiesce.h │ ├── random_nz.h │ ├── rarp.h │ ├── rbg.h │ ├── rc80211.h │ ├── reboot.h │ ├── refcnt.h │ ├── resolv.h │ ├── retry.h │ ├── rndis.h │ ├── rootcert.h │ ├── rotate.h │ ├── rsa.h │ ├── sanboot.h │ ├── sbat.h │ ├── script.h │ ├── scsi.h │ ├── sec80211.h │ ├── segment.h │ ├── serial.h │ ├── settings.h │ ├── settings_ui.h │ ├── sha1.h │ ├── sha256.h │ ├── sha512.h │ ├── shell.h │ ├── slirp.h │ ├── smbios.h │ ├── socket.h │ ├── spi.h │ ├── spi_bit.h │ ├── srp.h │ ├── stp.h │ ├── string.h │ ├── syslog.h │ ├── tables.h │ ├── tcp.h │ ├── tcpip.h │ ├── test.h │ ├── tftp.h │ ├── threewire.h │ ├── time.h │ ├── timer.h │ ├── tls.h │ ├── uaccess.h │ ├── uart.h │ ├── udp.h │ ├── umalloc.h │ ├── uri.h │ ├── usb.h │ ├── usbhid.h │ ├── usbnet.h │ ├── utf8.h │ ├── uuid.h │ ├── validator.h │ ├── version.h │ ├── virtio-pci.h │ ├── virtio-ring.h │ ├── vlan.h │ ├── vmbus.h │ ├── vsprintf.h │ ├── weierstrass.h │ ├── widget.h │ ├── wpa.h │ ├── x25519.h │ ├── x509.h │ ├── xen.h │ ├── xenbus.h │ ├── xenevent.h │ ├── xengrant.h │ ├── xenmem.h │ ├── xenstore.h │ ├── xenver.h │ ├── xfer.h │ ├── xferbuf.h │ ├── xsigo.h │ └── zlib.h ├── libgen.h ├── mii.h ├── nic.h ├── old_tcp.h ├── pc_kbd.h ├── pcmcia-opts.h ├── pcmcia.h ├── readline │ └── readline.h ├── setjmp.h ├── stdarg.h ├── stdbool.h ├── stddef.h ├── stdint.h ├── stdio.h ├── stdlib.h ├── string.h ├── strings.h ├── sys │ └── time.h ├── sys_info.h ├── syslog.h ├── time.h ├── unistd.h ├── usr │ ├── autoboot.h │ ├── certmgmt.h │ ├── dhcpmgmt.h │ ├── fcmgmt.h │ ├── ibmgmt.h │ ├── ifmgmt.h │ ├── imgarchive.h │ ├── imgcrypt.h │ ├── imgmgmt.h │ ├── imgtrust.h │ ├── ipstat.h │ ├── iwmgmt.h │ ├── lotest.h │ ├── neighmgmt.h │ ├── nslookup.h │ ├── ntpmgmt.h │ ├── pingmgmt.h │ ├── profstat.h │ ├── prompt.h │ ├── route.h │ ├── shimmgmt.h │ └── sync.h ├── valgrind │ ├── memcheck.h │ └── valgrind.h ├── wchar.h └── xen │ ├── arch-arm.h │ ├── arch-x86 │ ├── xen-x86_32.h │ ├── xen-x86_64.h │ └── xen.h │ ├── event_channel.h │ ├── features.h │ ├── grant_table.h │ ├── hvm │ ├── hvm_op.h │ └── params.h │ ├── import.pl │ ├── io │ ├── netif.h │ ├── ring.h │ ├── xenbus.h │ └── xs_wire.h │ ├── memory.h │ ├── physdev.h │ ├── trace.h │ ├── version.h │ ├── xen-compat.h │ └── xen.h ├── interface ├── bofm │ └── bofm.c ├── efi │ ├── efi_acpi.c │ ├── efi_autoboot.c │ ├── efi_autoexec.c │ ├── efi_block.c │ ├── efi_bofm.c │ ├── efi_cachedhcp.c │ ├── efi_cmdline.c │ ├── efi_console.c │ ├── efi_debug.c │ ├── efi_download.c │ ├── efi_driver.c │ ├── efi_entropy.c │ ├── efi_fbcon.c │ ├── efi_fdt.c │ ├── efi_file.c │ ├── efi_guid.c │ ├── efi_hii.c │ ├── efi_init.c │ ├── efi_local.c │ ├── efi_mp.c │ ├── efi_nap.c │ ├── efi_null.c │ ├── efi_path.c │ ├── efi_pci.c │ ├── efi_pxe.c │ ├── efi_reboot.c │ ├── efi_rng.c │ ├── efi_service.c │ ├── efi_settings.c │ ├── efi_shim.c │ ├── efi_smbios.c │ ├── efi_snp.c │ ├── efi_snp_hii.c │ ├── efi_strings.c │ ├── efi_time.c │ ├── efi_timer.c │ ├── efi_umalloc.c │ ├── efi_usb.c │ ├── efi_utils.c │ ├── efi_veto.c │ ├── efi_watchdog.c │ ├── efi_wrap.c │ ├── efidrvprefix.c │ └── efiprefix.c ├── hyperv │ └── vmbus.c ├── linux │ ├── linux_acpi.c │ ├── linux_api.c │ ├── linux_console.c │ ├── linux_entropy.c │ ├── linux_nap.c │ ├── linux_pci.c │ ├── linux_smbios.c │ ├── linux_sysfs.c │ ├── linux_time.c │ ├── linux_timer.c │ ├── linux_uaccess.c │ ├── linux_umalloc.c │ └── linuxprefix.c ├── smbios │ ├── smbios.c │ └── smbios_settings.c └── xen │ ├── xenbus.c │ ├── xengrant.c │ └── xenstore.c ├── libgcc ├── __divdi3.c ├── __divmoddi4.c ├── __moddi3.c ├── __udivdi3.c ├── __udivmoddi4.c ├── __umoddi3.c ├── icc.c ├── implicit.c └── libgcc.h ├── net ├── 80211 │ ├── net80211.c │ ├── rc80211.c │ ├── sec80211.c │ ├── wep.c │ ├── wpa.c │ ├── wpa_ccmp.c │ ├── wpa_psk.c │ └── wpa_tkip.c ├── aoe.c ├── arp.c ├── dhcpopts.c ├── dhcppkt.c ├── eap.c ├── eap_md5.c ├── eap_mschapv2.c ├── eapol.c ├── eth_slow.c ├── ethernet.c ├── fakedhcp.c ├── fc.c ├── fcels.c ├── fcns.c ├── fcoe.c ├── fcp.c ├── fragment.c ├── icmp.c ├── icmpv4.c ├── icmpv6.c ├── infiniband.c ├── infiniband │ ├── ib_cm.c │ ├── ib_cmrc.c │ ├── ib_mcast.c │ ├── ib_mi.c │ ├── ib_packet.c │ ├── ib_pathrec.c │ ├── ib_service.c │ ├── ib_sma.c │ ├── ib_smc.c │ ├── ib_srp.c │ └── xsigo.c ├── iobpad.c ├── ipv4.c ├── ipv6.c ├── lldp.c ├── ndp.c ├── neighbour.c ├── netdev_settings.c ├── netdevice.c ├── nullnet.c ├── oncrpc │ ├── mount.c │ ├── nfs.c │ ├── nfs_open.c │ ├── nfs_uri.c │ ├── oncrpc_iob.c │ └── portmap.c ├── pccrc.c ├── pccrd.c ├── peerblk.c ├── peerdisc.c ├── peerdist.c ├── peermux.c ├── ping.c ├── rarp.c ├── retry.c ├── rndis.c ├── socket.c ├── stp.c ├── tcp.c ├── tcp │ ├── ftp.c │ ├── http.c │ ├── httpauth.c │ ├── httpbasic.c │ ├── httpblock.c │ ├── httpconn.c │ ├── httpcore.c │ ├── httpdigest.c │ ├── httpgce.c │ ├── httpntlm.c │ ├── https.c │ ├── iscsi.c │ ├── oncrpc.c │ └── syslogs.c ├── tcpip.c ├── tls.c ├── udp.c ├── udp │ ├── dhcp.c │ ├── dhcpv6.c │ ├── dns.c │ ├── ntp.c │ ├── slam.c │ ├── syslog.c │ └── tftp.c ├── validator.c └── vlan.c ├── scripts ├── efi.lds └── linux.lds ├── tests ├── acpi_test.c ├── aes_test.c ├── asn1_test.c ├── asn1_test.h ├── base16_test.c ├── base64_test.c ├── bigint_test.c ├── bitops_test.c ├── bofm_test.c ├── byteswap_test.c ├── cipher_test.c ├── cipher_test.h ├── cms_test.c ├── crc32_test.c ├── deflate_test.c ├── der_test.c ├── des_test.c ├── dhe_test.c ├── digest_test.c ├── digest_test.h ├── dns_test.c ├── editstring_test.c ├── elliptic_test.c ├── elliptic_test.h ├── entropy_sample.c ├── gcm_test.c ├── gzip_test.c ├── hash_df_test.c ├── hmac_drbg_test.c ├── hmac_test.c ├── iobuf_test.c ├── ipv4_test.c ├── ipv6_test.c ├── linebuf_test.c ├── list_test.c ├── math_test.c ├── md4_test.c ├── md5_test.c ├── memcpy_test.c ├── memset_test.c ├── mschapv2_test.c ├── nap_test.c ├── ntlm_test.c ├── ocsp_test.c ├── p256_test.c ├── p384_test.c ├── pccrc_test.c ├── pem_test.c ├── pixbuf_test.c ├── pixbuf_test.h ├── png_test.c ├── pnm_test.c ├── profile_test.c ├── pubkey_test.c ├── pubkey_test.h ├── rsa_test.c ├── setjmp_test.c ├── settings_test.c ├── sha1_test.c ├── sha256_test.c ├── sha512_test.c ├── string_test.c ├── tcpip_test.c ├── test.c ├── tests.c ├── time_test.c ├── umalloc_test.c ├── uri_test.c ├── utf8_test.c ├── uuid_test.c ├── vsprintf_test.c ├── x25519_test.c ├── x509_test.c └── zlib_test.c ├── usr ├── autoboot.c ├── certmgmt.c ├── dhcpmgmt.c ├── fcmgmt.c ├── ibmgmt.c ├── ifmgmt.c ├── imgarchive.c ├── imgcrypt.c ├── imgmgmt.c ├── imgtrust.c ├── ipstat.c ├── iwmgmt.c ├── lotest.c ├── neighmgmt.c ├── nslookup.c ├── ntpmgmt.c ├── pingmgmt.c ├── profstat.c ├── prompt.c ├── pxemenu.c ├── route.c ├── route_ipv4.c ├── route_ipv6.c ├── shimmgmt.c └── sync.c └── util ├── .gitignore ├── Makefile ├── Option └── ROM.pm ├── catrom.pl ├── diffsize.pl ├── disrom.pl ├── eficompress.c ├── efifatbin.c ├── efirom.c ├── einfo.c ├── elf2efi.c ├── fixrom.pl ├── fnrec.pl ├── genfsimg ├── genkeymap.py ├── get-pci-ids ├── hijack.c ├── licence.pl ├── mergerom.pl ├── modrom.pl ├── mucurses_test.c ├── niclist.pl ├── nrv2b.c ├── padimg.pl ├── parserom.pl ├── relicense.pl ├── romcheck.pl ├── sortobjdump.pl ├── swapdevids.pl ├── symcheck.pl └── zbin.c /COPYING: -------------------------------------------------------------------------------- 1 | In general iPXE files are licensed under the GPL. For historical 2 | reasons, individual files may contain their own licence declarations. 3 | Most builds of iPXE do not contain all iPXE code (in particular, most 4 | builds will include only one driver), and so the overall licence can 5 | vary depending on what target you are building. 6 | 7 | The resultant applicable licence(s) for any particular build can be 8 | determined by using "make bin/xxxxxxx.yyy.licence"; for example: 9 | 10 | make bin/rtl8139.rom.licence 11 | 12 | to determine the resultant licence(s) for the build bin/rtl8139.rom 13 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | iPXE README File 2 | 3 | Quick start guide: 4 | 5 | cd src 6 | make 7 | 8 | For any more detailed instructions, see http://ipxe.org 9 | -------------------------------------------------------------------------------- /contrib/README: -------------------------------------------------------------------------------- 1 | Most of the content that was previously in this directory has been 2 | moved to a separate git repository: 3 | 4 | http://git.etherboot.org/?p=contrib.git;a=summary 5 | 6 | or the Etherboot Project wiki: 7 | 8 | http://etherboot.org/ 9 | 10 | -------------------------------------------------------------------------------- /contrib/coverity/model.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Coverity modelling file 3 | * 4 | */ 5 | 6 | typedef long off_t; 7 | typedef void * userptr_t; 8 | typedef long long time_t; 9 | struct tm; 10 | typedef unsigned short wchar_t; 11 | typedef void mbstate_t; 12 | struct digest_algorithm; 13 | 14 | /* Inhibit use of built-in models for functions where Coverity's 15 | * assumptions about the modelled function are incorrect for iPXE. 16 | */ 17 | char * strerror ( int errno ) { 18 | } 19 | void copy_from_user ( void *dest, userptr_t src, off_t src_off, size_t len ) { 20 | } 21 | time_t mktime ( struct tm *tm ) { 22 | } 23 | int getchar ( void ) { 24 | } 25 | size_t wcrtomb ( char *buf, wchar_t wc, mbstate_t *ps ) { 26 | } 27 | void hmac_init ( struct digest_algorithm *digest, void *digest_ctx, 28 | void *key, size_t *key_len ) { 29 | } 30 | -------------------------------------------------------------------------------- /contrib/errdb/.gitignore: -------------------------------------------------------------------------------- 1 | errors.db 2 | -------------------------------------------------------------------------------- /contrib/vm/.gitignore: -------------------------------------------------------------------------------- 1 | bochsout.txt 2 | parport.out 3 | ne2k-tx.log 4 | ne2k-txdump.txt 5 | bochs 6 | qemu 7 | -------------------------------------------------------------------------------- /contrib/vm/Makefile: -------------------------------------------------------------------------------- 1 | all : serial-console.1 2 | 3 | %.1 : % 4 | pod2man $< > $@ 5 | 6 | clean : 7 | rm -f serial-console.1 8 | -------------------------------------------------------------------------------- /contrib/vm/bochs-writable-ROM-patch: -------------------------------------------------------------------------------- 1 | --- memory/memory.cc 18 Oct 2008 18:10:14 -0000 1.71 2 | +++ memory/memory.cc 21 Oct 2008 19:47:07 -0000 3 | @@ -172,7 +172,11 @@ 4 | break; 5 | 6 | case 0x0: // Writes to ROM, Inhibit 7 | - BX_DEBUG(("Write to ROM ignored: address 0x" FMT_PHY_ADDRX ", data %02x", a20addr, *data_ptr)); 8 | + if ((a20addr & 0xfffe0000) == 0x000e0000) { 9 | + BX_DEBUG(("Write to ROM ignored: address 0x" FMT_PHY_ADDRX ", data %02x", a20addr, *data_ptr)); 10 | + } else { 11 | + BX_MEM_THIS rom[(a20addr & EXROM_MASK) + BIOSROMSZ] = *data_ptr; 12 | + } 13 | break; 14 | 15 | default: 16 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | .toolcheck 2 | .echocheck 3 | TAGS* 4 | bin-* 5 | -------------------------------------------------------------------------------- /src/arch/arm/Makefile: -------------------------------------------------------------------------------- 1 | # Assembler section type character 2 | # 3 | ASM_TCHAR := % 4 | ASM_TCHAR_OPS := %% 5 | 6 | # Include ARM-specific headers 7 | # 8 | INCDIRS := arch/$(ARCH)/include arch/arm/include $(INCDIRS) 9 | 10 | # ARM-specific directories containing source files 11 | # 12 | SRCDIRS += arch/arm/core 13 | SRCDIRS += arch/arm/interface/efi 14 | -------------------------------------------------------------------------------- /src/arch/arm/Makefile.efi: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Include generic EFI Makefile 4 | # 5 | MAKEDEPS += Makefile.efi 6 | include Makefile.efi 7 | -------------------------------------------------------------------------------- /src/arch/arm/Makefile.linux: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Include generic Linux Makefile 4 | # 5 | MAKEDEPS += Makefile.linux 6 | include Makefile.linux 7 | -------------------------------------------------------------------------------- /src/arch/arm/include/bits/endian.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_ENDIAN_H 2 | #define _BITS_ENDIAN_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | /* ARM may be either little-endian or big-endian */ 7 | #ifdef __ARM_BIG_ENDIAN 8 | #define __BYTE_ORDER __BIG_ENDIAN 9 | #else 10 | #define __BYTE_ORDER __LITTLE_ENDIAN 11 | #endif 12 | 13 | #endif /* _BITS_ENDIAN_H */ 14 | -------------------------------------------------------------------------------- /src/arch/arm/include/bits/errfile.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_ERRFILE_H 2 | #define _BITS_ERRFILE_H 3 | 4 | /** @file 5 | * 6 | * ARM-specific error file identifiers 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** 13 | * @addtogroup errfile Error file identifiers 14 | * @{ 15 | */ 16 | 17 | /** @} */ 18 | 19 | #endif /* _BITS_ERRFILE_H */ 20 | -------------------------------------------------------------------------------- /src/arch/arm/include/bits/io.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_IO_H 2 | #define _BITS_IO_H 3 | 4 | /** @file 5 | * 6 | * ARM-specific I/O API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** Page shift */ 13 | #define PAGE_SHIFT 12 14 | 15 | #include 16 | 17 | #endif /* _BITS_IO_H */ 18 | -------------------------------------------------------------------------------- /src/arch/arm/include/bits/nap.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_NAP_H 2 | #define _BITS_NAP_H 3 | 4 | /** @file 5 | * 6 | * ARM-specific CPU sleeping API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** 13 | * Sleep until next CPU interrupt 14 | * 15 | */ 16 | static inline __attribute__ (( always_inline )) void cpu_halt ( void ) { 17 | __asm__ __volatile__ ( "wfi" ); 18 | } 19 | 20 | #endif /* _BITS_NAP_H */ 21 | -------------------------------------------------------------------------------- /src/arch/arm32/Makefile: -------------------------------------------------------------------------------- 1 | # ARM32-specific directories containing source files 2 | # 3 | SRCDIRS += arch/arm32/core 4 | SRCDIRS += arch/arm32/libgcc 5 | 6 | # ARM32-specific flags 7 | # 8 | CFLAGS += -mthumb -mcpu=cortex-a15 -mabi=aapcs 9 | CFLAGS += -mword-relocations 10 | ASFLAGS += -mthumb -mcpu=cortex-a15 11 | 12 | # EFI requires -fshort-wchar, and nothing else currently uses wchar_t 13 | # 14 | CFLAGS += -fshort-wchar 15 | 16 | # EFI requires that enums are always 32 bits, and nothing else 17 | # currently cares 18 | # 19 | CFLAGS += -fno-short-enums 20 | 21 | # Include common ARM Makefile 22 | MAKEDEPS += arch/arm/Makefile 23 | include arch/arm/Makefile 24 | 25 | # Include platform-specific Makefile 26 | # 27 | MAKEDEPS += arch/arm32/Makefile.$(PLATFORM) 28 | include arch/arm32/Makefile.$(PLATFORM) 29 | -------------------------------------------------------------------------------- /src/arch/arm32/Makefile.efi: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # EFI uses the soft float ABI 4 | # 5 | CFLAGS += -mfloat-abi=soft 6 | 7 | # Specify EFI image builder 8 | # 9 | ELF2EFI = $(ELF2EFI32) 10 | 11 | # Include generic EFI Makefile 12 | # 13 | MAKEDEPS += arch/arm/Makefile.efi 14 | include arch/arm/Makefile.efi 15 | -------------------------------------------------------------------------------- /src/arch/arm32/core/setjmp.S: -------------------------------------------------------------------------------- 1 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) 2 | 3 | .section ".note.GNU-stack", "", %progbits 4 | .text 5 | .arm 6 | 7 | /* 8 | * Save stack context for non-local goto 9 | */ 10 | .globl setjmp 11 | .type setjmp, %function 12 | setjmp: 13 | /* Store registers */ 14 | stmia r0, { r4, r5, r6, r7, r8, r9, r10, fp, sp, lr } 15 | /* Return 0 when returning as setjmp() */ 16 | mov r0, #0 17 | bx lr 18 | .size setjmp, . - setjmp 19 | 20 | /* 21 | * Non-local jump to a saved stack context 22 | */ 23 | .globl longjmp 24 | .type longjmp, %function 25 | longjmp: 26 | /* Restore registers */ 27 | ldmia r0, { r4, r5, r6, r7, r8, r9, r10, fp, sp, lr } 28 | /* Force result to non-zero */ 29 | movs r0, r1 30 | moveq r0, #1 31 | /* Return to setjmp() caller */ 32 | bx lr 33 | .size longjmp, . - longjmp 34 | -------------------------------------------------------------------------------- /src/arch/arm32/include/bits/compiler.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_COMPILER_H 2 | #define _BITS_COMPILER_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | /** Dummy relocation type */ 7 | #define RELOC_TYPE_NONE R_ARM_NONE 8 | 9 | #ifndef ASSEMBLY 10 | 11 | /** Unprefixed constant operand modifier */ 12 | #define ASM_NO_PREFIX "c" 13 | 14 | #define __asmcall 15 | #define __libgcc 16 | 17 | #endif /* ASSEMBLY */ 18 | 19 | #endif /*_BITS_COMPILER_H */ 20 | -------------------------------------------------------------------------------- /src/arch/arm32/include/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_SETJMP_H 2 | #define _BITS_SETJMP_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #include 7 | 8 | /** A jump buffer */ 9 | typedef struct { 10 | /** Saved r4 */ 11 | uint32_t r4; 12 | /** Saved r5 */ 13 | uint32_t r5; 14 | /** Saved r6 */ 15 | uint32_t r6; 16 | /** Saved r7 */ 17 | uint32_t r7; 18 | /** Saved r8 */ 19 | uint32_t r8; 20 | /** Saved r9 */ 21 | uint32_t r9; 22 | /** Saved r10 */ 23 | uint32_t r10; 24 | /** Saved frame pointer (r11) */ 25 | uint32_t fp; 26 | /** Saved stack pointer (r13) */ 27 | uint32_t sp; 28 | /** Saved link register (r14) */ 29 | uint32_t lr; 30 | } jmp_buf[1]; 31 | 32 | #endif /* _BITS_SETJMP_H */ 33 | -------------------------------------------------------------------------------- /src/arch/arm32/include/bits/stdint.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_STDINT_H 2 | #define _BITS_STDINT_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | typedef __SIZE_TYPE__ size_t; 7 | typedef signed long ssize_t; 8 | typedef signed long off_t; 9 | 10 | typedef unsigned char uint8_t; 11 | typedef unsigned short uint16_t; 12 | typedef unsigned int uint32_t; 13 | typedef unsigned long long uint64_t; 14 | 15 | typedef signed char int8_t; 16 | typedef signed short int16_t; 17 | typedef signed int int32_t; 18 | typedef signed long long int64_t; 19 | 20 | typedef unsigned long physaddr_t; 21 | typedef unsigned long intptr_t; 22 | 23 | #endif /* _BITS_STDINT_H */ 24 | -------------------------------------------------------------------------------- /src/arch/arm32/include/ipxe/efi/dhcparch.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_DHCPARCH_H 2 | #define _IPXE_EFI_DHCPARCH_H 3 | 4 | /** @file 5 | * 6 | * DHCP client architecture definitions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** DHCP client architecture */ 15 | #define DHCP_ARCH_CLIENT_ARCHITECTURE DHCP_CLIENT_ARCHITECTURE_ARM32 16 | 17 | /** DHCP client network device interface */ 18 | #define DHCP_ARCH_CLIENT_NDI 1 /* UNDI */ , 3, 10 /* v3.10 */ 19 | 20 | #endif /* _IPXE_EFI_DHCPARCH_H */ 21 | -------------------------------------------------------------------------------- /src/arch/arm64/Makefile.efi: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Specify EFI image builder 4 | # 5 | ELF2EFI = $(ELF2EFI64) 6 | 7 | # Include generic EFI Makefile 8 | # 9 | MAKEDEPS += arch/arm/Makefile.efi 10 | include arch/arm/Makefile.efi 11 | -------------------------------------------------------------------------------- /src/arch/arm64/Makefile.linux: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Starting virtual address 4 | # 5 | LDFLAGS += -Ttext=0x400000 6 | 7 | # Include generic Linux Makefile 8 | # 9 | MAKEDEPS += arch/arm/Makefile.linux 10 | include arch/arm/Makefile.linux 11 | -------------------------------------------------------------------------------- /src/arch/arm64/include/bits/compiler.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_COMPILER_H 2 | #define _BITS_COMPILER_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | /** Dummy relocation type */ 7 | #define RELOC_TYPE_NONE R_AARCH64_NULL 8 | 9 | #ifndef ASSEMBLY 10 | 11 | /** Unprefixed constant operand modifier */ 12 | #define ASM_NO_PREFIX "c" 13 | 14 | #define __asmcall 15 | #define __libgcc 16 | 17 | #endif /* ASSEMBLY */ 18 | 19 | #endif /*_BITS_COMPILER_H */ 20 | -------------------------------------------------------------------------------- /src/arch/arm64/include/bits/profile.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_PROFILE_H 2 | #define _BITS_PROFILE_H 3 | 4 | /** @file 5 | * 6 | * Profiling 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** 15 | * Get profiling timestamp 16 | * 17 | * @ret timestamp Timestamp 18 | */ 19 | static inline __attribute__ (( always_inline )) unsigned long 20 | profile_timestamp ( void ) { 21 | uint64_t cycles; 22 | 23 | /* Read cycle counter */ 24 | __asm__ __volatile__ ( "mrs %0, CNTVCT_EL0\n\t" : "=r" ( cycles ) ); 25 | return cycles; 26 | } 27 | 28 | #endif /* _BITS_PROFILE_H */ 29 | -------------------------------------------------------------------------------- /src/arch/arm64/include/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_SETJMP_H 2 | #define _BITS_SETJMP_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #include 7 | 8 | /** A jump buffer */ 9 | typedef struct { 10 | /** Saved x19 */ 11 | uint64_t x19; 12 | /** Saved x20 */ 13 | uint64_t x20; 14 | /** Saved x21 */ 15 | uint64_t x21; 16 | /** Saved x22 */ 17 | uint64_t x22; 18 | /** Saved x23 */ 19 | uint64_t x23; 20 | /** Saved x24 */ 21 | uint64_t x24; 22 | /** Saved x25 */ 23 | uint64_t x25; 24 | /** Saved x26 */ 25 | uint64_t x26; 26 | /** Saved x27 */ 27 | uint64_t x27; 28 | /** Saved x28 */ 29 | uint64_t x28; 30 | /** Saved frame pointer (x29) */ 31 | uint64_t x29; 32 | /** Saved link register (x30) */ 33 | uint64_t x30; 34 | /** Saved stack pointer (x31) */ 35 | uint64_t sp; 36 | } jmp_buf[1]; 37 | 38 | #endif /* _BITS_SETJMP_H */ 39 | -------------------------------------------------------------------------------- /src/arch/arm64/include/bits/stdint.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_STDINT_H 2 | #define _BITS_STDINT_H 3 | 4 | typedef __SIZE_TYPE__ size_t; 5 | typedef signed long ssize_t; 6 | typedef signed long off_t; 7 | 8 | typedef unsigned char uint8_t; 9 | typedef unsigned short uint16_t; 10 | typedef unsigned int uint32_t; 11 | typedef unsigned long long uint64_t; 12 | 13 | typedef signed char int8_t; 14 | typedef signed short int16_t; 15 | typedef signed int int32_t; 16 | typedef signed long long int64_t; 17 | 18 | typedef unsigned long physaddr_t; 19 | typedef unsigned long intptr_t; 20 | 21 | #endif /* _BITS_STDINT_H */ 22 | -------------------------------------------------------------------------------- /src/arch/arm64/include/bits/tcpip.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_TCPIP_H 2 | #define _BITS_TCPIP_H 3 | 4 | /** @file 5 | * 6 | * Transport-network layer interface 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern uint16_t tcpip_continue_chksum ( uint16_t sum, const void *data, 13 | size_t len ); 14 | 15 | #endif /* _BITS_TCPIP_H */ 16 | -------------------------------------------------------------------------------- /src/arch/arm64/include/ipxe/efi/dhcparch.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_DHCPARCH_H 2 | #define _IPXE_EFI_DHCPARCH_H 3 | 4 | /** @file 5 | * 6 | * DHCP client architecture definitions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** DHCP client architecture */ 15 | #define DHCP_ARCH_CLIENT_ARCHITECTURE DHCP_CLIENT_ARCHITECTURE_ARM64 16 | 17 | /** DHCP client network device interface */ 18 | #define DHCP_ARCH_CLIENT_NDI 1 /* UNDI */ , 3, 10 /* v3.10 */ 19 | 20 | #endif /* _IPXE_EFI_DHCPARCH_H */ 21 | -------------------------------------------------------------------------------- /src/arch/i386/Makefile.efi: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Specify EFI image builder 4 | # 5 | ELF2EFI = $(ELF2EFI32) 6 | 7 | # Use EFI ABI 8 | # 9 | CFLAGS += -malign-double 10 | 11 | # Include generic EFI Makefile 12 | # 13 | MAKEDEPS += arch/x86/Makefile.efi 14 | include arch/x86/Makefile.efi 15 | -------------------------------------------------------------------------------- /src/arch/i386/Makefile.linux: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Starting virtual address 4 | # 5 | LDFLAGS += -Ttext=0x08048000 6 | 7 | # Compiler flags for building host API wrapper 8 | # 9 | LINUX_CFLAGS += -m32 10 | 11 | # Include generic Linux Makefile 12 | # 13 | MAKEDEPS += arch/x86/Makefile.linux 14 | include arch/x86/Makefile.linux 15 | -------------------------------------------------------------------------------- /src/arch/i386/Makefile.pcbios: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Include generic BIOS Makefile 4 | # 5 | MAKEDEPS += arch/x86/Makefile.pcbios 6 | include arch/x86/Makefile.pcbios 7 | -------------------------------------------------------------------------------- /src/arch/i386/include/bits/profile.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_PROFILE_H 2 | #define _BITS_PROFILE_H 3 | 4 | /** @file 5 | * 6 | * Profiling 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** 15 | * Get profiling timestamp 16 | * 17 | * @ret timestamp Timestamp 18 | */ 19 | static inline __attribute__ (( always_inline )) unsigned long 20 | profile_timestamp ( void ) { 21 | uint32_t tsc; 22 | 23 | /* Read timestamp counter */ 24 | __asm__ __volatile__ ( "rdtsc" : "=a" ( tsc ) : : "edx" ); 25 | return tsc; 26 | } 27 | 28 | #endif /* _BITS_PROFILE_H */ 29 | -------------------------------------------------------------------------------- /src/arch/i386/include/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_SETJMP_H 2 | #define _BITS_SETJMP_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #include 7 | 8 | /** A jump buffer */ 9 | typedef struct { 10 | /** Saved return address */ 11 | uint32_t retaddr; 12 | /** Saved stack pointer */ 13 | uint32_t stack; 14 | /** Saved %ebx */ 15 | uint32_t ebx; 16 | /** Saved %esi */ 17 | uint32_t esi; 18 | /** Saved %edi */ 19 | uint32_t edi; 20 | /** Saved %ebp */ 21 | uint32_t ebp; 22 | } jmp_buf[1]; 23 | 24 | #endif /* _BITS_SETJMP_H */ 25 | -------------------------------------------------------------------------------- /src/arch/i386/include/bits/stdint.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_STDINT_H 2 | #define _BITS_STDINT_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | typedef __SIZE_TYPE__ size_t; 7 | typedef signed long ssize_t; 8 | typedef signed long off_t; 9 | 10 | typedef unsigned char uint8_t; 11 | typedef unsigned short uint16_t; 12 | typedef unsigned int uint32_t; 13 | typedef unsigned long long uint64_t; 14 | 15 | typedef signed char int8_t; 16 | typedef signed short int16_t; 17 | typedef signed int int32_t; 18 | typedef signed long long int64_t; 19 | 20 | typedef unsigned long physaddr_t; 21 | typedef unsigned long intptr_t; 22 | 23 | #endif /* _BITS_STDINT_H */ 24 | -------------------------------------------------------------------------------- /src/arch/i386/include/ipxe/efi/dhcparch.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_DHCPARCH_H 2 | #define _IPXE_EFI_DHCPARCH_H 3 | 4 | /** @file 5 | * 6 | * DHCP client architecture definitions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** DHCP client architecture */ 15 | #define DHCP_ARCH_CLIENT_ARCHITECTURE DHCP_CLIENT_ARCHITECTURE_IA32 16 | 17 | /** DHCP client network device interface */ 18 | #define DHCP_ARCH_CLIENT_NDI 1 /* UNDI */ , 3, 10 /* v3.10 */ 19 | 20 | #endif /* _IPXE_EFI_DHCPARCH_H */ 21 | -------------------------------------------------------------------------------- /src/arch/i386/include/ipxe/msr.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_MSR_H 2 | #define _IPXE_MSR_H 3 | 4 | /** @file 5 | * 6 | * Model-specific registers 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** 13 | * Read model-specific register 14 | * 15 | * @v msr Model-specific register 16 | * @ret value Value 17 | */ 18 | static inline __attribute__ (( always_inline )) uint64_t 19 | rdmsr ( unsigned int msr ) { 20 | uint64_t value; 21 | 22 | __asm__ __volatile__ ( "rdmsr" : "=A" ( value ) : "c" ( msr ) ); 23 | return value; 24 | } 25 | 26 | /** 27 | * Write model-specific register 28 | * 29 | * @v msr Model-specific register 30 | * @v value Value 31 | */ 32 | static inline __attribute__ (( always_inline )) void 33 | wrmsr ( unsigned int msr, uint64_t value ) { 34 | 35 | __asm__ __volatile__ ( "wrmsr" : : "c" ( msr ), "A" ( value ) ); 36 | } 37 | 38 | #endif /* _IPXE_MSR_H */ 39 | -------------------------------------------------------------------------------- /src/arch/i386/kir-Makefile: -------------------------------------------------------------------------------- 1 | # Makefile to build a KEEP_IT_REAL flavour 2 | # 3 | # KEEP_IT_REAL, by its nature, requires a different build of every 4 | # single object file, since the inclusion of ".code16gcc" will 5 | # generate different machine code from the assembly. Unlike the other 6 | # config options, there is no way that this global dependency can ever 7 | # be reduced, so it makes sense to be able to build both the normal 8 | # and the KIR versions without having to force a full rebuild each 9 | # time. 10 | 11 | # Add this Makefile to MAKEDEPS 12 | # 13 | MAKEDEPS += arch/i386/kir-Makefile 14 | 15 | # Place binaries in bin-kir 16 | # 17 | BIN = bin-kir 18 | 19 | # Compile with -DKEEP_IT_REAL, forcibly include kir.h at the start of 20 | # each file to drag in ".code16gcc" 21 | # 22 | CFLAGS += -DKEEP_IT_REAL -include kir.h 23 | 24 | include Makefile 25 | 26 | LDSCRIPT = arch/i386/scripts/i386-kir.lds 27 | -------------------------------------------------------------------------------- /src/arch/loong64/Makefile.efi: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Specify EFI image builder 4 | # 5 | ELF2EFI = $(ELF2EFI64) 6 | 7 | # Include generic EFI Makefile 8 | # 9 | MAKEDEPS += Makefile.efi 10 | include Makefile.efi 11 | -------------------------------------------------------------------------------- /src/arch/loong64/Makefile.linux: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Starting virtual address 4 | # 5 | LDFLAGS += -Ttext=0x120000000 6 | 7 | # Include generic Linux Makefile 8 | # 9 | MAKEDEPS += Makefile.linux 10 | include Makefile.linux 11 | -------------------------------------------------------------------------------- /src/arch/loong64/include/bits/compiler.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_COMPILER_H 2 | #define _BITS_COMPILER_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | /** Dummy relocation type */ 7 | #define RELOC_TYPE_NONE R_LARCH_NONE 8 | 9 | #ifndef ASSEMBLY 10 | 11 | /** Unprefixed constant operand modifier */ 12 | #define ASM_NO_PREFIX "a" 13 | 14 | #define __asmcall 15 | #define __libgcc 16 | 17 | #endif /* ASSEMBLY */ 18 | 19 | #endif /*_BITS_COMPILER_H */ 20 | -------------------------------------------------------------------------------- /src/arch/loong64/include/bits/endian.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_ENDIAN_H 2 | #define _BITS_ENDIAN_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #define __BYTE_ORDER __LITTLE_ENDIAN 7 | 8 | #endif /* _BITS_ENDIAN_H */ 9 | -------------------------------------------------------------------------------- /src/arch/loong64/include/bits/errfile.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_ERRFILE_H 2 | #define _BITS_ERRFILE_H 3 | 4 | /** @file 5 | * 6 | * LoongArch64-specific error file identifiers 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** 13 | * @addtogroup errfile Error file identifiers 14 | * @{ 15 | */ 16 | 17 | /** @} */ 18 | 19 | #endif /* _BITS_ERRFILE_H */ 20 | -------------------------------------------------------------------------------- /src/arch/loong64/include/bits/io.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_IO_H 2 | #define _BITS_IO_H 3 | 4 | /** @file 5 | * 6 | * LoongArch64-specific I/O API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** Page shift */ 13 | #define PAGE_SHIFT 12 14 | 15 | #include 16 | 17 | #endif /* _BITS_IO_H */ 18 | -------------------------------------------------------------------------------- /src/arch/loong64/include/bits/nap.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_NAP_H 2 | #define _BITS_NAP_H 3 | 4 | /** @file 5 | * 6 | * LoongArch64-specific CPU sleeping API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** 13 | * Sleep until next CPU interrupt 14 | * 15 | */ 16 | static inline __attribute__ (( always_inline )) void cpu_halt ( void ) { 17 | __asm__ __volatile__ ( "idle 0" ); 18 | } 19 | 20 | #endif /* _BITS_NAP_H */ 21 | -------------------------------------------------------------------------------- /src/arch/loong64/include/bits/profile.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_PROFILE_H 2 | #define _BITS_PROFILE_H 3 | 4 | /** @file 5 | * 6 | * Profiling 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** 15 | * Get profiling timestamp 16 | * 17 | * @ret timestamp Timestamp 18 | */ 19 | static inline __attribute__ (( always_inline )) unsigned long 20 | profile_timestamp ( void ) { 21 | uint64_t cycles; 22 | 23 | /* Read cycle counter */ 24 | __asm__ __volatile__ ( "rdtime.d %0, $zero\n\t" : "=r" ( cycles ) ); 25 | return cycles; 26 | } 27 | 28 | #endif /* _BITS_PROFILE_H */ 29 | -------------------------------------------------------------------------------- /src/arch/loong64/include/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_SETJMP_H 2 | #define _BITS_SETJMP_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | /** A jump buffer */ 7 | typedef struct { 8 | uint64_t s0; 9 | uint64_t s1; 10 | uint64_t s2; 11 | uint64_t s3; 12 | uint64_t s4; 13 | uint64_t s5; 14 | uint64_t s6; 15 | uint64_t s7; 16 | uint64_t s8; 17 | 18 | uint64_t fp; 19 | uint64_t sp; 20 | uint64_t ra; 21 | } jmp_buf[1]; 22 | 23 | #endif /* _BITS_SETJMP_H */ 24 | -------------------------------------------------------------------------------- /src/arch/loong64/include/bits/stdint.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_STDINT_H 2 | #define _BITS_STDINT_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | typedef __SIZE_TYPE__ size_t; 7 | typedef signed long ssize_t; 8 | typedef signed long off_t; 9 | 10 | typedef unsigned char uint8_t; 11 | typedef unsigned short uint16_t; 12 | typedef unsigned int uint32_t; 13 | typedef unsigned long long uint64_t; 14 | 15 | typedef signed char int8_t; 16 | typedef signed short int16_t; 17 | typedef signed int int32_t; 18 | typedef signed long long int64_t; 19 | 20 | typedef unsigned long physaddr_t; 21 | typedef unsigned long intptr_t; 22 | 23 | #endif /* _BITS_STDINT_H */ 24 | -------------------------------------------------------------------------------- /src/arch/loong64/include/ipxe/efi/dhcparch.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_DHCPARCH_H 2 | #define _IPXE_EFI_DHCPARCH_H 3 | 4 | /** @file 5 | * 6 | * DHCP client architecture definitions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** DHCP client architecture */ 15 | #define DHCP_ARCH_CLIENT_ARCHITECTURE DHCP_CLIENT_ARCHITECTURE_LOONG64 16 | 17 | /** DHCP client network device interface */ 18 | #define DHCP_ARCH_CLIENT_NDI 1 /* UNDI */ , 3, 10 /* v3.10 */ 19 | 20 | #endif /* _IPXE_EFI_DHCPARCH_H */ 21 | -------------------------------------------------------------------------------- /src/arch/riscv/Makefile: -------------------------------------------------------------------------------- 1 | # Assembler section type character 2 | # 3 | ASM_TCHAR := @ 4 | ASM_TCHAR_OPS := @ 5 | 6 | # Include RISCV-specific headers 7 | # 8 | INCDIRS := arch/$(ARCH)/include arch/riscv/include $(INCDIRS) 9 | 10 | # RISCV-specific directories containing source files 11 | # 12 | SRCDIRS += arch/riscv/core 13 | SRCDIRS += arch/riscv/interface/sbi 14 | SRCDIRS += arch/riscv/prefix 15 | 16 | # RISCV-specific flags 17 | # 18 | CFLAGS += -mno-strict-align -mno-plt 19 | 20 | # EFI requires -fshort-wchar, and nothing else currently uses wchar_t 21 | # 22 | CFLAGS += -fshort-wchar 23 | -------------------------------------------------------------------------------- /src/arch/riscv/Makefile.efi: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # RISCV-specific flags 4 | # 5 | CFLAGS += -mcmodel=medany 6 | 7 | # Include generic EFI Makefile 8 | # 9 | MAKEDEPS += Makefile.efi 10 | include Makefile.efi 11 | -------------------------------------------------------------------------------- /src/arch/riscv/Makefile.linux: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Include generic Linux Makefile 4 | # 5 | MAKEDEPS += Makefile.linux 6 | include Makefile.linux 7 | -------------------------------------------------------------------------------- /src/arch/riscv/Makefile.sbi: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Build a position-independent executable, with relocations required 4 | # only for data values. Runtime relocations are applied by the 5 | # prefix code. 6 | # 7 | CFLAGS += -mcmodel=medany -fpie 8 | LDFLAGS += -pie --no-dynamic-linker 9 | 10 | # Linker script 11 | # 12 | LDSCRIPT = arch/riscv/scripts/sbi.lds 13 | 14 | # Media types 15 | # 16 | MEDIA += sbi 17 | -------------------------------------------------------------------------------- /src/arch/riscv/include/bits/endian.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_ENDIAN_H 2 | #define _BITS_ENDIAN_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #define __BYTE_ORDER __LITTLE_ENDIAN 7 | 8 | #endif /* _BITS_ENDIAN_H */ 9 | -------------------------------------------------------------------------------- /src/arch/riscv/include/bits/errfile.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_ERRFILE_H 2 | #define _BITS_ERRFILE_H 3 | 4 | /** @file 5 | * 6 | * RISC-V error file identifiers 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** 13 | * @addtogroup errfile Error file identifiers 14 | * @{ 15 | */ 16 | 17 | #define ERRFILE_sbi_reboot ( ERRFILE_ARCH | ERRFILE_CORE | 0x00000000 ) 18 | #define ERRFILE_hart ( ERRFILE_ARCH | ERRFILE_CORE | 0x00010000 ) 19 | #define ERRFILE_zicntr ( ERRFILE_ARCH | ERRFILE_CORE | 0x00020000 ) 20 | #define ERRFILE_zkr ( ERRFILE_ARCH | ERRFILE_CORE | 0x00030000 ) 21 | 22 | /** @} */ 23 | 24 | #endif /* _BITS_ERRFILE_H */ 25 | -------------------------------------------------------------------------------- /src/arch/riscv/include/bits/io.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_IO_H 2 | #define _BITS_IO_H 3 | 4 | /** @file 5 | * 6 | * RISCV-specific I/O API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** Page shift */ 13 | #define PAGE_SHIFT 12 14 | 15 | #include 16 | 17 | #endif /* _BITS_IO_H */ 18 | -------------------------------------------------------------------------------- /src/arch/riscv/include/bits/nap.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_NAP_H 2 | #define _BITS_NAP_H 3 | 4 | /** @file 5 | * 6 | * RISCV-specific CPU sleeping API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** 13 | * Sleep until next CPU interrupt 14 | * 15 | */ 16 | static inline __attribute__ (( always_inline )) void cpu_halt ( void ) { 17 | __asm__ __volatile__ ( "wfi" ); 18 | } 19 | 20 | #endif /* _BITS_NAP_H */ 21 | -------------------------------------------------------------------------------- /src/arch/riscv/include/bits/profile.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_PROFILE_H 2 | #define _BITS_PROFILE_H 3 | 4 | /** @file 5 | * 6 | * Profiling 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** 15 | * Get profiling timestamp 16 | * 17 | * @ret timestamp Timestamp 18 | */ 19 | static inline __attribute__ (( always_inline )) unsigned long 20 | profile_timestamp ( void ) { 21 | unsigned long cycles; 22 | 23 | /* Read timestamp counter */ 24 | __asm__ __volatile__ ( "rdcycle %0" : "=r" ( cycles ) ); 25 | return cycles; 26 | } 27 | 28 | #endif /* _BITS_PROFILE_H */ 29 | -------------------------------------------------------------------------------- /src/arch/riscv/include/bits/reboot.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_REBOOT_H 2 | #define _BITS_REBOOT_H 3 | 4 | /** @file 5 | * 6 | * RISCV-specific reboot API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #endif /* _BITS_REBOOT_H */ 15 | -------------------------------------------------------------------------------- /src/arch/riscv/include/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_SETJMP_H 2 | #define _BITS_SETJMP_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | /** A jump buffer */ 7 | typedef struct { 8 | /** Return address (ra) */ 9 | unsigned long ra; 10 | /** Stack pointer (sp) */ 11 | unsigned long sp; 12 | /** Callee-saved registers (s0-s11) */ 13 | unsigned long s[12]; 14 | } jmp_buf[1]; 15 | 16 | #endif /* _BITS_SETJMP_H */ 17 | -------------------------------------------------------------------------------- /src/arch/riscv/include/bits/stdint.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_STDINT_H 2 | #define _BITS_STDINT_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | typedef __SIZE_TYPE__ size_t; 7 | typedef signed long ssize_t; 8 | typedef signed long off_t; 9 | 10 | typedef unsigned char uint8_t; 11 | typedef unsigned short uint16_t; 12 | typedef unsigned int uint32_t; 13 | typedef unsigned long long uint64_t; 14 | 15 | typedef signed char int8_t; 16 | typedef signed short int16_t; 17 | typedef signed int int32_t; 18 | typedef signed long long int64_t; 19 | 20 | typedef unsigned long physaddr_t; 21 | typedef unsigned long intptr_t; 22 | 23 | #endif /* _BITS_STDINT_H */ 24 | -------------------------------------------------------------------------------- /src/arch/riscv/include/bits/umalloc.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_UMALLOC_H 2 | #define _BITS_UMALLOC_H 3 | 4 | /** @file 5 | * 6 | * RISCV-specific user memory allocation API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #endif /* _BITS_UMALLOC_H */ 15 | -------------------------------------------------------------------------------- /src/arch/riscv/include/ipxe/errno/sbi.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_ERRNO_SBI_H 2 | #define _IPXE_ERRNO_SBI_H 3 | 4 | /** 5 | * @file 6 | * 7 | * RISC-V SBI platform error codes 8 | * 9 | * We never need to return SBI error codes ourselves, so we 10 | * arbitrarily choose to use the Linux error codes as platform error 11 | * codes. 12 | * 13 | */ 14 | 15 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 16 | 17 | #include 18 | 19 | #endif /* _IPXE_ERRNO_SBI_H */ 20 | -------------------------------------------------------------------------------- /src/arch/riscv/include/ipxe/hart.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_HART_H 2 | #define _IPXE_HART_H 3 | 4 | /** @file 5 | * 6 | * Hardware threads (harts) 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern unsigned long boot_hart; 13 | 14 | extern int hart_supported ( const char *ext ); 15 | 16 | #endif /* _IPXE_HART_H */ 17 | -------------------------------------------------------------------------------- /src/arch/riscv/include/ipxe/sbi_reboot.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_BIOS_REBOOT_H 2 | #define _IPXE_BIOS_REBOOT_H 3 | 4 | /** @file 5 | * 6 | * Supervisor Binary Interface (SBI) reboot mechanism 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef REBOOT_SBI 13 | #define REBOOT_PREFIX_sbi 14 | #else 15 | #define REBOOT_PREFIX_sbi __sbi_ 16 | #endif 17 | 18 | #endif /* _IPXE_BIOS_REBOOT_H */ 19 | -------------------------------------------------------------------------------- /src/arch/riscv/include/ipxe/sbi_umalloc.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_SBI_UMALLOC_H 2 | #define _IPXE_SBI_UMALLOC_H 3 | 4 | /** @file 5 | * 6 | * External memory allocation 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef UMALLOC_SBI 13 | #define UMALLOC_PREFIX_sbi 14 | #else 15 | #define UMALLOC_PREFIX_sbi __sbi_ 16 | #endif 17 | 18 | #endif /* _IPXE_SBI_UMALLOC_H */ 19 | -------------------------------------------------------------------------------- /src/arch/riscv32/Makefile: -------------------------------------------------------------------------------- 1 | # RISCV32-specific directories containing source files 2 | # 3 | SRCDIRS += arch/riscv32/core 4 | SRCDIRS += arch/riscv32/libgcc 5 | 6 | # RISCV32-specific flags 7 | # 8 | CFLAGS += -march=rv32gc -mabi=ilp32d 9 | ASFLAGS += -march=rv32gc -mabi=ilp32d 10 | LDFLAGS += -m elf32lriscv 11 | 12 | # Include common RISCV Makefile 13 | # 14 | MAKEDEPS += arch/riscv/Makefile 15 | include arch/riscv/Makefile 16 | 17 | # Include platform-specific Makefile 18 | # 19 | MAKEDEPS += arch/riscv32/Makefile.$(PLATFORM) 20 | include arch/riscv32/Makefile.$(PLATFORM) 21 | -------------------------------------------------------------------------------- /src/arch/riscv32/Makefile.efi: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Specify EFI image builder 4 | # 5 | ELF2EFI = $(ELF2EFI32) 6 | 7 | # Include generic EFI Makefile 8 | # 9 | MAKEDEPS += arch/riscv/Makefile.efi 10 | include arch/riscv/Makefile.efi 11 | -------------------------------------------------------------------------------- /src/arch/riscv32/Makefile.linux: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Starting virtual address 4 | # 5 | LDFLAGS += -Ttext=0x10000 6 | 7 | # Compiler flags for building host API wrapper 8 | # 9 | LINUX_CFLAGS += -march=rv32gc -mabi=ilp32d 10 | 11 | # Include generic Linux Makefile 12 | # 13 | MAKEDEPS += arch/riscv/Makefile.linux 14 | include arch/riscv/Makefile.linux 15 | -------------------------------------------------------------------------------- /src/arch/riscv32/Makefile.sbi: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Include generic SBI Makefile 4 | # 5 | MAKEDEPS += arch/riscv/Makefile.sbi 6 | include arch/riscv/Makefile.sbi 7 | -------------------------------------------------------------------------------- /src/arch/riscv32/include/ipxe/efi/dhcparch.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_DHCPARCH_H 2 | #define _IPXE_EFI_DHCPARCH_H 3 | 4 | /** @file 5 | * 6 | * DHCP client architecture definitions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** DHCP client architecture */ 15 | #define DHCP_ARCH_CLIENT_ARCHITECTURE DHCP_CLIENT_ARCHITECTURE_RISCV32 16 | 17 | /** DHCP client network device interface */ 18 | #define DHCP_ARCH_CLIENT_NDI 1 /* UNDI */ , 3, 10 /* v3.10 */ 19 | 20 | #endif /* _IPXE_EFI_DHCPARCH_H */ 21 | -------------------------------------------------------------------------------- /src/arch/riscv32/include/ipxe/sbi/dhcparch.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_SBI_DHCPARCH_H 2 | #define _IPXE_SBI_DHCPARCH_H 3 | 4 | /** @file 5 | * 6 | * DHCP client architecture definitions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** DHCP client architecture */ 15 | #define DHCP_ARCH_CLIENT_ARCHITECTURE DHCP_CLIENT_ARCHITECTURE_RISCV32 16 | 17 | /** DHCP client network device interface */ 18 | #define DHCP_ARCH_CLIENT_NDI 1 /* UNDI */ , 3, 10 /* v3.10 */ 19 | 20 | #endif /* _IPXE_SBI_DHCPARCH_H */ 21 | -------------------------------------------------------------------------------- /src/arch/riscv64/Makefile: -------------------------------------------------------------------------------- 1 | # RISCV64-specific directories containing source files 2 | # 3 | SRCDIRS += arch/riscv64/core 4 | 5 | # RISCV64-specific flags 6 | # 7 | CFLAGS += -march=rv64gc -mabi=lp64d 8 | ASFLAGS += -march=rv64gc -mabi=lp64d 9 | LDFLAGS += -m elf64lriscv 10 | 11 | # Include common RISCV Makefile 12 | # 13 | MAKEDEPS += arch/riscv/Makefile 14 | include arch/riscv/Makefile 15 | 16 | # Include platform-specific Makefile 17 | # 18 | MAKEDEPS += arch/riscv64/Makefile.$(PLATFORM) 19 | include arch/riscv64/Makefile.$(PLATFORM) 20 | -------------------------------------------------------------------------------- /src/arch/riscv64/Makefile.efi: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Specify EFI image builder 4 | # 5 | ELF2EFI = $(ELF2EFI64) 6 | 7 | # Include generic EFI Makefile 8 | # 9 | MAKEDEPS += arch/riscv/Makefile.efi 10 | include arch/riscv/Makefile.efi 11 | -------------------------------------------------------------------------------- /src/arch/riscv64/Makefile.linux: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Starting virtual address 4 | # 5 | LDFLAGS += -Ttext=0x10000 6 | 7 | # Include generic Linux Makefile 8 | # 9 | MAKEDEPS += arch/riscv/Makefile.linux 10 | include arch/riscv/Makefile.linux 11 | -------------------------------------------------------------------------------- /src/arch/riscv64/Makefile.sbi: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Include generic SBI Makefile 4 | # 5 | MAKEDEPS += arch/riscv/Makefile.sbi 6 | include arch/riscv/Makefile.sbi 7 | -------------------------------------------------------------------------------- /src/arch/riscv64/include/ipxe/efi/dhcparch.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_DHCPARCH_H 2 | #define _IPXE_EFI_DHCPARCH_H 3 | 4 | /** @file 5 | * 6 | * DHCP client architecture definitions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** DHCP client architecture */ 15 | #define DHCP_ARCH_CLIENT_ARCHITECTURE DHCP_CLIENT_ARCHITECTURE_RISCV64 16 | 17 | /** DHCP client network device interface */ 18 | #define DHCP_ARCH_CLIENT_NDI 1 /* UNDI */ , 3, 10 /* v3.10 */ 19 | 20 | #endif /* _IPXE_EFI_DHCPARCH_H */ 21 | -------------------------------------------------------------------------------- /src/arch/riscv64/include/ipxe/sbi/dhcparch.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_SBI_DHCPARCH_H 2 | #define _IPXE_SBI_DHCPARCH_H 3 | 4 | /** @file 5 | * 6 | * DHCP client architecture definitions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** DHCP client architecture */ 15 | #define DHCP_ARCH_CLIENT_ARCHITECTURE DHCP_CLIENT_ARCHITECTURE_RISCV64 16 | 17 | /** DHCP client network device interface */ 18 | #define DHCP_ARCH_CLIENT_NDI 1 /* UNDI */ , 3, 10 /* v3.10 */ 19 | 20 | #endif /* _IPXE_SBI_DHCPARCH_H */ 21 | -------------------------------------------------------------------------------- /src/arch/x86/Makefile.efi: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Include generic EFI Makefile 4 | # 5 | MAKEDEPS += Makefile.efi 6 | include Makefile.efi 7 | -------------------------------------------------------------------------------- /src/arch/x86/Makefile.linux: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Include generic Linux Makefile 4 | # 5 | MAKEDEPS += Makefile.linux 6 | include Makefile.linux 7 | -------------------------------------------------------------------------------- /src/arch/x86/core/dumpregs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void __asmcall _dump_regs ( struct i386_all_regs *ix86 ) { 5 | 6 | __asm__ __volatile__ ( 7 | TEXT16_CODE ( ".globl dump_regs\n\t" 8 | "\ndump_regs:\n\t" 9 | VIRT_CALL ( _dump_regs ) 10 | "ret\n\t" ) : ); 11 | 12 | printf ( "EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n" 13 | "ESI=%08x EDI=%08x EBP=%08x ESP=%08x\n" 14 | "CS=%04x SS=%04x DS=%04x ES=%04x FS=%04x GS=%04x\n", 15 | ix86->regs.eax, ix86->regs.ebx, ix86->regs.ecx, 16 | ix86->regs.edx, ix86->regs.esi, ix86->regs.edi, 17 | ix86->regs.ebp, ix86->regs.esp, 18 | ix86->segs.cs, ix86->segs.ss, ix86->segs.ds, 19 | ix86->segs.es, ix86->segs.fs, ix86->segs.gs ); 20 | } 21 | -------------------------------------------------------------------------------- /src/arch/x86/core/stack.S: -------------------------------------------------------------------------------- 1 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) 2 | 3 | .section ".note.GNU-stack", "", @progbits 4 | 5 | #ifdef __x86_64__ 6 | #define STACK_SIZE 8192 7 | #else 8 | #define STACK_SIZE 4096 9 | #endif 10 | 11 | /**************************************************************************** 12 | * Internal stack 13 | **************************************************************************** 14 | */ 15 | .section ".stack", "aw", @nobits 16 | .balign 8 17 | .globl _stack 18 | _stack: 19 | .space STACK_SIZE 20 | .globl _estack 21 | _estack: 22 | -------------------------------------------------------------------------------- /src/arch/x86/core/stack16.S: -------------------------------------------------------------------------------- 1 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) 2 | 3 | .section ".note.GNU-stack", "", @progbits 4 | 5 | /**************************************************************************** 6 | * Internal stack 7 | **************************************************************************** 8 | */ 9 | .section ".stack16", "aw", @nobits 10 | .balign 8 11 | .globl _stack16 12 | _stack16: 13 | .space 4096 14 | .globl _estack16 15 | _estack16: 16 | -------------------------------------------------------------------------------- /src/arch/x86/include/basemem.h: -------------------------------------------------------------------------------- 1 | #ifndef _BASEMEM_H 2 | #define _BASEMEM_H 3 | 4 | /** @file 5 | * 6 | * Base memory allocation 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | /** 17 | * Read the BIOS free base memory counter 18 | * 19 | * @ret fbms Free base memory counter (in kB) 20 | */ 21 | static inline unsigned int get_fbms ( void ) { 22 | uint16_t fbms; 23 | 24 | get_real ( fbms, BDA_SEG, BDA_FBMS ); 25 | return fbms; 26 | } 27 | 28 | extern void set_fbms ( unsigned int new_fbms ); 29 | 30 | /* Actually in hidemem.c, but putting it here avoids polluting the 31 | * architecture-independent include/hidemem.h. 32 | */ 33 | extern void hide_basemem ( void ); 34 | 35 | #endif /* _BASEMEM_H */ 36 | -------------------------------------------------------------------------------- /src/arch/x86/include/basemem_packet.h: -------------------------------------------------------------------------------- 1 | #ifndef BASEMEM_PACKET_H 2 | #define BASEMEM_PACKET_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #include 7 | 8 | /** Maximum length of base memory packet buffer */ 9 | #define BASEMEM_PACKET_LEN 1514 10 | 11 | /** Base memory packet buffer */ 12 | extern char __bss16_array ( basemem_packet, [BASEMEM_PACKET_LEN] ); 13 | #define basemem_packet __use_data16 ( basemem_packet ) 14 | 15 | #endif /* BASEMEM_PACKET_H */ 16 | -------------------------------------------------------------------------------- /src/arch/x86/include/bios.h: -------------------------------------------------------------------------------- 1 | #ifndef BIOS_H 2 | #define BIOS_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #define BDA_SEG 0x0040 7 | #define BDA_EBDA 0x000e 8 | #define BDA_EQUIPMENT_WORD 0x0010 9 | #define BDA_KB0 0x0017 10 | #define BDA_KB0_RSHIFT 0x01 11 | #define BDA_KB0_LSHIFT 0x02 12 | #define BDA_KB0_CTRL 0x04 13 | #define BDA_KB0_CAPSLOCK 0x040 14 | #define BDA_FBMS 0x0013 15 | #define BDA_TICKS 0x006c 16 | #define BDA_MIDNIGHT 0x0070 17 | #define BDA_REBOOT 0x0072 18 | #define BDA_REBOOT_WARM 0x1234 19 | #define BDA_NUM_DRIVES 0x0075 20 | #define BDA_CHAR_HEIGHT 0x0085 21 | #define BDA_KB2 0x0096 22 | #define BDA_KB2_RALT 0x08 23 | 24 | #endif /* BIOS_H */ 25 | -------------------------------------------------------------------------------- /src/arch/x86/include/bits/acpi.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_ACPI_H 2 | #define _BITS_ACPI_H 3 | 4 | /** @file 5 | * 6 | * x86-specific ACPI API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #endif /* _BITS_ACPI_H */ 15 | -------------------------------------------------------------------------------- /src/arch/x86/include/bits/endian.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_ENDIAN_H 2 | #define _BITS_ENDIAN_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #define __BYTE_ORDER __LITTLE_ENDIAN 7 | 8 | #endif /* _BITS_ENDIAN_H */ 9 | -------------------------------------------------------------------------------- /src/arch/x86/include/bits/io.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_IO_H 2 | #define _BITS_IO_H 3 | 4 | /** @file 5 | * 6 | * x86-specific I/O API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** Page shift */ 13 | #define PAGE_SHIFT 12 14 | 15 | #include 16 | 17 | #endif /* _BITS_IO_H */ 18 | -------------------------------------------------------------------------------- /src/arch/x86/include/bits/iomap.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_IOMAP_H 2 | #define _BITS_IOMAP_H 3 | 4 | /** @file 5 | * 6 | * x86-specific I/O mapping API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #endif /* _BITS_IOMAP_H */ 15 | -------------------------------------------------------------------------------- /src/arch/x86/include/bits/mp.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_MP_H 2 | #define _BITS_MP_H 3 | 4 | /** @file 5 | * 6 | * x86-specific multiprocessor API implementation 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #endif /* _BITS_MP_H */ 15 | -------------------------------------------------------------------------------- /src/arch/x86/include/bits/nap.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_NAP_H 2 | #define _BITS_NAP_H 3 | 4 | /** @file 5 | * 6 | * x86-specific CPU sleeping API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** 15 | * Sleep until next CPU interrupt 16 | * 17 | */ 18 | static inline __attribute__ (( always_inline )) void cpu_halt ( void ) { 19 | __asm__ __volatile__ ( "hlt" ); 20 | } 21 | 22 | #endif /* _BITS_NAP_H */ 23 | -------------------------------------------------------------------------------- /src/arch/x86/include/bits/pci_io.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_PCI_IO_H 2 | #define _BITS_PCI_IO_H 3 | 4 | /** @file 5 | * 6 | * i386-specific PCI I/O API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | #endif /* _BITS_PCI_IO_H */ 17 | -------------------------------------------------------------------------------- /src/arch/x86/include/bits/reboot.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_REBOOT_H 2 | #define _BITS_REBOOT_H 3 | 4 | /** @file 5 | * 6 | * x86-specific reboot API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #endif /* _BITS_REBOOT_H */ 15 | -------------------------------------------------------------------------------- /src/arch/x86/include/bits/sanboot.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_SANBOOT_H 2 | #define _BITS_SANBOOT_H 3 | 4 | /** @file 5 | * 6 | * x86-specific sanboot API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #endif /* _BITS_SANBOOT_H */ 15 | -------------------------------------------------------------------------------- /src/arch/x86/include/bits/smbios.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_SMBIOS_H 2 | #define _BITS_SMBIOS_H 3 | 4 | /** @file 5 | * 6 | * x86-specific SMBIOS API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #endif /* _BITS_SMBIOS_H */ 15 | -------------------------------------------------------------------------------- /src/arch/x86/include/bits/tcpip.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_TCPIP_H 2 | #define _BITS_TCPIP_H 3 | 4 | /** @file 5 | * 6 | * Transport-network layer interface 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern uint16_t tcpip_continue_chksum ( uint16_t partial, const void *data, 13 | size_t len ); 14 | 15 | #endif /* _BITS_TCPIP_H */ 16 | -------------------------------------------------------------------------------- /src/arch/x86/include/bits/time.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_TIME_H 2 | #define _BITS_TIME_H 3 | 4 | /** @file 5 | * 6 | * x86-specific time API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #endif /* _BITS_TIME_H */ 15 | -------------------------------------------------------------------------------- /src/arch/x86/include/bits/uaccess.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_UACCESS_H 2 | #define _BITS_UACCESS_H 3 | 4 | /** @file 5 | * 6 | * x86-specific user access API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #endif /* _BITS_UACCESS_H */ 15 | -------------------------------------------------------------------------------- /src/arch/x86/include/bits/umalloc.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_UMALLOC_H 2 | #define _BITS_UMALLOC_H 3 | 4 | /** @file 5 | * 6 | * x86-specific user memory allocation API implementations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #endif /* _BITS_UMALLOC_H */ 15 | -------------------------------------------------------------------------------- /src/arch/x86/include/bochs.h: -------------------------------------------------------------------------------- 1 | #ifndef BOCHS_H 2 | #define BOCHS_H 3 | 4 | /** @file 5 | * 6 | * bochs breakpoints 7 | * 8 | * This file defines @c bochsbp, the magic breakpoint instruction that 9 | * is incredibly useful when debugging under bochs. This file should 10 | * never be included in production code. 11 | * 12 | * Use the pseudo-instruction @c bochsbp in assembly code, or the 13 | * bochsbp() function in C code. 14 | * 15 | */ 16 | 17 | #ifdef ASSEMBLY 18 | 19 | /* Breakpoint for when debugging under bochs */ 20 | #define bochsbp xchgw %bx, %bx 21 | #define BOCHSBP bochsbp 22 | 23 | #else /* ASSEMBLY */ 24 | 25 | /** Breakpoint for when debugging under bochs */ 26 | static inline void bochsbp ( void ) { 27 | __asm__ __volatile__ ( "xchgw %bx, %bx" ); 28 | } 29 | 30 | #endif /* ASSEMBLY */ 31 | 32 | #warning "bochs.h should not be included into production code" 33 | 34 | #endif /* BOCHS_H */ 35 | -------------------------------------------------------------------------------- /src/arch/x86/include/bootsector.h: -------------------------------------------------------------------------------- 1 | #ifndef _BOOTSECTOR_H 2 | #define _BOOTSECTOR_H 3 | 4 | /** @file 5 | * 6 | * x86 bootsector image format 7 | */ 8 | 9 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 10 | 11 | extern int call_bootsector ( unsigned int segment, unsigned int offset, 12 | unsigned int drive ); 13 | 14 | #endif /* _BOOTSECTOR_H */ 15 | -------------------------------------------------------------------------------- /src/arch/x86/include/fakee820.h: -------------------------------------------------------------------------------- 1 | #ifndef _FAKEE820_H 2 | #define _FAKEE820_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | extern void fake_e820 ( void ); 7 | extern void unfake_e820 ( void ); 8 | 9 | #endif /* _FAKEE820_H */ 10 | -------------------------------------------------------------------------------- /src/arch/x86/include/initrd.h: -------------------------------------------------------------------------------- 1 | #ifndef _INITRD_H 2 | #define _INITRD_H 3 | 4 | /** @file 5 | * 6 | * Initial ramdisk (initrd) reshuffling 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** Minimum free space required to reshuffle initrds 15 | * 16 | * Chosen to avoid absurdly long reshuffling times 17 | */ 18 | #define INITRD_MIN_FREE_LEN ( 512 * 1024 ) 19 | 20 | extern void initrd_reshuffle ( userptr_t bottom ); 21 | extern int initrd_reshuffle_check ( size_t len, userptr_t bottom ); 22 | 23 | #endif /* _INITRD_H */ 24 | -------------------------------------------------------------------------------- /src/arch/x86/include/ipxe/acpipwr.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_ACPIPWR_H 2 | #define _IPXE_ACPIPWR_H 3 | 4 | /** @file 5 | * 6 | * ACPI power off 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern int acpi_poweroff ( void ); 13 | 14 | #endif /* _IPXE_ACPIPWR_H */ 15 | -------------------------------------------------------------------------------- /src/arch/x86/include/ipxe/apm.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_APM_H 2 | #define _IPXE_APM_H 3 | 4 | /** @file 5 | * 6 | * Advanced Power Management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern int apm_poweroff ( void ); 13 | 14 | #endif /* _IPXE_APM_H */ 15 | -------------------------------------------------------------------------------- /src/arch/x86/include/ipxe/bios_mp.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_BIOS_MP_H 2 | #define _IPXE_BIOS_MP_H 3 | 4 | /** @file 5 | * 6 | * BIOS multiprocessor API implementation 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #ifdef MPAPI_PCBIOS 15 | #define MPAPI_PREFIX_pcbios 16 | #else 17 | #define MPAPI_PREFIX_pcbios __pcbios_ 18 | #endif 19 | 20 | /** 21 | * Calculate address as seen by a multiprocessor function 22 | * 23 | * @v address Address in boot processor address space 24 | * @ret address Address in application processor address space 25 | */ 26 | static inline __attribute__ (( always_inline )) mp_addr_t 27 | MPAPI_INLINE ( pcbios, mp_address ) ( void *address ) { 28 | 29 | return virt_to_phys ( address ); 30 | } 31 | 32 | #endif /* _IPXE_BIOS_MP_H */ 33 | -------------------------------------------------------------------------------- /src/arch/x86/include/ipxe/bios_nap.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_BIOS_NAP_H 2 | #define _IPXE_BIOS_NAP_H 3 | 4 | /** @file 5 | * 6 | * BIOS CPU sleeping 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef NAP_PCBIOS 13 | #define NAP_PREFIX_pcbios 14 | #else 15 | #define NAP_PREFIX_pcbios __pcbios_ 16 | #endif 17 | 18 | #endif /* _IPXE_BIOS_NAP_H */ 19 | -------------------------------------------------------------------------------- /src/arch/x86/include/ipxe/bios_reboot.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_BIOS_REBOOT_H 2 | #define _IPXE_BIOS_REBOOT_H 3 | 4 | /** @file 5 | * 6 | * Standard PC-BIOS reboot mechanism 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef REBOOT_PCBIOS 13 | #define REBOOT_PREFIX_pcbios 14 | #else 15 | #define REBOOT_PREFIX_pcbios __pcbios_ 16 | #endif 17 | 18 | #endif /* _IPXE_BIOS_REBOOT_H */ 19 | -------------------------------------------------------------------------------- /src/arch/x86/include/ipxe/bios_sanboot.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_BIOS_SANBOOT_H 2 | #define _IPXE_BIOS_SANBOOT_H 3 | 4 | /** @file 5 | * 6 | * Standard PC-BIOS sanboot interface 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef SANBOOT_PCBIOS 13 | #define SANBOOT_PREFIX_pcbios 14 | #else 15 | #define SANBOOT_PREFIX_pcbios __pcbios_ 16 | #endif 17 | 18 | #endif /* _IPXE_BIOS_SANBOOT_H */ 19 | -------------------------------------------------------------------------------- /src/arch/x86/include/ipxe/bios_smbios.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_BIOS_SMBIOS_H 2 | #define _IPXE_BIOS_SMBIOS_H 3 | 4 | /** @file 5 | * 6 | * Standard PC-BIOS SMBIOS interface 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef SMBIOS_PCBIOS 13 | #define SMBIOS_PREFIX_pcbios 14 | #else 15 | #define SMBIOS_PREFIX_pcbios __pcbios_ 16 | #endif 17 | 18 | #endif /* _IPXE_BIOS_SMBIOS_H */ 19 | -------------------------------------------------------------------------------- /src/arch/x86/include/ipxe/iomap_pages.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_IOMAP_PAGES_H 2 | #define _IPXE_IOMAP_PAGES_H 3 | 4 | /** @file 5 | * 6 | * I/O mapping API using page tables 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef IOMAP_PAGES 13 | #define IOMAP_PREFIX_pages 14 | #else 15 | #define IOMAP_PREFIX_pages __pages_ 16 | #endif 17 | 18 | static inline __always_inline unsigned long 19 | IOMAP_INLINE ( pages, io_to_bus ) ( volatile const void *io_addr ) { 20 | /* Not easy to do; just return the CPU address for debugging purposes */ 21 | return ( ( intptr_t ) io_addr ); 22 | } 23 | 24 | #endif /* _IPXE_IOMAP_PAGES_H */ 25 | -------------------------------------------------------------------------------- /src/arch/x86/include/ipxe/memtop_umalloc.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_MEMTOP_UMALLOC_H 2 | #define _IPXE_MEMTOP_UMALLOC_H 3 | 4 | /** @file 5 | * 6 | * External memory allocation 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef UMALLOC_MEMTOP 13 | #define UMALLOC_PREFIX_memtop 14 | #else 15 | #define UMALLOC_PREFIX_memtop __memtop_ 16 | #endif 17 | 18 | #endif /* _IPXE_MEMTOP_UMALLOC_H */ 19 | -------------------------------------------------------------------------------- /src/arch/x86/include/ipxe/pcbios/dhcparch.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_PCBIOS_DHCPARCH_H 2 | #define _IPXE_PCBIOS_DHCPARCH_H 3 | 4 | /** @file 5 | * 6 | * DHCP client architecture definitions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** DHCP client architecture */ 15 | #define DHCP_ARCH_CLIENT_ARCHITECTURE DHCP_CLIENT_ARCHITECTURE_X86 16 | 17 | /** DHCP client network device interface */ 18 | #define DHCP_ARCH_CLIENT_NDI 1 /* UNDI */ , 2, 1 /* v2.1 */ 19 | 20 | #endif /* _IPXE_PCBIOS_DHCPARCH_H */ 21 | -------------------------------------------------------------------------------- /src/arch/x86/include/ipxe/pcicloud.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_PCICLOUD_H 2 | #define _IPXE_PCICLOUD_H 3 | 4 | /** @file 5 | * 6 | * Cloud VM PCI configuration space access 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef PCIAPI_CLOUD 13 | #define PCIAPI_PREFIX_cloud 14 | #else 15 | #define PCIAPI_PREFIX_cloud __cloud_ 16 | #endif 17 | 18 | /** 19 | * Check if PCI bus probing is allowed 20 | * 21 | * @ret ok Bus probing is allowed 22 | */ 23 | static inline __always_inline int 24 | PCIAPI_INLINE ( cloud, pci_can_probe ) ( void ) { 25 | return 1; 26 | } 27 | 28 | #endif /* _IPXE_PCICLOUD_H */ 29 | -------------------------------------------------------------------------------- /src/arch/x86/include/ipxe/rsdp.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_RSDP_H 2 | #define _IPXE_RSDP_H 3 | 4 | /** @file 5 | * 6 | * Standard PC-BIOS ACPI RSDP interface 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef ACPI_RSDP 13 | #define ACPI_PREFIX_rsdp 14 | #else 15 | #define ACPI_PREFIX_rsdp __rsdp_ 16 | #endif 17 | 18 | /** 19 | * Locate ACPI table 20 | * 21 | * @v signature Requested table signature 22 | * @v index Requested index of table with this signature 23 | * @ret table Table, or UNULL if not found 24 | */ 25 | static inline __attribute__ (( always_inline )) userptr_t 26 | ACPI_INLINE ( rsdp, acpi_find ) ( uint32_t signature, unsigned int index ) { 27 | 28 | return acpi_find_via_rsdt ( signature, index ); 29 | } 30 | 31 | #endif /* _IPXE_RSDP_H */ 32 | -------------------------------------------------------------------------------- /src/arch/x86/include/ipxe/rtc_time.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_RTC_TIME_H 2 | #define _IPXE_RTC_TIME_H 3 | 4 | /** @file 5 | * 6 | * RTC-based time source 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef TIME_RTC 13 | #define TIME_PREFIX_rtc 14 | #else 15 | #define TIME_PREFIX_rtc __rtc_ 16 | #endif 17 | 18 | #endif /* _IPXE_RTC_TIME_H */ 19 | -------------------------------------------------------------------------------- /src/arch/x86/include/kir.h: -------------------------------------------------------------------------------- 1 | #ifndef KIR_H 2 | #define KIR_H 3 | 4 | #ifndef KEEP_IT_REAL 5 | #error "kir.h can be used only with -DKEEP_IT_REAL" 6 | #endif 7 | 8 | #ifdef ASSEMBLY 9 | 10 | #define code32 code16gcc 11 | 12 | #else /* ASSEMBLY */ 13 | 14 | __asm__ ( ".code16gcc" ); 15 | 16 | #endif /* ASSEMBLY */ 17 | 18 | #endif /* KIR_H */ 19 | -------------------------------------------------------------------------------- /src/arch/x86/include/memsizes.h: -------------------------------------------------------------------------------- 1 | #ifndef _MEMSIZES_H 2 | #define _MEMSIZES_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #include 7 | 8 | /** 9 | * Get size of base memory from BIOS free base memory counter 10 | * 11 | * @ret basemem Base memory size, in kB 12 | */ 13 | static inline unsigned int basememsize ( void ) { 14 | return get_fbms(); 15 | } 16 | 17 | extern unsigned int extmemsize ( void ); 18 | 19 | #endif /* _MEMSIZES_H */ 20 | -------------------------------------------------------------------------------- /src/arch/x86/include/pnpbios.h: -------------------------------------------------------------------------------- 1 | #ifndef _PNPBIOS_H 2 | #define _PNPBIOS_H 3 | 4 | /** @file 5 | * 6 | * PnP BIOS 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /* BIOS segment address */ 13 | #define BIOS_SEG 0xf000 14 | 15 | extern int find_pnp_bios ( void ); 16 | 17 | #endif /* _PNPBIOS_H */ 18 | -------------------------------------------------------------------------------- /src/arch/x86/include/rmsetjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _RMSETJMP_H 2 | #define _RMSETJMP_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #include 7 | #include 8 | 9 | /** A real-mode-extended jump buffer */ 10 | typedef struct { 11 | /** Jump buffer */ 12 | jmp_buf env; 13 | /** Real-mode stack pointer */ 14 | segoff_t rm_stack; 15 | } rmjmp_buf[1]; 16 | 17 | #define rmsetjmp( _env ) ( { \ 18 | (_env)->rm_stack.segment = rm_ss; \ 19 | (_env)->rm_stack.offset = rm_sp; \ 20 | setjmp ( (_env)->env ); } ) \ 21 | 22 | #define rmlongjmp( _env, _val ) do { \ 23 | rm_ss = (_env)->rm_stack.segment; \ 24 | rm_sp = (_env)->rm_stack.offset; \ 25 | longjmp ( (_env)->env, (_val) ); \ 26 | } while ( 0 ) 27 | 28 | #endif /* _RMSETJMP_H */ 29 | -------------------------------------------------------------------------------- /src/arch/x86/include/sdi.h: -------------------------------------------------------------------------------- 1 | #ifndef _SDI_H 2 | #define _SDI_H 3 | 4 | /** @file 5 | * 6 | * System Deployment Image (SDI) 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** SDI image header */ 13 | struct sdi_header { 14 | /** Signature */ 15 | uint32_t magic; 16 | /** Version (as an ASCII string) */ 17 | uint32_t version; 18 | /** Reserved */ 19 | uint8_t reserved[8]; 20 | /** Boot code offset */ 21 | uint64_t boot_offset; 22 | /** Boot code size */ 23 | uint64_t boot_size; 24 | } __attribute__ (( packed )); 25 | 26 | /** SDI image signature */ 27 | #define SDI_MAGIC \ 28 | ( ( '$' << 0 ) | ( 'S' << 8 ) | ( 'D' << 16 ) | ( 'I' << 24 ) ) 29 | 30 | /** SDI boot segment */ 31 | #define SDI_BOOT_SEG 0x0000 32 | 33 | /** SDI boot offset */ 34 | #define SDI_BOOT_OFF 0x7c00 35 | 36 | /** Constant to binary-OR with physical address of SDI image */ 37 | #define SDI_WTF 0x41 38 | 39 | #endif /* _SDI_H */ 40 | -------------------------------------------------------------------------------- /src/arch/x86/include/undiload.h: -------------------------------------------------------------------------------- 1 | #ifndef _UNDILOAD_H 2 | #define _UNDILOAD_H 3 | 4 | /** @file 5 | * 6 | * UNDI load/unload 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | struct undi_device; 13 | struct undi_rom; 14 | 15 | extern int undi_load ( struct undi_device *undi, struct undi_rom *undirom ); 16 | extern int undi_unload ( struct undi_device *undi ); 17 | 18 | /** 19 | * Call UNDI loader to create a pixie 20 | * 21 | * @v undi UNDI device 22 | * @v undirom UNDI ROM 23 | * @v pci_busdevfn PCI bus:dev.fn 24 | * @ret rc Return status code 25 | */ 26 | static inline int undi_load_pci ( struct undi_device *undi, 27 | struct undi_rom *undirom, 28 | unsigned int pci_busdevfn ) { 29 | undi->pci_busdevfn = pci_busdevfn; 30 | undi->isapnp_csn = UNDI_NO_ISAPNP_CSN; 31 | undi->isapnp_read_port = UNDI_NO_ISAPNP_READ_PORT; 32 | return undi_load ( undi, undirom ); 33 | } 34 | 35 | #endif /* _UNDILOAD_H */ 36 | -------------------------------------------------------------------------------- /src/arch/x86/include/undinet.h: -------------------------------------------------------------------------------- 1 | #ifndef _UNDINET_H 2 | #define _UNDINET_H 3 | 4 | /** @file 5 | * 6 | * UNDI network device driver 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | struct undi_device; 13 | struct device; 14 | 15 | extern int undinet_probe ( struct undi_device *undi, struct device *dev ); 16 | extern void undinet_remove ( struct undi_device *undi ); 17 | 18 | #endif /* _UNDINET_H */ 19 | -------------------------------------------------------------------------------- /src/arch/x86/include/undipreload.h: -------------------------------------------------------------------------------- 1 | #ifndef _UNDIPRELOAD_H 2 | #define _UNDIPRELOAD_H 3 | 4 | /** @file 5 | * 6 | * Preloaded UNDI stack 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | 15 | extern struct undi_device __data16 ( preloaded_undi ); 16 | #define preloaded_undi __use_data16 ( preloaded_undi ) 17 | 18 | #endif /* _UNDIPRELOAD_H */ 19 | -------------------------------------------------------------------------------- /src/arch/x86/interface/pcbios/bios_nap.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | /** 7 | * Save power by halting the CPU until the next interrupt 8 | * 9 | */ 10 | static void bios_cpu_nap ( void ) { 11 | __asm__ __volatile__ ( "sti\n\t" 12 | "hlt\n\t" 13 | "cli\n\t" ); 14 | } 15 | 16 | PROVIDE_NAP ( pcbios, cpu_nap, bios_cpu_nap ); 17 | -------------------------------------------------------------------------------- /src/arch/x86/prefix/kkkpxeprefix.S: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * PXE prefix that keeps the whole PXE stack present and provides an exit hook 3 | * 4 | * This prefix is essentially intended solely for the case of ipxelinux.0 5 | ***************************************************************************** 6 | */ 7 | 8 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) 9 | 10 | /* Provide the PXENV_FILE_EXIT_HOOK API call */ 11 | REQUIRING_SYMBOL ( _kkkpxe_start ) 12 | REQUIRE_OBJECT ( pxe_exit_hook ) 13 | 14 | #define PXELOADER_KEEP_UNDI 15 | #define PXELOADER_KEEP_PXE 16 | #define _pxe_start _kkkpxe_start 17 | #include "pxeprefix.S" 18 | -------------------------------------------------------------------------------- /src/arch/x86/prefix/kkpxeprefix.S: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * PXE prefix that keeps the whole PXE stack present 3 | ***************************************************************************** 4 | */ 5 | 6 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) 7 | 8 | #define PXELOADER_KEEP_UNDI 9 | #define PXELOADER_KEEP_PXE 10 | #define _pxe_start _kkpxe_start 11 | #include "pxeprefix.S" 12 | -------------------------------------------------------------------------------- /src/arch/x86/prefix/kpxeprefix.S: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * PXE prefix that keep the UNDI portion of the PXE stack present 3 | ***************************************************************************** 4 | */ 5 | 6 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) 7 | 8 | #define PXELOADER_KEEP_UNDI 9 | #define _pxe_start _kpxe_start 10 | #include "pxeprefix.S" 11 | -------------------------------------------------------------------------------- /src/arch/x86/prefix/mbr.S: -------------------------------------------------------------------------------- 1 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) 2 | 3 | .section ".note.GNU-stack", "", @progbits 4 | .code16 5 | .arch i386 6 | .section ".prefix", "awx", @progbits 7 | .org 0 8 | 9 | .globl mbr 10 | mbr: 11 | movw $exec_sector, %bp 12 | jmp find_active_partition 13 | exec_sector: 14 | ljmp $0x0000, $0x7c00 15 | 16 | #include "bootpart.S" 17 | -------------------------------------------------------------------------------- /src/arch/x86/prefix/nullprefix.S: -------------------------------------------------------------------------------- 1 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) 2 | 3 | .section ".note.GNU-stack", "", @progbits 4 | .org 0 5 | .code16 6 | .arch i386 7 | 8 | .section ".prefix", "ax", @progbits 9 | _prefix: 10 | 11 | .section ".text16", "ax", @progbits 12 | prefix_exit: 13 | 14 | prefix_exit_end: 15 | .previous 16 | -------------------------------------------------------------------------------- /src/arch/x86/prefix/unlzma16.S: -------------------------------------------------------------------------------- 1 | /* 2 | * 16-bit version of the decompressor 3 | * 4 | */ 5 | 6 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ) 7 | 8 | #define CODE16 9 | #include "unlzma.S" 10 | -------------------------------------------------------------------------------- /src/arch/x86/scripts/prefixonly.lds: -------------------------------------------------------------------------------- 1 | /* -*- ld-script -*- */ 2 | 3 | /* 4 | * Linker script for prefix-only binaries (e.g. USB disk MBR) 5 | * 6 | */ 7 | 8 | SECTIONS { 9 | 10 | .prefix 0x0 : AT ( 0x0 ) { 11 | *(.prefix) 12 | } 13 | 14 | /DISCARD/ : { 15 | *(.comment) 16 | *(.comment.*) 17 | *(.note) 18 | *(.note.*) 19 | *(.eh_frame) 20 | *(.eh_frame.*) 21 | *(.rel) 22 | *(.rel.*) 23 | *(.einfo) 24 | *(.einfo.*) 25 | *(.discard) 26 | *(.discard.*) 27 | *(.sbat) 28 | *(.sbat.*) 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/arch/x86/tests/comboot/shuffle-simple.asm: -------------------------------------------------------------------------------- 1 | bits 16 2 | org 100h 3 | 4 | jmp start 5 | 6 | shuffle_start: 7 | push 0xB800 8 | pop es 9 | mov cx, 80*24*2 10 | mov ax, 'AA' 11 | xor di, di 12 | rep stosw 13 | .lbl: jmp .lbl 14 | shuffle_end: 15 | nop 16 | shuffle_len equ (shuffle_end - shuffle_start + 1) 17 | 18 | start: 19 | ; calculate physical address of shuffled part 20 | xor eax, eax 21 | push ds 22 | pop ax 23 | shl eax, 4 24 | add ax, shuffle_start 25 | mov dword [source], eax 26 | 27 | mov ax, 0012h 28 | mov di, shuffle_descriptors 29 | mov cx, num_shuffle_descriptors 30 | mov ebp, 0x7c00 31 | int 22h 32 | int3 33 | 34 | shuffle_descriptors: 35 | dd 0x7C00 36 | source: dd 0 37 | dd shuffle_len 38 | 39 | num_shuffle_descriptors equ 1 40 | -------------------------------------------------------------------------------- /src/arch/x86/transitions/libpm.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/arch/x86/transitions/libpm.S -------------------------------------------------------------------------------- /src/arch/x86_64/Makefile.efi: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Use %rip-relative addressing wherever possible. 4 | # 5 | CFLAGS += -fpie 6 | 7 | # EFI probably doesn't guarantee us a red zone, so let's not rely on it. 8 | # 9 | CFLAGS += -mno-red-zone 10 | 11 | # Specify EFI image builder 12 | # 13 | ELF2EFI = $(ELF2EFI64) 14 | 15 | # Include generic EFI Makefile 16 | # 17 | MAKEDEPS += arch/x86/Makefile.efi 18 | include arch/x86/Makefile.efi 19 | -------------------------------------------------------------------------------- /src/arch/x86_64/Makefile.linux: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Starting virtual address 4 | # 5 | LDFLAGS += -Ttext=0x400000 6 | 7 | # Include generic Linux Makefile 8 | # 9 | MAKEDEPS += arch/x86/Makefile.linux 10 | include arch/x86/Makefile.linux 11 | -------------------------------------------------------------------------------- /src/arch/x86_64/Makefile.pcbios: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- : Force emacs to use Makefile mode 2 | 3 | # Place .textdata in negative 2GB of address space 4 | # 5 | CFLAGS += -mcmodel=kernel 6 | LDFLAGS += --section-start=.textdata=0xffffffffeb000000 7 | 8 | # Assembly code does not respect a red zone. 9 | # 10 | CFLAGS += -mno-red-zone 11 | 12 | # Include generic BIOS Makefile 13 | # 14 | MAKEDEPS += arch/x86/Makefile.pcbios 15 | include arch/x86/Makefile.pcbios 16 | -------------------------------------------------------------------------------- /src/arch/x86_64/include/bits/compiler.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_COMPILER_H 2 | #define _BITS_COMPILER_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | /** Dummy relocation type */ 7 | #define RELOC_TYPE_NONE R_X86_64_NONE 8 | 9 | #ifndef ASSEMBLY 10 | 11 | /** Unprefixed constant operand modifier */ 12 | #define ASM_NO_PREFIX "c" 13 | 14 | /** Declare a function with standard calling conventions */ 15 | #define __asmcall __attribute__ (( regparm(0) )) 16 | 17 | /** Declare a function with libgcc implicit linkage */ 18 | #define __libgcc 19 | 20 | #endif /* ASSEMBLY */ 21 | 22 | #endif /* _BITS_COMPILER_H */ 23 | -------------------------------------------------------------------------------- /src/arch/x86_64/include/bits/profile.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_PROFILE_H 2 | #define _BITS_PROFILE_H 3 | 4 | /** @file 5 | * 6 | * Profiling 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** 15 | * Get profiling timestamp 16 | * 17 | * @ret timestamp Timestamp 18 | */ 19 | static inline __attribute__ (( always_inline )) unsigned long 20 | profile_timestamp ( void ) { 21 | uint32_t eax; 22 | uint32_t edx; 23 | 24 | /* Read timestamp counter */ 25 | __asm__ __volatile__ ( "rdtsc" : "=a" ( eax ), "=d" ( edx ) ); 26 | return ( ( ( ( uint64_t ) edx ) << 32 ) | eax ); 27 | } 28 | 29 | #endif /* _BITS_PROFILE_H */ 30 | -------------------------------------------------------------------------------- /src/arch/x86_64/include/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_SETJMP_H 2 | #define _BITS_SETJMP_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #include 7 | 8 | /** A jump buffer */ 9 | typedef struct { 10 | /** Saved return address */ 11 | uint64_t retaddr; 12 | /** Saved stack pointer */ 13 | uint64_t stack; 14 | /** Saved %rbx */ 15 | uint64_t rbx; 16 | /** Saved %rbp */ 17 | uint64_t rbp; 18 | /** Saved %r12 */ 19 | uint64_t r12; 20 | /** Saved %r13 */ 21 | uint64_t r13; 22 | /** Saved %r14 */ 23 | uint64_t r14; 24 | /** Saved %r15 */ 25 | uint64_t r15; 26 | } jmp_buf[1]; 27 | 28 | #endif /* _BITS_SETJMP_H */ 29 | -------------------------------------------------------------------------------- /src/arch/x86_64/include/bits/stdint.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_STDINT_H 2 | #define _BITS_STDINT_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | typedef __SIZE_TYPE__ size_t; 7 | typedef signed long ssize_t; 8 | typedef signed long off_t; 9 | 10 | typedef unsigned char uint8_t; 11 | typedef unsigned short uint16_t; 12 | typedef unsigned int uint32_t; 13 | typedef unsigned long long uint64_t; 14 | 15 | typedef signed char int8_t; 16 | typedef signed short int16_t; 17 | typedef signed int int32_t; 18 | typedef signed long long int64_t; 19 | 20 | typedef unsigned long physaddr_t; 21 | typedef unsigned long intptr_t; 22 | 23 | #endif /* _BITS_STDINT_H */ 24 | -------------------------------------------------------------------------------- /src/arch/x86_64/include/ipxe/efi/dhcparch.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_DHCPARCH_H 2 | #define _IPXE_EFI_DHCPARCH_H 3 | 4 | /** @file 5 | * 6 | * DHCP client architecture definitions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** DHCP client architecture */ 15 | #define DHCP_ARCH_CLIENT_ARCHITECTURE DHCP_CLIENT_ARCHITECTURE_X86_64 16 | 17 | /** DHCP client network device interface */ 18 | #define DHCP_ARCH_CLIENT_NDI 1 /* UNDI */ , 3, 10 /* v3.10 */ 19 | 20 | #endif /* _IPXE_EFI_DHCPARCH_H */ 21 | -------------------------------------------------------------------------------- /src/bin/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /src/config/cloud/aws.ipxe: -------------------------------------------------------------------------------- 1 | #!ipxe 2 | 3 | echo Amazon EC2 - iPXE boot via user-data 4 | echo CPU: ${cpuvendor} ${cpumodel} 5 | ifstat || 6 | 7 | set attempt:int8 1 8 | :dhcp_retry 9 | echo DHCP attempt ${attempt} 10 | dhcp --timeout 5000 && goto dhcp_ok || 11 | ifstat || 12 | inc attempt 13 | iseq ${attempt} 10 || goto dhcp_retry 14 | 15 | :dhcp_fail 16 | echo DHCP failed - rebooting 17 | reboot || 18 | exit 19 | 20 | :dhcp_ok 21 | route || 22 | chain -ar http://169.254.169.254/latest/user-data || 23 | ifstat || 24 | exit 25 | -------------------------------------------------------------------------------- /src/config/cloud/colour.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/cloud/colour.h -------------------------------------------------------------------------------- /src/config/cloud/crypto.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/cloud/crypto.h -------------------------------------------------------------------------------- /src/config/cloud/gce.ipxe: -------------------------------------------------------------------------------- 1 | #!ipxe 2 | 3 | echo Google Compute Engine - iPXE boot via metadata 4 | echo CPU: ${cpuvendor} ${cpumodel} 5 | ifstat || 6 | dhcp || 7 | route || 8 | chain -ar http://metadata.google.internal/computeMetadata/v1/instance/attributes/ipxeboot || 9 | ifstat || 10 | -------------------------------------------------------------------------------- /src/config/cloud/general.h: -------------------------------------------------------------------------------- 1 | /* Enable IPv6 and HTTPS */ 2 | #define NET_PROTO_IPV6 3 | #define DOWNLOAD_PROTO_HTTPS 4 | 5 | /* Allow retrieval of metadata (such as an iPXE boot script) from 6 | * Google Compute Engine metadata server. 7 | */ 8 | #define HTTP_HACK_GCE 9 | 10 | /* Allow scripts to handle errors by powering down the VM to avoid 11 | * incurring unnecessary costs. 12 | */ 13 | #define POWEROFF_CMD 14 | -------------------------------------------------------------------------------- /src/config/cloud/ioapi.h: -------------------------------------------------------------------------------- 1 | /* Work around missing PCI BIOS calls in the cut-down SeaBIOS found in 2 | * some AWS EC2 instances. 3 | */ 4 | #ifdef PLATFORM_pcbios 5 | #undef PCIAPI_PCBIOS 6 | #define PCIAPI_CLOUD 7 | #endif 8 | -------------------------------------------------------------------------------- /src/config/cloud/serial.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/cloud/serial.h -------------------------------------------------------------------------------- /src/config/cloud/settings.h: -------------------------------------------------------------------------------- 1 | /* It can often be useful to know the CPU on which a cloud instance is 2 | * running (e.g. to isolate problems with Azure AMD instances). 3 | */ 4 | #if defined ( __i386__ ) || defined ( __x86_64__ ) 5 | #define CPUID_SETTINGS 6 | #endif 7 | -------------------------------------------------------------------------------- /src/config/cloud/sideband.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/cloud/sideband.h -------------------------------------------------------------------------------- /src/config/cloud/usb.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/cloud/usb.h -------------------------------------------------------------------------------- /src/config/config_sbi.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/config_sbi.c -------------------------------------------------------------------------------- /src/config/defaults.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_DEFAULTS_H 2 | #define CONFIG_DEFAULTS_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #define CONFIG_DEFAULTS(_platform) 7 | 8 | #include CONFIG_DEFAULTS(PLATFORM) 9 | 10 | #endif /* CONFIG_DEFAULTS_H */ 11 | -------------------------------------------------------------------------------- /src/config/defaults/linux.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_DEFAULTS_LINUX_H 2 | #define CONFIG_DEFAULTS_LINUX_H 3 | 4 | /** @file 5 | * 6 | * Configuration defaults for linux 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER ); 11 | 12 | #define CONSOLE_LINUX 13 | #define TIMER_LINUX 14 | #define UACCESS_LINUX 15 | #define UMALLOC_LINUX 16 | #define NAP_LINUX 17 | #define SMBIOS_LINUX 18 | #define SANBOOT_DUMMY 19 | #define ENTROPY_LINUX 20 | #define TIME_LINUX 21 | #define REBOOT_NULL 22 | #define PCIAPI_LINUX 23 | #define DMAAPI_FLAT 24 | #define ACPI_LINUX 25 | #define MPAPI_NULL 26 | 27 | #define DRIVERS_LINUX 28 | 29 | #define IMAGE_SCRIPT 30 | 31 | #define SANBOOT_PROTO_ISCSI 32 | #define SANBOOT_PROTO_AOE 33 | #define SANBOOT_PROTO_IB_SRP 34 | #define SANBOOT_PROTO_FCP 35 | #define SANBOOT_PROTO_HTTP 36 | 37 | #if defined ( __i386__ ) || defined ( __x86_64__ ) 38 | #define ENTROPY_RDRAND 39 | #endif 40 | 41 | #endif /* CONFIG_DEFAULTS_LINUX_H */ 42 | -------------------------------------------------------------------------------- /src/config/defaults/sbi.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_DEFAULTS_SBI_H 2 | #define CONFIG_DEFAULTS_SBI_H 3 | 4 | /** @file 5 | * 6 | * Configuration defaults for RISC-V SBI 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #define IOAPI_RISCV 13 | #define IOMAP_VIRT 14 | #define DMAAPI_FLAT 15 | #define UACCESS_FLAT 16 | #define TIMER_ZICNTR 17 | #define ENTROPY_ZKR 18 | 19 | #define CONSOLE_SBI 20 | #define REBOOT_SBI 21 | #define UMALLOC_SBI 22 | 23 | #define ACPI_NULL 24 | #define MPAPI_NULL 25 | #define NAP_NULL 26 | #define PCIAPI_NULL 27 | #define SANBOOT_NULL 28 | #define SMBIOS_NULL 29 | #define TIME_NULL 30 | 31 | #define IMAGE_SCRIPT 32 | 33 | #define REBOOT_CMD 34 | #define POWEROFF_CMD 35 | 36 | #endif /* CONFIG_DEFAULTS_SBI_H */ 37 | -------------------------------------------------------------------------------- /src/config/entropy.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_ENTROPY_H 2 | #define CONFIG_ENTROPY_H 3 | 4 | /** @file 5 | * 6 | * Entropy API configuration 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #include 15 | 16 | #endif /* CONFIG_ENTROPY_H */ 17 | -------------------------------------------------------------------------------- /src/config/fdt.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_FDT_H 2 | #define CONFIG_FDT_H 3 | 4 | /** @file 5 | * 6 | * Flattened Device Tree configuration 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #include 15 | 16 | #endif /* CONFIG_FDT_H */ 17 | -------------------------------------------------------------------------------- /src/config/ioapi.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_IOAPI_H 2 | #define CONFIG_IOAPI_H 3 | 4 | /** @file 5 | * 6 | * I/O API configuration 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | //#undef PCIAPI_PCBIOS /* Access via PCI BIOS */ 15 | //#define PCIAPI_DIRECT /* Direct access via Type 1 accesses */ 16 | 17 | #include 18 | #include NAMED_CONFIG(ioapi.h) 19 | #include 20 | #include LOCAL_NAMED_CONFIG(ioapi.h) 21 | 22 | #endif /* CONFIG_IOAPI_H */ 23 | -------------------------------------------------------------------------------- /src/config/isa.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_ISA_H 2 | #define CONFIG_ISA_H 3 | 4 | /** @file 5 | * 6 | * ISA probe address configuration 7 | * 8 | * You can override the list of addresses that will be probed by any 9 | * ISA drivers. 10 | * 11 | */ 12 | #undef ISA_PROBE_ADDRS /* e.g. 0x200, 0x300 */ 13 | #undef ISA_PROBE_ONLY /* Do not probe any other addresses */ 14 | 15 | #include 16 | 17 | #endif /* CONFIG_ISA_H */ 18 | -------------------------------------------------------------------------------- /src/config/local/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /src/config/named.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_NAMED_H 2 | #define CONFIG_NAMED_H 3 | 4 | /** @file 5 | * 6 | * Named configurations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /* config//
.h */ 13 | #ifdef CONFIG 14 | #define NAMED_CONFIG(_header) 15 | #else 16 | #define NAMED_CONFIG(_header) 17 | #endif 18 | 19 | /* config/local//
.h */ 20 | #ifdef LOCAL_CONFIG 21 | #define LOCAL_NAMED_CONFIG(_header) 22 | #else 23 | #define LOCAL_NAMED_CONFIG(_header) 24 | #endif 25 | 26 | #endif /* CONFIG_NAMED_H */ 27 | -------------------------------------------------------------------------------- /src/config/nap.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_NAP_H 2 | #define CONFIG_NAP_H 3 | 4 | /** @file 5 | * 6 | * CPU sleeping 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | //#undef NAP_PCBIOS 15 | //#define NAP_NULL 16 | 17 | #include 18 | 19 | #endif /* CONFIG_NAP_H */ 20 | -------------------------------------------------------------------------------- /src/config/qemu/colour.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/qemu/colour.h -------------------------------------------------------------------------------- /src/config/qemu/console.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/qemu/console.h -------------------------------------------------------------------------------- /src/config/qemu/crypto.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/qemu/crypto.h -------------------------------------------------------------------------------- /src/config/qemu/general.h: -------------------------------------------------------------------------------- 1 | /* Disable entry during POST */ 2 | #undef ROM_BANNER_TIMEOUT 3 | #define ROM_BANNER_TIMEOUT 0 4 | 5 | /* Extend banner timeout */ 6 | #undef BANNER_TIMEOUT 7 | #define BANNER_TIMEOUT 30 8 | 9 | /* Work around missing EFI_PXE_BASE_CODE_PROTOCOL */ 10 | #define EFI_DOWNGRADE_UX 11 | 12 | /* The Tivoli VMM workaround causes a KVM emulation failure on hosts 13 | * without unrestricted_guest support 14 | */ 15 | #undef TIVOLI_VMM_WORKAROUND 16 | -------------------------------------------------------------------------------- /src/config/qemu/ioapi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/qemu/ioapi.h -------------------------------------------------------------------------------- /src/config/qemu/serial.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/qemu/serial.h -------------------------------------------------------------------------------- /src/config/qemu/settings.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/qemu/settings.h -------------------------------------------------------------------------------- /src/config/qemu/sideband.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/qemu/sideband.h -------------------------------------------------------------------------------- /src/config/qemu/usb.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/qemu/usb.h -------------------------------------------------------------------------------- /src/config/reboot.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_REBOOT_H 2 | #define CONFIG_REBOOT_H 3 | 4 | /** @file 5 | * 6 | * Reboot API configuration 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #include 15 | 16 | #endif /* CONFIG_REBOOT_H */ 17 | -------------------------------------------------------------------------------- /src/config/rpi/colour.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/rpi/colour.h -------------------------------------------------------------------------------- /src/config/rpi/console.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/rpi/console.h -------------------------------------------------------------------------------- /src/config/rpi/crypto.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/rpi/crypto.h -------------------------------------------------------------------------------- /src/config/rpi/general.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/rpi/general.h -------------------------------------------------------------------------------- /src/config/rpi/ioapi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/rpi/ioapi.h -------------------------------------------------------------------------------- /src/config/rpi/serial.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/rpi/serial.h -------------------------------------------------------------------------------- /src/config/rpi/settings.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/rpi/settings.h -------------------------------------------------------------------------------- /src/config/rpi/sideband.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/rpi/sideband.h -------------------------------------------------------------------------------- /src/config/rpi/usb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Use EFI_USB_IO_PROTOCOL 3 | * 4 | * The Raspberry Pi uses an embedded DesignWare USB controller for 5 | * which we do not have a native driver. Use via the 6 | * EFI_USB_IO_PROTOCOL driver instead. 7 | * 8 | */ 9 | #undef USB_HCD_XHCI 10 | #undef USB_HCD_EHCI 11 | #undef USB_HCD_UHCI 12 | #define USB_HCD_USBIO 13 | #undef USB_EFI 14 | -------------------------------------------------------------------------------- /src/config/sanboot.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_SANBOOT_H 2 | #define CONFIG_SANBOOT_H 3 | 4 | /** @file 5 | * 6 | * sanboot API configuration 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #include 15 | 16 | #endif /* CONFIG_SANBOOT_H */ 17 | -------------------------------------------------------------------------------- /src/config/settings.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_SETTINGS_H 2 | #define CONFIG_SETTINGS_H 3 | 4 | /** @file 5 | * 6 | * Configuration settings sources 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #define PCI_SETTINGS /* PCI device settings */ 15 | #define USB_SETTINGS /* USB device settings */ 16 | //#define CPUID_SETTINGS /* CPUID settings */ 17 | //#define MEMMAP_SETTINGS /* Memory map settings */ 18 | //#define VMWARE_SETTINGS /* VMware GuestInfo settings */ 19 | //#define VRAM_SETTINGS /* Video RAM dump settings */ 20 | //#define ACPI_SETTINGS /* ACPI settings */ 21 | 22 | #include 23 | #include NAMED_CONFIG(settings.h) 24 | #include 25 | #include LOCAL_NAMED_CONFIG(settings.h) 26 | 27 | #endif /* CONFIG_SETTINGS_H */ 28 | -------------------------------------------------------------------------------- /src/config/sideband.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_SIDEBAND_H 2 | #define CONFIG_SIDEBAND_H 3 | 4 | /** @file 5 | * 6 | * Sideband access by platform firmware 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | //#define CONFIG_BOFM /* IBM's BladeCenter Open Fabric Manager */ 13 | 14 | #include 15 | #include NAMED_CONFIG(sideband.h) 16 | #include 17 | #include LOCAL_NAMED_CONFIG(sideband.h) 18 | 19 | #endif /* CONFIG_SIDEBAND_H */ 20 | -------------------------------------------------------------------------------- /src/config/time.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_TIME_H 2 | #define CONFIG_TIME_H 3 | 4 | /** @file 5 | * 6 | * Time API configuration 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #include 15 | 16 | #endif /* CONFIG_TIME_H */ 17 | -------------------------------------------------------------------------------- /src/config/timer.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_TIMER_H 2 | #define CONFIG_TIMER_H 3 | 4 | /** @file 5 | * 6 | * Timer configuration. 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | //#undef TIMER_PCBIOS 15 | //#define TIMER_RDTSC 16 | 17 | #include 18 | 19 | #endif /* CONFIG_TIMER_H */ 20 | -------------------------------------------------------------------------------- /src/config/umalloc.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_UMALLOC_H 2 | #define CONFIG_UMALLOC_H 3 | 4 | /** @file 5 | * 6 | * User memory allocation API configuration 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #include 15 | 16 | #endif /* CONFIG_UMALLOC_H */ 17 | -------------------------------------------------------------------------------- /src/config/vbox/README: -------------------------------------------------------------------------------- 1 | Build using this command line: 2 | 3 | make CONFIG=vbox bin/intel--virtio-net--pcnet32.isarom 4 | 5 | Max size of a VirtualBox ROM is 56KB, 57344 bytes. There should be no need 6 | to pad the image as long as the binary is smaller or equal to this size. 7 | 8 | To use the ROM in VirtualBox you need to enable it using this command: 9 | 10 | vboxmanage setextradata global \ 11 | VBoxInternal/Devices/pcbios/0/Config/LanBootRom \ 12 | /absolute/path/to/intel--virtio-net--pcnet32.isarom 13 | 14 | NB: If you build the ROM using the .rom prefix then it'll be built as a PCI 15 | ROM, which won't work properly in VirtualBox. The error message you'll see 16 | is "No more network devices", which is somewhat confusing. If you enter the 17 | shell and use the "autoboot" command things will work as intended. Remember 18 | to always build as a .isarom to avoid this issue. 19 | -------------------------------------------------------------------------------- /src/config/vbox/colour.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/vbox/colour.h -------------------------------------------------------------------------------- /src/config/vbox/console.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/vbox/console.h -------------------------------------------------------------------------------- /src/config/vbox/crypto.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/vbox/crypto.h -------------------------------------------------------------------------------- /src/config/vbox/general.h: -------------------------------------------------------------------------------- 1 | /* Disabled from config/defaults/pcbios.h */ 2 | 3 | #undef SANBOOT_PROTO_ISCSI 4 | #undef SANBOOT_PROTO_AOE 5 | #undef SANBOOT_PROTO_IB_SRP 6 | #undef SANBOOT_PROTO_FCP 7 | 8 | /* Disabled from config/general.h */ 9 | 10 | #undef CRYPTO_80211_WEP 11 | #undef CRYPTO_80211_WPA 12 | #undef CRYPTO_80211_WPA2 13 | #undef IWMGMT_CMD 14 | #undef MENU_CMD 15 | 16 | /* Ensure ROM banner is not displayed */ 17 | 18 | #undef ROM_BANNER_TIMEOUT 19 | #define ROM_BANNER_TIMEOUT 0 20 | -------------------------------------------------------------------------------- /src/config/vbox/ioapi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/vbox/ioapi.h -------------------------------------------------------------------------------- /src/config/vbox/serial.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/vbox/serial.h -------------------------------------------------------------------------------- /src/config/vbox/settings.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/vbox/settings.h -------------------------------------------------------------------------------- /src/config/vbox/sideband.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/vbox/sideband.h -------------------------------------------------------------------------------- /src/config/vbox/usb.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/config/vbox/usb.h -------------------------------------------------------------------------------- /src/core/errno.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 4 | 5 | /** @file 6 | * 7 | * Error codes 8 | * 9 | * This file provides the global variable #errno. 10 | * 11 | */ 12 | 13 | /** 14 | * Global "last error" number. 15 | * 16 | * This is valid only when a function has just returned indicating a 17 | * failure. 18 | * 19 | */ 20 | int errno; 21 | -------------------------------------------------------------------------------- /src/core/null_acpi.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | PROVIDE_ACPI_INLINE ( null, acpi_find ); 4 | -------------------------------------------------------------------------------- /src/core/null_nap.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | PROVIDE_NAP_INLINE ( null, cpu_nap ); 4 | -------------------------------------------------------------------------------- /src/drivers/bus/eisa.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/drivers/bus/eisa.c -------------------------------------------------------------------------------- /src/drivers/bus/isa_ids.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | /* 7 | * EISA and ISAPnP IDs are actually mildly human readable, though in a 8 | * somewhat brain-damaged way. 9 | * 10 | */ 11 | char * isa_id_string ( unsigned int vendor, unsigned int product ) { 12 | static char buf[7]; 13 | int i; 14 | 15 | /* Vendor ID is a compressed ASCII string */ 16 | vendor = bswap_16 ( vendor ); 17 | for ( i = 2 ; i >= 0 ; i-- ) { 18 | buf[i] = ( 'A' - 1 + ( vendor & 0x1f ) ); 19 | vendor >>= 5; 20 | } 21 | 22 | /* Product ID is a 4-digit hex string */ 23 | sprintf ( &buf[3], "%04x", bswap_16 ( product ) ); 24 | 25 | return buf; 26 | } 27 | -------------------------------------------------------------------------------- /src/drivers/infiniband/MT25408_PRM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/drivers/infiniband/MT25408_PRM.h -------------------------------------------------------------------------------- /src/drivers/net/3c503.c: -------------------------------------------------------------------------------- 1 | /* 3Com 3c503, a memory-mapped NS8390-based card */ 2 | #if 0 /* Currently broken! */ 3 | #define INCLUDE_3C503 4 | #include "ns8390.c" 5 | #endif 6 | -------------------------------------------------------------------------------- /src/drivers/net/bnxt/bnxt.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/drivers/net/bnxt/bnxt.h -------------------------------------------------------------------------------- /src/drivers/net/efi/nii.h: -------------------------------------------------------------------------------- 1 | #ifndef _NII_H 2 | #define _NII_H 3 | 4 | /** @file 5 | * 6 | * NII driver 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | struct efi_device; 13 | 14 | extern int nii_start ( struct efi_device *efidev ); 15 | extern void nii_stop ( struct efi_device *efidev ); 16 | 17 | #endif /* _NII_H */ 18 | -------------------------------------------------------------------------------- /src/drivers/net/efi/snpnet.h: -------------------------------------------------------------------------------- 1 | #ifndef _SNPNET_H 2 | #define _SNPNET_H 3 | 4 | /** @file 5 | * 6 | * SNP NIC driver 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER ); 11 | 12 | struct efi_device; 13 | 14 | extern int snpnet_supported ( EFI_HANDLE device, EFI_GUID *protocol ); 15 | extern int snpnet_start ( struct efi_device *efidev ); 16 | extern void snpnet_stop ( struct efi_device *efidev ); 17 | 18 | #endif /* _SNPNET_H */ 19 | -------------------------------------------------------------------------------- /src/drivers/net/ne.c: -------------------------------------------------------------------------------- 1 | /* ISA I/O mapped NS8390-based cards, including NE2000 */ 2 | #if 0 /* Currently broken! */ 3 | #define INCLUDE_NE 1 4 | #define NE_SCAN 0x300,0x280,0x320,0x340,0x380 5 | #include "ns8390.c" 6 | #endif 7 | -------------------------------------------------------------------------------- /src/drivers/net/rtl818x/rtl8180.c: -------------------------------------------------------------------------------- 1 | /* Realtek 8180 card: rtl818x driver + rtl8180 RF modules */ 2 | 3 | FILE_LICENCE(GPL2_OR_LATER); 4 | 5 | #include 6 | #include "rtl818x.h" 7 | 8 | static struct pci_device_id rtl8180_nics[] = { 9 | PCI_ROM(0x10ec, 0x8180, "rtl8180", "Realtek 8180", 0), 10 | PCI_ROM(0x1186, 0x3300, "dwl510", "D-Link DWL-510", 0), 11 | PCI_ROM(0x1799, 0x6001, "f5d6001", "Belkin F5D6001", 0), 12 | PCI_ROM(0x1799, 0x6020, "f5d6020", "Belkin F5D6020", 0), 13 | }; 14 | 15 | struct pci_driver rtl8180_driver __pci_driver = { 16 | .ids = rtl8180_nics, 17 | .id_count = sizeof(rtl8180_nics) / sizeof(rtl8180_nics[0]), 18 | .probe = rtl818x_probe, 19 | .remove = rtl818x_remove, 20 | }; 21 | 22 | REQUIRING_SYMBOL(rtl8180_driver); 23 | REQUIRE_OBJECT(rtl8180_grf5101); 24 | REQUIRE_OBJECT(rtl8180_max2820); 25 | REQUIRE_OBJECT(rtl8180_sa2400); 26 | -------------------------------------------------------------------------------- /src/drivers/net/rtl818x/rtl8185.c: -------------------------------------------------------------------------------- 1 | /* Realtek 8185 card: rtl818x driver + rtl8185_rtl8225 RF module */ 2 | 3 | FILE_LICENCE(GPL2_OR_LATER); 4 | 5 | #include 6 | #include "rtl818x.h" 7 | 8 | static struct pci_device_id rtl8185_nics[] __unused = { 9 | PCI_ROM(0x10ec, 0x8185, "rtl8185", "Realtek 8185", 0), 10 | PCI_ROM(0x1799, 0x700f, "f5d7000", "Belkin F5D7000", 0), 11 | PCI_ROM(0x1799, 0x701f, "f5d7010", "Belkin F5D7010", 0), 12 | }; 13 | 14 | struct pci_driver rtl8185_driver __pci_driver = { 15 | .ids = rtl8185_nics, 16 | .id_count = sizeof(rtl8185_nics) / sizeof(rtl8185_nics[0]), 17 | .probe = rtl818x_probe, 18 | .remove = rtl818x_remove, 19 | }; 20 | 21 | REQUIRING_SYMBOL(rtl8185_driver); 22 | REQUIRE_OBJECT(rtl8185_rtl8225); 23 | -------------------------------------------------------------------------------- /src/drivers/net/skeleton.h: -------------------------------------------------------------------------------- 1 | #ifndef _SKELETON_H 2 | #define _SKELETON_H 3 | 4 | /** @file 5 | * 6 | * Skeleton network driver 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** Skeleton BAR size */ 13 | #define SKELETON_BAR_SIZE 256 14 | 15 | /** A skeleton network card */ 16 | struct skeleton_nic { 17 | /** Registers */ 18 | void *regs; 19 | }; 20 | 21 | #endif /* _SKELETON_H */ 22 | -------------------------------------------------------------------------------- /src/drivers/net/smc9000.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/drivers/net/smc9000.c -------------------------------------------------------------------------------- /src/drivers/net/smc9000.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qemu/ipxe/5c49e0a3b9c0f8003eea2a378a563c02593e835a/src/drivers/net/smc9000.h -------------------------------------------------------------------------------- /src/drivers/net/vxge/vxge.c: -------------------------------------------------------------------------------- 1 | /** @file Stub file for vxge driver 2 | * 3 | * This file drags in the rest of the driver for Neterion Inc's X3100 Series 4 | * 10GbE PCIe I/O Virtualized Server Adapter, allowing the driver to be built 5 | * as "vxge" even though the code is in vxge_* named files. 6 | */ 7 | 8 | FILE_LICENCE(GPL2_OR_LATER_OR_UBDL); 9 | 10 | #include 11 | 12 | PROVIDE_REQUIRING_SYMBOL(); 13 | REQUIRE_OBJECT(vxge_main); 14 | 15 | /** vxge PCI IDs for util/parserom.pl which are put into bin/NIC */ 16 | static struct pci_device_id vxge_nics[] __unused = { 17 | /* If you change this, also adjust vxge_main_nics[] in vxge_main.c */ 18 | PCI_ROM(0x17d5, 0x5833, "vxge-x3100", "Neterion X3100 Series", 0), 19 | }; 20 | -------------------------------------------------------------------------------- /src/drivers/net/wd.c: -------------------------------------------------------------------------------- 1 | /* ISA memory-mapped NS8390-based cards, including WD80x3 */ 2 | #if 0 /* Currently broken! */ 3 | #define INCLUDE_WD 4 | #define WD_DEFAULT_MEM 0xCC000 5 | #include "ns8390.c" 6 | #endif 7 | -------------------------------------------------------------------------------- /src/hci/keymap/keymap_by.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | * 3 | * "by" keyboard mapping 4 | * 5 | * This file is automatically generated; do not edit 6 | * 7 | */ 8 | 9 | FILE_LICENCE ( PUBLIC_DOMAIN ); 10 | 11 | #include 12 | 13 | /** "by" basic remapping */ 14 | static struct keymap_key by_basic[] = { 15 | { 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */ 16 | { 0xfc, 0x3e }, /* Pseudo-'|' => '>' */ 17 | { 0, 0 } 18 | }; 19 | 20 | /** "by" AltGr remapping */ 21 | static struct keymap_key by_altgr[] = { 22 | { 0, 0 } 23 | }; 24 | 25 | /** "by" keyboard map */ 26 | struct keymap by_keymap __keymap = { 27 | .name = "by", 28 | .basic = by_basic, 29 | .altgr = by_altgr, 30 | }; 31 | -------------------------------------------------------------------------------- /src/hci/keymap/keymap_gr.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | * 3 | * "gr" keyboard mapping 4 | * 5 | * This file is automatically generated; do not edit 6 | * 7 | */ 8 | 9 | FILE_LICENCE ( PUBLIC_DOMAIN ); 10 | 11 | #include 12 | 13 | /** "gr" basic remapping */ 14 | static struct keymap_key gr_basic[] = { 15 | { 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */ 16 | { 0xfc, 0x3e }, /* Pseudo-'|' => '>' */ 17 | { 0, 0 } 18 | }; 19 | 20 | /** "gr" AltGr remapping */ 21 | static struct keymap_key gr_altgr[] = { 22 | { 0, 0 } 23 | }; 24 | 25 | /** "gr" keyboard map */ 26 | struct keymap gr_keymap __keymap = { 27 | .name = "gr", 28 | .basic = gr_basic, 29 | .altgr = gr_altgr, 30 | }; 31 | -------------------------------------------------------------------------------- /src/hci/keymap/keymap_lt.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | * 3 | * "lt" keyboard mapping 4 | * 5 | * This file is automatically generated; do not edit 6 | * 7 | */ 8 | 9 | FILE_LICENCE ( PUBLIC_DOMAIN ); 10 | 11 | #include 12 | 13 | /** "lt" basic remapping */ 14 | static struct keymap_key lt_basic[] = { 15 | { 0, 0 } 16 | }; 17 | 18 | /** "lt" AltGr remapping */ 19 | static struct keymap_key lt_altgr[] = { 20 | { 0x22, 0x5e }, /* '"' => '^' */ 21 | { 0x27, 0x5e }, /* '\'' => '^' */ 22 | { 0x4b, 0x26 }, /* 'K' => '&' */ 23 | { 0x51, 0x40 }, /* 'Q' => '@' */ 24 | { 0x71, 0x40 }, /* 'q' => '@' */ 25 | { 0, 0 } 26 | }; 27 | 28 | /** "lt" keyboard map */ 29 | struct keymap lt_keymap __keymap = { 30 | .name = "lt", 31 | .basic = lt_basic, 32 | .altgr = lt_altgr, 33 | }; 34 | -------------------------------------------------------------------------------- /src/hci/keymap/keymap_mk.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | * 3 | * "mk" keyboard mapping 4 | * 5 | * This file is automatically generated; do not edit 6 | * 7 | */ 8 | 9 | FILE_LICENCE ( PUBLIC_DOMAIN ); 10 | 11 | #include 12 | 13 | /** "mk" basic remapping */ 14 | static struct keymap_key mk_basic[] = { 15 | { 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */ 16 | { 0xfc, 0x3e }, /* Pseudo-'|' => '>' */ 17 | { 0, 0 } 18 | }; 19 | 20 | /** "mk" AltGr remapping */ 21 | static struct keymap_key mk_altgr[] = { 22 | { 0, 0 } 23 | }; 24 | 25 | /** "mk" keyboard map */ 26 | struct keymap mk_keymap __keymap = { 27 | .name = "mk", 28 | .basic = mk_basic, 29 | .altgr = mk_altgr, 30 | }; 31 | -------------------------------------------------------------------------------- /src/hci/keymap/keymap_pl.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | * 3 | * "pl" keyboard mapping 4 | * 5 | * This file is automatically generated; do not edit 6 | * 7 | */ 8 | 9 | FILE_LICENCE ( PUBLIC_DOMAIN ); 10 | 11 | #include 12 | 13 | /** "pl" basic remapping */ 14 | static struct keymap_key pl_basic[] = { 15 | { 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */ 16 | { 0xfc, 0x3e }, /* Pseudo-'|' => '>' */ 17 | { 0, 0 } 18 | }; 19 | 20 | /** "pl" AltGr remapping */ 21 | static struct keymap_key pl_altgr[] = { 22 | { 0, 0 } 23 | }; 24 | 25 | /** "pl" keyboard map */ 26 | struct keymap pl_keymap __keymap = { 27 | .name = "pl", 28 | .basic = pl_basic, 29 | .altgr = pl_altgr, 30 | }; 31 | -------------------------------------------------------------------------------- /src/hci/keymap/keymap_ro.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | * 3 | * "ro" keyboard mapping 4 | * 5 | * This file is automatically generated; do not edit 6 | * 7 | */ 8 | 9 | FILE_LICENCE ( PUBLIC_DOMAIN ); 10 | 11 | #include 12 | 13 | /** "ro" basic remapping */ 14 | static struct keymap_key ro_basic[] = { 15 | { 0, 0 } 16 | }; 17 | 18 | /** "ro" AltGr remapping */ 19 | static struct keymap_key ro_altgr[] = { 20 | { 0, 0 } 21 | }; 22 | 23 | /** "ro" keyboard map */ 24 | struct keymap ro_keymap __keymap = { 25 | .name = "ro", 26 | .basic = ro_basic, 27 | .altgr = ro_altgr, 28 | }; 29 | -------------------------------------------------------------------------------- /src/hci/keymap/keymap_ru.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | * 3 | * "ru" keyboard mapping 4 | * 5 | * This file is automatically generated; do not edit 6 | * 7 | */ 8 | 9 | FILE_LICENCE ( PUBLIC_DOMAIN ); 10 | 11 | #include 12 | 13 | /** "ru" basic remapping */ 14 | static struct keymap_key ru_basic[] = { 15 | { 0x0d, 0x0a }, /* Ctrl-M => Ctrl-J */ 16 | { 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */ 17 | { 0xfc, 0x3e }, /* Pseudo-'|' => '>' */ 18 | { 0, 0 } 19 | }; 20 | 21 | /** "ru" AltGr remapping */ 22 | static struct keymap_key ru_altgr[] = { 23 | { 0, 0 } 24 | }; 25 | 26 | /** "ru" keyboard map */ 27 | struct keymap ru_keymap __keymap = { 28 | .name = "ru", 29 | .basic = ru_basic, 30 | .altgr = ru_altgr, 31 | }; 32 | -------------------------------------------------------------------------------- /src/hci/keymap/keymap_sr-latin.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | * 3 | * "sr-latin" keyboard mapping 4 | * 5 | * This file is automatically generated; do not edit 6 | * 7 | */ 8 | 9 | FILE_LICENCE ( PUBLIC_DOMAIN ); 10 | 11 | #include 12 | 13 | /** "sr-latin" basic remapping */ 14 | static struct keymap_key sr_latin_basic[] = { 15 | { 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */ 16 | { 0xfc, 0x3e }, /* Pseudo-'|' => '>' */ 17 | { 0, 0 } 18 | }; 19 | 20 | /** "sr-latin" AltGr remapping */ 21 | static struct keymap_key sr_latin_altgr[] = { 22 | { 0, 0 } 23 | }; 24 | 25 | /** "sr-latin" keyboard map */ 26 | struct keymap sr_latin_keymap __keymap = { 27 | .name = "sr-latin", 28 | .basic = sr_latin_basic, 29 | .altgr = sr_latin_altgr, 30 | }; 31 | -------------------------------------------------------------------------------- /src/hci/keymap/keymap_ua.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | * 3 | * "ua" keyboard mapping 4 | * 5 | * This file is automatically generated; do not edit 6 | * 7 | */ 8 | 9 | FILE_LICENCE ( PUBLIC_DOMAIN ); 10 | 11 | #include 12 | 13 | /** "ua" basic remapping */ 14 | static struct keymap_key ua_basic[] = { 15 | { 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */ 16 | { 0xfc, 0x3e }, /* Pseudo-'|' => '>' */ 17 | { 0, 0 } 18 | }; 19 | 20 | /** "ua" AltGr remapping */ 21 | static struct keymap_key ua_altgr[] = { 22 | { 0, 0 } 23 | }; 24 | 25 | /** "ua" keyboard map */ 26 | struct keymap ua_keymap __keymap = { 27 | .name = "ua", 28 | .basic = ua_basic, 29 | .altgr = ua_altgr, 30 | }; 31 | -------------------------------------------------------------------------------- /src/hci/keymap/keymap_uk.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | * 3 | * "uk" keyboard mapping 4 | * 5 | * This file is automatically generated; do not edit 6 | * 7 | */ 8 | 9 | FILE_LICENCE ( PUBLIC_DOMAIN ); 10 | 11 | #include 12 | 13 | /** "uk" basic remapping */ 14 | static struct keymap_key uk_basic[] = { 15 | { 0x22, 0x40 }, /* '"' => '@' */ 16 | { 0x40, 0x22 }, /* '@' => '"' */ 17 | { 0x5c, 0x23 }, /* '\\' => '#' */ 18 | { 0x7c, 0x7e }, /* '|' => '~' */ 19 | { 0, 0 } 20 | }; 21 | 22 | /** "uk" AltGr remapping */ 23 | static struct keymap_key uk_altgr[] = { 24 | { 0, 0 } 25 | }; 26 | 27 | /** "uk" keyboard map */ 28 | struct keymap uk_keymap __keymap = { 29 | .name = "uk", 30 | .basic = uk_basic, 31 | .altgr = uk_altgr, 32 | }; 33 | -------------------------------------------------------------------------------- /src/hci/keymap/keymap_us.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | * 3 | * "us" keyboard mapping 4 | * 5 | * This file is automatically generated; do not edit 6 | * 7 | */ 8 | 9 | FILE_LICENCE ( PUBLIC_DOMAIN ); 10 | 11 | #include 12 | 13 | /** "us" basic remapping */ 14 | static struct keymap_key us_basic[] = { 15 | { 0, 0 } 16 | }; 17 | 18 | /** "us" AltGr remapping */ 19 | static struct keymap_key us_altgr[] = { 20 | { 0, 0 } 21 | }; 22 | 23 | /** "us" keyboard map */ 24 | struct keymap us_keymap __keymap_default = { 25 | .name = "us", 26 | .basic = us_basic, 27 | .altgr = us_altgr, 28 | }; 29 | -------------------------------------------------------------------------------- /src/hci/mucurses/alert.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /** @file 5 | * 6 | * MuCurses alert functions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** 13 | * Audible signal 14 | * 15 | * @ret rc return status code 16 | */ 17 | int beep ( void ) { 18 | printf("\a"); 19 | return OK; 20 | } 21 | -------------------------------------------------------------------------------- /src/hci/mucurses/mucurses.h: -------------------------------------------------------------------------------- 1 | #ifndef _MUCURSES_H 2 | #define _MUCURSES_H 3 | 4 | /** @file 5 | * 6 | * MuCurses core implementation specific header file 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #define WRAP 0 13 | #define NOWRAP 1 14 | 15 | extern SCREEN _ansi_screen; 16 | 17 | extern void _wputch ( WINDOW *win, chtype ch, int wrap ) __nonnull; 18 | extern void _wputc ( WINDOW *win, char c, int wrap ) __nonnull; 19 | extern void _wputchstr ( WINDOW *win, const chtype *chstr, int wrap, int n ) __nonnull; 20 | extern void _wputstr ( WINDOW *win, const char *str, int wrap, int n ) __nonnull; 21 | extern void _wcursback ( WINDOW *win ) __nonnull; 22 | 23 | #endif /* _MUCURSES_H */ 24 | -------------------------------------------------------------------------------- /src/hci/mucurses/print_nadv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mucurses.h" 3 | #include "cursor.h" 4 | 5 | /** @file 6 | * 7 | * MuCurses printing functions (no cursor advance) 8 | * 9 | */ 10 | 11 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 12 | 13 | /** 14 | * Add string of single-byte characters and renditions to a window 15 | * 16 | * @v *win window to be rendered in 17 | * @v *chstr pointer to first chtype in "string" 18 | * @v n max number of chars from chstr to render 19 | * @ret rc return status code 20 | */ 21 | int waddchnstr ( WINDOW *win, const chtype *chstr, int n ) { 22 | struct cursor_pos pos; 23 | 24 | _store_curs_pos( win, &pos ); 25 | _wputchstr( win, chstr, NOWRAP, n ); 26 | _restore_curs_pos( win, &pos ); 27 | return OK; 28 | } 29 | -------------------------------------------------------------------------------- /src/hci/mucurses/wininit.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /** @file 5 | * 6 | * MuCurses initialisation functions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** 13 | * Initialise console environment 14 | * 15 | * @ret *win return pointer to stdscr 16 | */ 17 | WINDOW *initscr ( void ) { 18 | /* determine console size */ 19 | /* initialise screen */ 20 | stdscr->scr->init( stdscr->scr ); 21 | stdscr->height = LINES; 22 | stdscr->width = COLS; 23 | move ( 0, 0 ); 24 | return stdscr; 25 | } 26 | 27 | /** 28 | * Finalise console environment 29 | * 30 | */ 31 | int endwin ( void ) { 32 | attrset ( 0 ); 33 | color_set ( 0, NULL ); 34 | curs_set ( 1 ); 35 | mvprintw ( ( LINES - 1 ), 0, "\n" ); 36 | stdscr->scr->exit( stdscr->scr ); 37 | return OK; 38 | } 39 | -------------------------------------------------------------------------------- /src/include/alloca.h: -------------------------------------------------------------------------------- 1 | #ifndef _ALLOCA_H 2 | #define _ALLOCA_H 3 | 4 | /** 5 | * @file 6 | * 7 | * Temporary memory allocation 8 | * 9 | */ 10 | 11 | #include 12 | 13 | /** 14 | * Allocate temporary memory from the stack 15 | * 16 | * @v size Size to allocate 17 | * @ret ptr Allocated memory 18 | * 19 | * This memory will be freed automatically when the containing 20 | * function returns. There are several caveats regarding use of 21 | * alloca(); use it only if you already know what they are. 22 | */ 23 | #define alloca(size) __builtin_alloca ( size ) 24 | 25 | #endif /* _ALLOCA_H */ 26 | -------------------------------------------------------------------------------- /src/include/bits/acpi.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_ACPI_H 2 | #define _BITS_ACPI_H 3 | 4 | /** @file 5 | * 6 | * Dummy architecture-specific ACPI API implementations 7 | * 8 | * This file is included only if the architecture does not provide its 9 | * own version of this file. 10 | * 11 | */ 12 | 13 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 14 | 15 | #endif /* _BITS_ACPI_H */ 16 | -------------------------------------------------------------------------------- /src/include/bits/hyperv.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_HYPERV_H 2 | #define _BITS_HYPERV_H 3 | 4 | /** @file 5 | * 6 | * Dummy architecture-specific Hyper-V interface 7 | * 8 | * This file is included only if the architecture does not provide its 9 | * own version of this file. 10 | * 11 | */ 12 | 13 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 14 | 15 | #endif /* _BITS_HYPERV_H */ 16 | -------------------------------------------------------------------------------- /src/include/bits/iomap.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_IOMAP_H 2 | #define _BITS_IOMAP_H 3 | 4 | /** @file 5 | * 6 | * Dummy architecture-specific I/O mapping API implementations 7 | * 8 | * This file is included only if the architecture does not provide its 9 | * own version of this file. 10 | * 11 | */ 12 | 13 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 14 | 15 | #endif /* _BITS_IOMAP_H */ 16 | -------------------------------------------------------------------------------- /src/include/bits/mp.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_MP_H 2 | #define _BITS_MP_H 3 | 4 | /** @file 5 | * 6 | * Dummy architecture-specific multiprocessor API implementations 7 | * 8 | * This file is included only if the architecture does not provide its 9 | * own version of this file. 10 | * 11 | */ 12 | 13 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 14 | 15 | #endif /* _BITS_MP_H */ 16 | -------------------------------------------------------------------------------- /src/include/bits/nap.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_NAP_H 2 | #define _BITS_NAP_H 3 | 4 | /** @file 5 | * 6 | * Dummy architecture-specific CPU sleeping API implementations 7 | * 8 | * This file is included only if the architecture does not provide its 9 | * own version of this file. 10 | * 11 | */ 12 | 13 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 14 | 15 | #endif /* _BITS_NAP_H */ 16 | -------------------------------------------------------------------------------- /src/include/bits/pci_io.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_PCI_IO_H 2 | #define _BITS_PCI_IO_H 3 | 4 | /** @file 5 | * 6 | * Dummy architecture-specific PCI I/O API implementations 7 | * 8 | * This file is included only if the architecture does not provide its 9 | * own version of this file. 10 | * 11 | */ 12 | 13 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 14 | 15 | #endif /* _BITS_PCI_IO_H */ 16 | -------------------------------------------------------------------------------- /src/include/bits/reboot.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_REBOOT_H 2 | #define _BITS_REBOOT_H 3 | 4 | /** @file 5 | * 6 | * Dummy architecture-specific reboot API implementations 7 | * 8 | * This file is included only if the architecture does not provide its 9 | * own version of this file. 10 | * 11 | */ 12 | 13 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 14 | 15 | #endif /* _BITS_REBOOT_H */ 16 | -------------------------------------------------------------------------------- /src/include/bits/sanboot.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_SANBOOT_H 2 | #define _BITS_SANBOOT_H 3 | 4 | /** @file 5 | * 6 | * Dummy architecture-specific sanboot API implementations 7 | * 8 | * This file is included only if the architecture does not provide its 9 | * own version of this file. 10 | * 11 | */ 12 | 13 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 14 | 15 | #endif /* _BITS_SANBOOT_H */ 16 | -------------------------------------------------------------------------------- /src/include/bits/smbios.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_SMBIOS_H 2 | #define _BITS_SMBIOS_H 3 | 4 | /** @file 5 | * 6 | * Dummy architecture-specific SMBIOS API implementations 7 | * 8 | * This file is included only if the architecture does not provide its 9 | * own version of this file. 10 | * 11 | */ 12 | 13 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 14 | 15 | #endif /* _BITS_SMBIOS_H */ 16 | -------------------------------------------------------------------------------- /src/include/bits/tcpip.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_TCPIP_H 2 | #define _BITS_TCPIP_H 3 | 4 | /** @file 5 | * 6 | * Generic architecture-specific transport-network layer interface 7 | * 8 | * This file is included only if the architecture does not provide its 9 | * own version of this file. 10 | * 11 | */ 12 | 13 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 14 | 15 | #include 16 | 17 | /** 18 | * Calculate continued TCP/IP checkum 19 | * 20 | * @v partial Checksum of already-summed data, in network byte order 21 | * @v data Data buffer 22 | * @v len Length of data buffer 23 | * @ret cksum Updated checksum, in network byte order 24 | */ 25 | static inline __attribute__ (( always_inline )) uint16_t 26 | tcpip_continue_chksum ( uint16_t partial, const void *data, size_t len ) { 27 | 28 | /* Not yet optimised */ 29 | return generic_tcpip_continue_chksum ( partial, data, len ); 30 | } 31 | 32 | #endif /* _BITS_TCPIP_H */ 33 | -------------------------------------------------------------------------------- /src/include/bits/time.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_TIME_H 2 | #define _BITS_TIME_H 3 | 4 | /** @file 5 | * 6 | * Dummy architecture-specific time API implementations 7 | * 8 | * This file is included only if the architecture does not provide its 9 | * own version of this file. 10 | * 11 | */ 12 | 13 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 14 | 15 | #endif /* _BITS_TIME_H */ 16 | -------------------------------------------------------------------------------- /src/include/bits/uaccess.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_UACCESS_H 2 | #define _BITS_UACCESS_H 3 | 4 | /** @file 5 | * 6 | * Dummy architecture-specific user access API implementations 7 | * 8 | * This file is included only if the architecture does not provide its 9 | * own version of this file. 10 | * 11 | */ 12 | 13 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 14 | 15 | #endif /* _BITS_UACCESS_H */ 16 | -------------------------------------------------------------------------------- /src/include/bits/uart.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_UART_H 2 | #define _BITS_UART_H 3 | 4 | /** @file 5 | * 6 | * Dummy architecture-specific UART 7 | * 8 | * This file is included only if the architecture does not provide its 9 | * own version of this file. 10 | * 11 | */ 12 | 13 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 14 | 15 | #endif /* _BITS_UART_H */ 16 | -------------------------------------------------------------------------------- /src/include/bits/umalloc.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_UMALLOC_H 2 | #define _BITS_UMALLOC_H 3 | 4 | /** @file 5 | * 6 | * Dummy architecture-specific user memory allocation API implementations 7 | * 8 | * This file is included only if the architecture does not provide its 9 | * own version of this file. 10 | * 11 | */ 12 | 13 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 14 | 15 | #endif /* _BITS_UMALLOC_H */ 16 | -------------------------------------------------------------------------------- /src/include/bits/xen.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITS_XEN_H 2 | #define _BITS_XEN_H 3 | 4 | /** @file 5 | * 6 | * Dummy architecture-specific Xen interface 7 | * 8 | * This file is included only if the architecture does not provide its 9 | * own version of this file. 10 | * 11 | */ 12 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 13 | 14 | #include 15 | 16 | #endif /* _BITS_XEN_H */ 17 | -------------------------------------------------------------------------------- /src/include/cpu.h: -------------------------------------------------------------------------------- 1 | #ifndef CPU_H 2 | #define CPU_H 3 | 4 | #include "bits/cpu.h" 5 | 6 | #endif /* CPU_H */ 7 | -------------------------------------------------------------------------------- /src/include/endian.h: -------------------------------------------------------------------------------- 1 | #ifndef _ENDIAN_H 2 | #define _ENDIAN_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | /** Constant representing little-endian byte order 7 | * 8 | * Little-endian systems should define BYTE_ORDER as LITTLE_ENDIAN. 9 | * This constant is intended to be used only at compile time. 10 | */ 11 | #ifndef __LITTLE_ENDIAN 12 | #define __LITTLE_ENDIAN 0x44332211UL 13 | #endif 14 | 15 | /** Constant representing big-endian byte order 16 | * 17 | * Big-endian systems should define BYTE_ORDER as BIG_ENDIAN. 18 | * This constant is intended to be used only at compile time. 19 | */ 20 | #ifndef __BIG_ENDIAN 21 | #define __BIG_ENDIAN 0x11223344UL 22 | #endif 23 | 24 | #include "bits/endian.h" 25 | 26 | #endif /* _ENDIAN_H */ 27 | -------------------------------------------------------------------------------- /src/include/ipxe/acpimac.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_ACPIMAC_H 2 | #define _IPXE_ACPIMAC_H 3 | 4 | /** @file 5 | * 6 | * ACPI MAC address 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern int acpi_mac ( uint8_t *hw_addr ); 13 | 14 | #endif /* _IPXE_ACPIMAC_H */ 15 | -------------------------------------------------------------------------------- /src/include/ipxe/arc4.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_ARC4_H 2 | #define _IPXE_ARC4_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER ); 5 | 6 | struct cipher_algorithm; 7 | 8 | #include 9 | 10 | struct arc4_ctx { 11 | int i, j; 12 | u8 state[256]; 13 | }; 14 | 15 | #define ARC4_CTX_SIZE sizeof ( struct arc4_ctx ) 16 | 17 | extern struct cipher_algorithm arc4_algorithm; 18 | 19 | void arc4_skip ( const void *key, size_t keylen, size_t skip, 20 | const void *src, void *dst, size_t msglen ); 21 | 22 | #endif /* _IPXE_ARC4_H */ 23 | -------------------------------------------------------------------------------- /src/include/ipxe/bitops.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_BITOPS_H 2 | #define _IPXE_BITOPS_H 3 | 4 | /** @file 5 | * 6 | * Bit operations 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | void set_bit ( unsigned int bit, volatile void *bits ); 15 | void clear_bit ( unsigned int bit, volatile void *bits ); 16 | int test_and_set_bit ( unsigned int bit, volatile void *bits ); 17 | int test_and_clear_bit ( unsigned int bit, volatile void *bits ); 18 | 19 | #endif /* _IPXE_BITOPS_H */ 20 | -------------------------------------------------------------------------------- /src/include/ipxe/blocktrans.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_BLOCKTRANS_H 2 | #define _IPXE_BLOCKTRANS_H 3 | 4 | /** @file 5 | * 6 | * Block device translator 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | /** A block device translator */ 19 | struct block_translator { 20 | /** Reference count */ 21 | struct refcnt refcnt; 22 | /** Block device interface */ 23 | struct interface block; 24 | /** Data transfer interface */ 25 | struct interface xfer; 26 | 27 | /** Data transfer buffer */ 28 | struct xfer_buffer xferbuf; 29 | /** Data buffer */ 30 | userptr_t buffer; 31 | /** Block size */ 32 | size_t blksize; 33 | }; 34 | 35 | extern int block_translate ( struct interface *block, 36 | userptr_t buffer, size_t size ); 37 | 38 | #endif /* _IPXE_BLOCKTRANS_H */ 39 | -------------------------------------------------------------------------------- /src/include/ipxe/cachedhcp.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_CACHEDHCP_H 2 | #define _IPXE_CACHEDHCP_H 3 | 4 | /** @file 5 | * 6 | * Cached DHCP packet 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | 15 | struct net_device; 16 | struct cached_dhcp_packet; 17 | 18 | extern struct cached_dhcp_packet cached_dhcpack; 19 | extern struct cached_dhcp_packet cached_proxydhcp; 20 | extern struct cached_dhcp_packet cached_pxebs; 21 | 22 | extern int cachedhcp_record ( struct cached_dhcp_packet *cache, 23 | unsigned int vlan, userptr_t data, 24 | size_t max_len ); 25 | extern void cachedhcp_recycle ( struct net_device *netdev ); 26 | 27 | #endif /* _IPXE_CACHEDHCP_H */ 28 | -------------------------------------------------------------------------------- /src/include/ipxe/certstore.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_CERTSTORE_H 2 | #define _IPXE_CERTSTORE_H 3 | 4 | /** @file 5 | * 6 | * Certificate store 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern struct x509_chain certstore; 15 | 16 | extern void certstore_add ( struct x509_certificate *cert ); 17 | extern void certstore_del ( struct x509_certificate *cert ); 18 | 19 | #endif /* _IPXE_CERTSTORE_H */ 20 | -------------------------------------------------------------------------------- /src/include/ipxe/command.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_COMMAND_H 2 | #define _IPXE_COMMAND_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #include 7 | 8 | /** A command-line command */ 9 | struct command { 10 | /** Name of the command */ 11 | const char *name; 12 | /** 13 | * Function implementing the command 14 | * 15 | * @v argc Argument count 16 | * @v argv Argument list 17 | * @ret rc Return status code 18 | */ 19 | int ( * exec ) ( int argc, char **argv ); 20 | }; 21 | 22 | #define COMMANDS __table ( struct command, "commands" ) 23 | 24 | #define __command __table_entry ( COMMANDS, 01 ) 25 | 26 | extern char * concat_args ( char **args ); 27 | 28 | #endif /* _IPXE_COMMAND_H */ 29 | -------------------------------------------------------------------------------- /src/include/ipxe/crc32.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_CRC32_H 2 | #define _IPXE_CRC32_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #include 7 | 8 | u32 crc32_le ( u32 seed, const void *data, size_t len ); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/include/ipxe/der.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_DER_H 2 | #define _IPXE_DER_H 3 | 4 | /** @file 5 | * 6 | * DER image format 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern struct image_type der_image_type __image_type ( PROBE_NORMAL ); 15 | 16 | #endif /* _IPXE_DER_H */ 17 | -------------------------------------------------------------------------------- /src/include/ipxe/dhcparch.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_DHCPARCH_H 2 | #define _IPXE_DHCPARCH_H 3 | 4 | /** @file 5 | * 6 | * DHCP client architecture definitions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /* Include platform-specific client architecture definitions */ 13 | #define PLATFORM_DHCPARCH(_platform) 14 | #include PLATFORM_DHCPARCH(PLATFORM) 15 | 16 | #endif /* _IPXE_DHCPARCH_H */ 17 | -------------------------------------------------------------------------------- /src/include/ipxe/dhe.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_DHE_H 2 | #define _IPXE_DHE_H 3 | 4 | /** @file 5 | * 6 | * Ephemeral Diffie-Hellman key exchange 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern int dhe_key ( const void *modulus, size_t len, const void *generator, 15 | size_t generator_len, const void *partner, 16 | size_t partner_len, const void *private, 17 | size_t private_len, void *public, void *shared ); 18 | 19 | #endif /* _IPXE_DHE_H */ 20 | -------------------------------------------------------------------------------- /src/include/ipxe/downloader.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_DOWNLOADER_H 2 | #define _IPXE_DOWNLOADER_H 3 | 4 | /** @file 5 | * 6 | * Image downloader 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | struct interface; 13 | struct image; 14 | 15 | extern int create_downloader ( struct interface *job, struct image *image ); 16 | 17 | #endif /* _IPXE_DOWNLOADER_H */ 18 | -------------------------------------------------------------------------------- /src/include/ipxe/dummy_sanboot.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_DUMMY_SANBOOT_H 2 | #define _IPXE_DUMMY_SANBOOT_H 3 | 4 | /** @file 5 | * 6 | * Dummy SAN device 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef SANBOOT_DUMMY 13 | #define SANBOOT_PREFIX_dummy 14 | #else 15 | #define SANBOOT_PREFIX_dummy __dummy_ 16 | #endif 17 | 18 | #endif /* _IPXE_DUMMY_SANBOOT_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/ecdhe.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_ECDHE_H 2 | #define _IPXE_ECDHE_H 3 | 4 | /** @file 5 | * 6 | * Elliptic Curve Ephemeral Diffie-Hellman (ECDHE) key exchange 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern int ecdhe_key ( struct elliptic_curve *curve, const void *partner, 15 | const void *private, void *public, void *shared ); 16 | 17 | #endif /* _IPXE_ECDHE_H */ 18 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/Guid/HiiFormMapMethodGuid.h: -------------------------------------------------------------------------------- 1 | /** @file 2 | Guid used to identify HII FormMap configuration method. 3 | 4 | Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent 6 | 7 | @par Revision Reference: 8 | GUID defined in UEFI 2.2 spec. 9 | **/ 10 | 11 | #ifndef __EFI_HII_FORMMAP_GUID_H__ 12 | #define __EFI_HII_FORMMAP_GUID_H__ 13 | 14 | FILE_LICENCE ( BSD2_PATENT ); 15 | 16 | #define EFI_HII_STANDARD_FORM_GUID \ 17 | { 0x3bd2f4ec, 0xe524, 0x46e4, { 0xa9, 0xd8, 0x51, 0x1, 0x17, 0x42, 0x55, 0x62 } } 18 | 19 | extern EFI_GUID gEfiHiiStandardFormGuid; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/PiDxe.h: -------------------------------------------------------------------------------- 1 | /** @file 2 | 3 | Root include file for Mde Package DXE_CORE, DXE, RUNTIME, SMM, SAL type modules. 4 | 5 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
6 | SPDX-License-Identifier: BSD-2-Clause-Patent 7 | 8 | **/ 9 | 10 | #ifndef __PI_DXE_H__ 11 | #define __PI_DXE_H__ 12 | 13 | FILE_LICENCE ( BSD2_PATENT ); 14 | 15 | #include 16 | #include 17 | 18 | #include 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/Protocol/Rng.h: -------------------------------------------------------------------------------- 1 | /** @file 2 | EFI_RNG_PROTOCOL as defined in UEFI 2.4. 3 | The UEFI Random Number Generator Protocol is used to provide random bits for use 4 | in applications, or entropy for seeding other random number generators. 5 | 6 | Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
7 | SPDX-License-Identifier: BSD-2-Clause-Patent 8 | 9 | **/ 10 | 11 | #ifndef EFI_RNG_PROTOCOL_H_ 12 | #define EFI_RNG_PROTOCOL_H_ 13 | 14 | FILE_LICENCE ( BSD2_PATENT ); 15 | 16 | #include 17 | 18 | /// 19 | /// Global ID for the Random Number Generator Protocol 20 | /// 21 | #define EFI_RNG_PROTOCOL_GUID \ 22 | { \ 23 | 0x3152bca5, 0xeade, 0x433d, {0x86, 0x2e, 0xc0, 0x1c, 0xdc, 0x29, 0x1f, 0x44 } \ 24 | } 25 | 26 | typedef EFI_RNG_INTERFACE EFI_RNG_PROTOCOL; 27 | 28 | extern EFI_GUID gEfiRngProtocolGuid; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/Protocol/ShimLock.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_SHIM_LOCK_PROTOCOL_H 2 | #define _IPXE_EFI_SHIM_LOCK_PROTOCOL_H 3 | 4 | /** @file 5 | * 6 | * EFI "shim lock" protocol 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( BSD3 ); 11 | 12 | #define EFI_SHIM_LOCK_PROTOCOL_GUID \ 13 | { 0x605dab50, 0xe046, 0x4300, \ 14 | { 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23 } } 15 | 16 | #define SHIMAPI __asmcall 17 | 18 | typedef 19 | EFI_STATUS SHIMAPI 20 | (*EFI_SHIM_LOCK_VERIFY) ( 21 | IN VOID *buffer, 22 | IN UINT32 size 23 | ); 24 | 25 | typedef struct _EFI_SHIM_LOCK_PROTOCOL { 26 | EFI_SHIM_LOCK_VERIFY Verify; 27 | VOID *Reserved1; 28 | VOID *Reserved2; 29 | } EFI_SHIM_LOCK_PROTOCOL; 30 | 31 | #endif /*_IPXE_EFI_SHIM_LOCK_PROTOCOL_H */ 32 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/Uefi.h: -------------------------------------------------------------------------------- 1 | /** @file 2 | 3 | Root include file for Mde Package UEFI, UEFI_APPLICATION type modules. 4 | 5 | This is the include file for any module of type UEFI and UEFI_APPLICATION. Uefi modules only use 6 | types defined via this include file and can be ported easily to any 7 | environment. 8 | 9 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
10 | SPDX-License-Identifier: BSD-2-Clause-Patent 11 | 12 | **/ 13 | 14 | #ifndef __PI_UEFI_H__ 15 | #define __PI_UEFI_H__ 16 | 17 | FILE_LICENCE ( BSD2_PATENT ); 18 | 19 | #include 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_acpi.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_ACPI_H 2 | #define _IPXE_EFI_ACPI_H 3 | 4 | /** @file 5 | * 6 | * iPXE ACPI API for EFI 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef ACPI_EFI 13 | #define ACPI_PREFIX_efi 14 | #else 15 | #define ACPI_PREFIX_efi __efi_ 16 | #endif 17 | 18 | /** 19 | * Locate ACPI table 20 | * 21 | * @v signature Requested table signature 22 | * @v index Requested index of table with this signature 23 | * @ret table Table, or UNULL if not found 24 | */ 25 | static inline __attribute__ (( always_inline )) userptr_t 26 | ACPI_INLINE ( efi, acpi_find ) ( uint32_t signature, unsigned int index ) { 27 | 28 | return acpi_find_via_rsdt ( signature, index ); 29 | } 30 | 31 | #endif /* _IPXE_EFI_ACPI_H */ 32 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_autoboot.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_AUTOBOOT_H 2 | #define _IPXE_EFI_AUTOBOOT_H 3 | 4 | /** @file 5 | * 6 | * EFI autoboot device 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern int efi_set_autoboot_ll_addr ( EFI_HANDLE device, 15 | EFI_DEVICE_PATH_PROTOCOL *path ); 16 | 17 | #endif /* _IPXE_EFI_AUTOBOOT_H */ 18 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_autoexec.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_AUTOEXEC_H 2 | #define _IPXE_EFI_AUTOEXEC_H 3 | 4 | /** @file 5 | * 6 | * EFI autoexec script 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern int efi_autoexec_load ( void ); 13 | 14 | #endif /* _IPXE_EFI_AUTOEXEC_H */ 15 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_block.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_BLOCK_H 2 | #define _IPXE_EFI_BLOCK_H 3 | 4 | /** @block 5 | * 6 | * EFI block device protocols 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef SANBOOT_EFI 13 | #define SANBOOT_PREFIX_efi 14 | #else 15 | #define SANBOOT_PREFIX_efi __efi_ 16 | #endif 17 | 18 | #endif /* _IPXE_EFI_BLOCK_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_cachedhcp.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_CACHEDHCP_H 2 | #define _IPXE_EFI_CACHEDHCP_H 3 | 4 | /** @file 5 | * 6 | * EFI cached DHCP packet 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern int efi_cachedhcp_record ( EFI_HANDLE device, 15 | EFI_DEVICE_PATH_PROTOCOL *path ); 16 | 17 | #endif /* _IPXE_EFI_CACHEDHCP_H */ 18 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_cmdline.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_CMDLINE_H 2 | #define _IPXE_EFI_CMDLINE_H 3 | 4 | /** @file 5 | * 6 | * EFI command line 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | 15 | extern const wchar_t *efi_cmdline; 16 | extern size_t efi_cmdline_len; 17 | 18 | #endif /* _IPXE_EFI_CMDLINE_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_file.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_FILE_H 2 | #define _IPXE_EFI_FILE_H 3 | 4 | /** @file 5 | * 6 | * EFI file protocols 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern int efi_file_install ( EFI_HANDLE handle ); 13 | extern void efi_file_uninstall ( EFI_HANDLE handle ); 14 | 15 | #endif /* _IPXE_EFI_FILE_H */ 16 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_image.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_IMAGE_H 2 | #define _IPXE_EFI_IMAGE_H 3 | 4 | /** @file 5 | * 6 | * EFI images 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern struct image_type efi_image_type[] __image_type ( PROBE_NORMAL ); 15 | 16 | /** 17 | * Check if EFI image can be loaded directly 18 | * 19 | * @v image EFI image 20 | * @ret can_load EFI image can be loaded directly 21 | */ 22 | static inline int efi_can_load ( struct image *image ) { 23 | 24 | return ( image->type == efi_image_type ); 25 | } 26 | 27 | #endif /* _IPXE_EFI_IMAGE_H */ 28 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_mp.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_MP_H 2 | #define _IPXE_EFI_MP_H 3 | 4 | /** @file 5 | * 6 | * EFI multiprocessor API implementation 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef MPAPI_EFI 13 | #define MPAPI_PREFIX_efi 14 | #else 15 | #define MPAPI_PREFIX_efi __efi_ 16 | #endif 17 | 18 | /** 19 | * Calculate address as seen by a multiprocessor function 20 | * 21 | * @v address Address in boot processor address space 22 | * @ret address Address in application processor address space 23 | */ 24 | static inline __attribute__ (( always_inline )) mp_addr_t 25 | MPAPI_INLINE ( efi, mp_address ) ( void *address ) { 26 | 27 | return ( ( mp_addr_t ) address ); 28 | } 29 | 30 | #endif /* _IPXE_EFI_MP_H */ 31 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_nap.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_NAP_H 2 | #define _IPXE_EFI_NAP_H 3 | 4 | /** @file 5 | * 6 | * CPU sleeping 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef NAP_EFI 13 | #define NAP_PREFIX_efi 14 | #else 15 | #define NAP_PREFIX_efi __efi_ 16 | #endif 17 | 18 | #endif /* _IPXE_EFI_NAP_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_pxe.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_PXE_H 2 | #define _IPXE_EFI_PXE_H 3 | 4 | /** @file 5 | * 6 | * EFI PXE base code protocol 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 13 | 14 | extern int efi_pxe_install ( EFI_HANDLE handle, struct net_device *netdev ); 15 | extern void efi_pxe_uninstall ( EFI_HANDLE handle ); 16 | 17 | #endif /* _IPXE_EFI_PXE_H */ 18 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_reboot.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_REBOOT_H 2 | #define _IPXE_EFI_REBOOT_H 3 | 4 | /** @file 5 | * 6 | * iPXE reboot API for EFI 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef REBOOT_EFI 13 | #define REBOOT_PREFIX_efi 14 | #else 15 | #define REBOOT_PREFIX_efi __efi_ 16 | #endif 17 | 18 | #endif /* _IPXE_EFI_REBOOT_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_service.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_SERVICE_H 2 | #define _IPXE_EFI_SERVICE_H 3 | 4 | /** @file 5 | * 6 | * EFI service binding 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern int efi_service_add ( EFI_HANDLE service, EFI_GUID *binding, 15 | EFI_HANDLE *handle ); 16 | extern int efi_service_del ( EFI_HANDLE service, EFI_GUID *binding, 17 | EFI_HANDLE handle ); 18 | 19 | #endif /* _IPXE_EFI_SERVICE_H */ 20 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_shim.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_SHIM_H 2 | #define _IPXE_EFI_SHIM_H 3 | 4 | /** @file 5 | * 6 | * UEFI shim special handling 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | 15 | extern int efi_shim_require_loader; 16 | extern int efi_shim_allow_pxe; 17 | extern int efi_shim_allow_sbat; 18 | extern struct image_tag efi_shim __image_tag; 19 | 20 | extern int efi_shim_install ( struct image *shim, EFI_HANDLE handle, 21 | wchar_t **cmdline ); 22 | extern void efi_shim_uninstall ( void ); 23 | 24 | #endif /* _IPXE_EFI_SHIM_H */ 25 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_smbios.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_SMBIOS_H 2 | #define _IPXE_EFI_SMBIOS_H 3 | 4 | /** @file 5 | * 6 | * iPXE SMBIOS API for EFI 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef SMBIOS_EFI 13 | #define SMBIOS_PREFIX_efi 14 | #else 15 | #define SMBIOS_PREFIX_efi __efi_ 16 | #endif 17 | 18 | #endif /* _IPXE_EFI_SMBIOS_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_time.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_TIME_H 2 | #define _IPXE_EFI_TIME_H 3 | 4 | /** @file 5 | * 6 | * EFI time source 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | #ifdef TIME_EFI 15 | #define TIME_PREFIX_efi 16 | #else 17 | #define TIME_PREFIX_efi __efi_ 18 | #endif 19 | 20 | #endif /* _IPXE_EFI_TIME_H */ 21 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_umalloc.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_UMALLOC_H 2 | #define _IPXE_EFI_UMALLOC_H 3 | 4 | /** @file 5 | * 6 | * iPXE user memory allocation API for EFI 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef UMALLOC_EFI 13 | #define UMALLOC_PREFIX_efi 14 | #else 15 | #define UMALLOC_PREFIX_efi __efi_ 16 | #endif 17 | 18 | #endif /* _IPXE_EFI_UMALLOC_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_utils.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_UTILS_H 2 | #define _IPXE_EFI_UTILS_H 3 | 4 | /** @file 5 | * 6 | * EFI utilities 7 | */ 8 | 9 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 10 | 11 | #include 12 | 13 | struct device; 14 | 15 | extern int efi_locate_device ( EFI_HANDLE device, EFI_GUID *protocol, 16 | EFI_HANDLE *parent, unsigned int skip ); 17 | extern int efi_child_add ( EFI_HANDLE parent, EFI_HANDLE child ); 18 | extern void efi_child_del ( EFI_HANDLE parent, EFI_HANDLE child ); 19 | extern void efi_device_info ( EFI_HANDLE device, const char *prefix, 20 | struct device *dev ); 21 | 22 | #endif /* _IPXE_EFI_UTILS_H */ 23 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_veto.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_VETO_H 2 | #define _IPXE_EFI_VETO_H 3 | 4 | /** @file 5 | * 6 | * EFI driver vetoes 7 | */ 8 | 9 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 10 | 11 | extern void efi_veto ( void ); 12 | 13 | #endif /* _IPXE_EFI_VETO_H */ 14 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_watchdog.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_WATCHDOG_H 2 | #define _IPXE_EFI_WATCHDOG_H 3 | 4 | /** @file 5 | * 6 | * EFI watchdog holdoff timer 7 | */ 8 | 9 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 10 | 11 | extern struct retry_timer efi_watchdog; 12 | 13 | /** 14 | * Start EFI watchdog holdoff timer 15 | * 16 | */ 17 | static inline void efi_watchdog_start ( void ) { 18 | 19 | start_timer_nodelay ( &efi_watchdog ); 20 | } 21 | 22 | /** 23 | * Stop EFI watchdog holdoff timer 24 | * 25 | */ 26 | static inline void efi_watchdog_stop ( void ) { 27 | 28 | stop_timer ( &efi_watchdog ); 29 | } 30 | 31 | #endif /* _IPXE_EFI_WATCHDOG_H */ 32 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/efi_wrap.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_WRAP_H 2 | #define _IPXE_EFI_WRAP_H 3 | 4 | /** @file 5 | * 6 | * EFI driver interface 7 | */ 8 | 9 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 10 | 11 | #include 12 | 13 | extern EFI_BOOT_SERVICES * efi_wrap_bs ( void ); 14 | extern void efi_wrap ( EFI_HANDLE handle ); 15 | 16 | #endif /* _IPXE_EFI_WRAP_H */ 17 | -------------------------------------------------------------------------------- /src/include/ipxe/efi/mnpnet.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_EFI_MNPNET_H 2 | #define _IPXE_EFI_MNPNET_H 3 | 4 | /** @file 5 | * 6 | * MNP NIC driver 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | struct efi_device; 13 | struct net_device; 14 | 15 | extern int mnpnet_start ( struct efi_device *efidev ); 16 | extern void mnpnet_stop ( struct efi_device *efidev ); 17 | extern int mnptemp_create ( EFI_HANDLE handle, struct net_device **netdev ); 18 | extern void mnptemp_destroy ( struct net_device *netdev ); 19 | 20 | #endif /* _IPXE_EFI_MNPNET_H */ 21 | -------------------------------------------------------------------------------- /src/include/ipxe/elf.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_ELF_H 2 | #define _IPXE_ELF_H 3 | 4 | /** 5 | * @file 6 | * 7 | * ELF image format 8 | * 9 | */ 10 | 11 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | typedef Elf32_Ehdr Elf_Ehdr; 18 | typedef Elf32_Phdr Elf_Phdr; 19 | typedef Elf32_Off Elf_Off; 20 | #define ELFCLASS ELFCLASS32 21 | 22 | extern int elf_segments ( struct image *image, Elf_Ehdr *ehdr, 23 | int ( * process ) ( struct image *image, 24 | Elf_Phdr *phdr, physaddr_t dest ), 25 | physaddr_t *entry, physaddr_t *max ); 26 | extern int elf_load ( struct image *image, physaddr_t *entry, physaddr_t *max ); 27 | 28 | #endif /* _IPXE_ELF_H */ 29 | -------------------------------------------------------------------------------- /src/include/ipxe/errortab.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_ERRORTAB_H 2 | #define _IPXE_ERRORTAB_H 3 | 4 | /** @file 5 | * 6 | * Error message tables 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | struct errortab { 15 | int errno; 16 | const char *text; 17 | }; 18 | 19 | #define ERRORTAB __table ( struct errortab, "errortab" ) 20 | 21 | #define __errortab __table_entry ( ERRORTAB, 01 ) 22 | 23 | #define __einfo_errortab( einfo ) { \ 24 | .errno = __einfo_errno ( einfo ), \ 25 | .text = __einfo_desc ( einfo ), \ 26 | } 27 | 28 | #endif /* _IPXE_ERRORTAB_H */ 29 | -------------------------------------------------------------------------------- /src/include/ipxe/fakedhcp.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_FAKEDHCP_H 2 | #define _IPXE_FAKEDHCP_H 3 | 4 | /** @file 5 | * 6 | * Fake DHCP packets 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | struct net_device; 15 | 16 | extern int create_fakedhcpdiscover ( struct net_device *netdev, 17 | void *data, size_t max_len ); 18 | extern int create_fakedhcpack ( struct net_device *netdev, 19 | void *data, size_t max_len ); 20 | extern int create_fakepxebsack ( struct net_device *netdev, 21 | void *data, size_t max_len ); 22 | 23 | #endif /* _IPXE_FAKEDHCP_H */ 24 | -------------------------------------------------------------------------------- /src/include/ipxe/ftp.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_FTP_H 2 | #define _IPXE_FTP_H 3 | 4 | /** @file 5 | * 6 | * File transfer protocol 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** FTP default port */ 13 | #define FTP_PORT 21 14 | 15 | #endif /* _IPXE_FTP_H */ 16 | -------------------------------------------------------------------------------- /src/include/ipxe/gdbserial.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_GDBSERIAL_H 2 | #define _IPXE_GDBSERIAL_H 3 | 4 | /** @file 5 | * 6 | * GDB remote debugging over serial 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | struct gdb_transport; 15 | 16 | extern struct gdb_transport * gdbserial_configure ( unsigned int port, 17 | unsigned int baud, 18 | uint8_t lcr ); 19 | 20 | #endif /* _IPXE_GDBSERIAL_H */ 21 | -------------------------------------------------------------------------------- /src/include/ipxe/gdbudp.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_GDBUDP_H 2 | #define _IPXE_GDBUDP_H 3 | 4 | /** @file 5 | * 6 | * GDB remote debugging over UDP 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | struct sockaddr_in; 13 | struct gdb_transport; 14 | 15 | /** 16 | * Set up the UDP transport with network address 17 | * 18 | * @name network device name 19 | * @addr IP address and UDP listen port, may be NULL and fields may be zero 20 | * @ret transport suitable for starting the GDB stub or NULL on error 21 | */ 22 | struct gdb_transport *gdbudp_configure ( const char *name, struct sockaddr_in *addr ); 23 | 24 | #endif /* _IPXE_GDBUDP_H */ 25 | -------------------------------------------------------------------------------- /src/include/ipxe/hash_df.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_HASH_DF_H 2 | #define _IPXE_HASH_DF_H 3 | 4 | /** @file 5 | * 6 | * Hash-based derivation function (Hash_df) 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | 15 | extern void hash_df ( struct digest_algorithm *hash, const void *input, 16 | size_t input_len, void *output, size_t output_len ); 17 | 18 | #endif /* _IPXE_HASH_DF_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/hidemem.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_HIDEMEM_H 2 | #define _IPXE_HIDEMEM_H 3 | 4 | /** 5 | * @file 6 | * 7 | * Hidden memory regions 8 | * 9 | */ 10 | 11 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 12 | 13 | #include 14 | 15 | extern void hide_umalloc ( physaddr_t start, physaddr_t end ); 16 | 17 | #endif /* _IPXE_HIDEMEM_H */ 18 | -------------------------------------------------------------------------------- /src/include/ipxe/ib_cmrc.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_IB_CMRC_H 2 | #define _IPXE_IB_CMRC_H 3 | 4 | /** @file 5 | * 6 | * Infiniband Communication-managed Reliable Connections 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( BSD2 ); 11 | 12 | #include 13 | #include 14 | 15 | extern int ib_cmrc_open ( struct interface *xfer, struct ib_device *ibdev, 16 | union ib_gid *dgid, union ib_guid *service_id, 17 | const char *name ); 18 | 19 | #endif /* _IPXE_IB_CMRC_H */ 20 | -------------------------------------------------------------------------------- /src/include/ipxe/ib_service.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_IB_SERVICE_H 2 | #define _IPXE_IB_SERVICE_H 3 | 4 | /** @file 5 | * 6 | * Infiniband service records 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | 15 | extern struct ib_mad_transaction * 16 | ib_create_service_madx ( struct ib_device *ibdev, 17 | struct ib_mad_interface *mi, const char *name, 18 | struct ib_mad_transaction_operations *op ); 19 | 20 | #endif /* _IPXE_IB_SERVICE_H */ 21 | -------------------------------------------------------------------------------- /src/include/ipxe/ib_sma.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_IB_SMA_H 2 | #define _IPXE_IB_SMA_H 3 | 4 | /** @file 5 | * 6 | * Infiniband subnet management agent 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | struct ib_device; 13 | struct ib_mad_interface; 14 | 15 | extern int ib_create_sma ( struct ib_device *ibdev, 16 | struct ib_mad_interface *mi ); 17 | extern void ib_destroy_sma ( struct ib_device *ibdev, 18 | struct ib_mad_interface *mi ); 19 | 20 | #endif /* _IPXE_IB_SMA_H */ 21 | -------------------------------------------------------------------------------- /src/include/ipxe/ib_smc.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_IB_SMC_H 2 | #define _IPXE_IB_SMC_H 3 | 4 | /** @file 5 | * 6 | * Infiniband Subnet Management Client 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | typedef int ( * ib_local_mad_t ) ( struct ib_device *ibdev, 15 | union ib_mad *mad ); 16 | 17 | extern int ib_smc_init ( struct ib_device *ibdev, ib_local_mad_t local_mad ); 18 | extern int ib_smc_update ( struct ib_device *ibdev, ib_local_mad_t local_mad ); 19 | 20 | #endif /* _IPXE_IB_SMC_H */ 21 | -------------------------------------------------------------------------------- /src/include/ipxe/iomap_virt.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_IOMAP_VIRT_H 2 | #define _IPXE_IOMAP_VIRT_H 3 | 4 | /** @file 5 | * 6 | * iPXE I/O mapping API using phys_to_virt() 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef IOMAP_VIRT 13 | #define IOMAP_PREFIX_virt 14 | #else 15 | #define IOMAP_PREFIX_virt __virt_ 16 | #endif 17 | 18 | static inline __always_inline void * 19 | IOMAP_INLINE ( virt, ioremap ) ( unsigned long bus_addr, size_t len __unused ) { 20 | return ( bus_addr ? phys_to_virt ( bus_addr ) : NULL ); 21 | } 22 | 23 | static inline __always_inline void 24 | IOMAP_INLINE ( virt, iounmap ) ( volatile const void *io_addr __unused ) { 25 | /* Nothing to do */ 26 | } 27 | 28 | static inline __always_inline unsigned long 29 | IOMAP_INLINE ( virt, io_to_bus ) ( volatile const void *io_addr ) { 30 | return virt_to_phys ( io_addr ); 31 | } 32 | 33 | #endif /* _IPXE_IOMAP_VIRT_H */ 34 | -------------------------------------------------------------------------------- /src/include/ipxe/isqrt.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_ISQRT_H 2 | #define _IPXE_ISQRT_H 3 | 4 | /** @file 5 | * 6 | * Integer square root 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern unsigned long isqrt ( unsigned long value ); 13 | 14 | #endif /* _IPXE_ISQRT_H */ 15 | -------------------------------------------------------------------------------- /src/include/ipxe/linebuf.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_LINEBUF_H 2 | #define _IPXE_LINEBUF_H 3 | 4 | /** @file 5 | * 6 | * Line buffering 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | 15 | /** A line buffer */ 16 | struct line_buffer { 17 | /** Data buffer */ 18 | char *data; 19 | /** Length of buffered data */ 20 | size_t len; 21 | /** Most recently consumed length */ 22 | size_t consumed; 23 | }; 24 | 25 | extern char * buffered_line ( struct line_buffer *linebuf ); 26 | extern int line_buffer ( struct line_buffer *linebuf, 27 | const char *data, size_t len ); 28 | extern void empty_line_buffer ( struct line_buffer *linebuf ); 29 | 30 | #endif /* _IPXE_LINEBUF_H */ 31 | -------------------------------------------------------------------------------- /src/include/ipxe/lineconsole.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_LINECONSOLE_H 2 | #define _IPXE_LINECONSOLE_H 3 | 4 | /** @file 5 | * 6 | * Line-based console 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | 15 | /** A line-based console */ 16 | struct line_console { 17 | /** Data buffer 18 | * 19 | * Must initially be filled with NULs 20 | */ 21 | char *buffer; 22 | /** Current index within buffer */ 23 | size_t index; 24 | /** Length of buffer 25 | * 26 | * The final character of the buffer will only ever be used as 27 | * a potential terminating NUL. 28 | */ 29 | size_t len; 30 | /** ANSI escape sequence context */ 31 | struct ansiesc_context ctx; 32 | }; 33 | 34 | extern size_t line_putchar ( struct line_console *line, int character ); 35 | 36 | #endif /* _IPXE_LINECONSOLE_H */ 37 | -------------------------------------------------------------------------------- /src/include/ipxe/linux/dhcparch.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_LINUX_DHCPARCH_H 2 | #define _IPXE_LINUX_DHCPARCH_H 3 | 4 | /** @file 5 | * 6 | * DHCP client architecture definitions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /* 13 | * There are no specification-defined values for DHCP architecture for 14 | * PXE clients running as Linux userspace applications. Pretend to be 15 | * the equivalent EFI client. 16 | * 17 | */ 18 | #include 19 | 20 | #endif /* _IPXE_LINUX_DHCPARCH_H */ 21 | -------------------------------------------------------------------------------- /src/include/ipxe/linux/linux_acpi.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_LINUX_ACPI_H 2 | #define _IPXE_LINUX_ACPI_H 3 | 4 | /** @file 5 | * 6 | * iPXE ACPI API for Linux 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef ACPI_LINUX 13 | #define ACPI_PREFIX_linux 14 | #else 15 | #define ACPI_PREFIX_linux __linux_ 16 | #endif 17 | 18 | #endif /* _IPXE_LINUX_ACPI_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/linux/linux_nap.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_LINUX_NAP_H 2 | #define _IPXE_LINUX_NAP_H 3 | 4 | /** @file 5 | * 6 | * Linux CPU sleeping 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef NAP_LINUX 13 | #define NAP_PREFIX_linux 14 | #else 15 | #define NAP_PREFIX_linux __linux_ 16 | #endif 17 | 18 | #endif /* _IPXE_LINUX_NAP_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/linux/linux_smbios.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_LINUX_SMBIOS_H 2 | #define _IPXE_LINUX_SMBIOS_H 3 | 4 | /** @file 5 | * 6 | * iPXE SMBIOS API for Linux 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef SMBIOS_LINUX 13 | #define SMBIOS_PREFIX_linux 14 | #else 15 | #define SMBIOS_PREFIX_linux __linux_ 16 | #endif 17 | 18 | #endif /* _IPXE_LINUX_SMBIOS_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/linux/linux_time.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_LINUX_TIME_H 2 | #define _IPXE_LINUX_TIME_H 3 | 4 | /** @file 5 | * 6 | * Linux time source 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef TIME_LINUX 13 | #define TIME_PREFIX_linux 14 | #else 15 | #define TIME_PREFIX_linux __linux_ 16 | #endif 17 | 18 | #endif /* _IPXE_LINUX_TIME_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/linux/linux_umalloc.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_LINUX_UMALLOC_H 2 | #define _IPXE_LINUX_UMALLOC_H 3 | 4 | /** @file 5 | * 6 | * iPXE user memory allocation API for Linux 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef UMALLOC_LINUX 13 | #define UMALLOC_PREFIX_linux 14 | #else 15 | #define UMALLOC_PREFIX_linux __linux_ 16 | #endif 17 | 18 | #endif /* _IPXE_LINUX_UMALLOC_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/linux_sysfs.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_LINUX_SYSFS_H 2 | #define _IPXE_LINUX_SYSFS_H 3 | 4 | /** @file 5 | * 6 | * Linux sysfs files 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER ); 11 | 12 | #include 13 | 14 | extern int linux_sysfs_read ( const char *filename, userptr_t *data ); 15 | 16 | #endif /* _IPXE_LINUX_SYSFS_H */ 17 | -------------------------------------------------------------------------------- /src/include/ipxe/login_ui.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_LOGIN_UI_H 2 | #define _IPXE_LOGIN_UI_H 3 | 4 | /** @file 5 | * 6 | * Login UI 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern int login_ui ( void ); 13 | 14 | #endif /* _IPXE_LOGIN_UI_H */ 15 | -------------------------------------------------------------------------------- /src/include/ipxe/memblock.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_MEMBLOCK_H 2 | #define _IPXE_MEMBLOCK_H 3 | 4 | /** @file 5 | * 6 | * Largest memory block 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | 15 | extern size_t largest_memblock ( userptr_t *start ); 16 | 17 | #endif /* _IPXE_MEMBLOCK_H */ 18 | -------------------------------------------------------------------------------- /src/include/ipxe/message.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_MESSAGE_H 2 | #define _IPXE_MESSAGE_H 3 | 4 | /** @file 5 | * 6 | * Message printing 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern void msg ( unsigned int row, const char *fmt, ... ); 13 | extern void clearmsg ( unsigned int row ); 14 | extern void alert ( unsigned int row, const char *fmt, ... ); 15 | 16 | #endif /* _IPXE_MESSAGE_H */ 17 | -------------------------------------------------------------------------------- /src/include/ipxe/monojob.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_MONOJOB_H 2 | #define _IPXE_MONOJOB_H 3 | 4 | /** @file 5 | * 6 | * Single foreground job 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | struct interface; 13 | 14 | extern struct interface monojob; 15 | 16 | extern int monojob_wait ( const char *string, unsigned long timeout ); 17 | 18 | #endif /* _IPXE_MONOJOB_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/netbios.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_NETBIOS_H 2 | #define _IPXE_NETBIOS_H 3 | 4 | /** @file 5 | * 6 | * NetBIOS user names 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern const char * netbios_domain ( char **username ); 13 | 14 | /** 15 | * Restore NetBIOS [domain\]username 16 | * 17 | * @v domain NetBIOS domain name 18 | * @v username NetBIOS user name 19 | * 20 | * Restore the separator in a NetBIOS [domain\]username as split by 21 | * netbios_domain(). 22 | */ 23 | static inline void netbios_domain_undo ( const char *domain, char *username ) { 24 | 25 | /* Restore separator, if applicable */ 26 | if ( domain ) 27 | username[-1] = '\\'; 28 | } 29 | 30 | #endif /* _IPXE_NETBIOS_H */ 31 | -------------------------------------------------------------------------------- /src/include/ipxe/nfs_open.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_NFS_OPEN_H 2 | #define _IPXE_NFS_OPEN_H 3 | 4 | /** @file 5 | * 6 | * Network File System protocol. 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #endif /* _IPXE_NFS_OPEN_H */ 13 | -------------------------------------------------------------------------------- /src/include/ipxe/nfs_uri.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_NFS_URI_H 2 | #define _IPXE_NFS_URI_H 3 | 4 | /** @file 5 | * 6 | * Network File System protocol URI handling functions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | struct nfs_uri { 15 | char *mountpoint; 16 | char *filename; 17 | char *path; 18 | char *lookup_pos; 19 | }; 20 | 21 | int nfs_uri_init ( struct nfs_uri *nfs_uri, const struct uri *uri ); 22 | int nfs_uri_next_mountpoint ( struct nfs_uri *uri ); 23 | int nfs_uri_symlink ( struct nfs_uri *uri, const char *symlink_value ); 24 | char *nfs_uri_mountpoint ( const struct nfs_uri *uri ); 25 | char *nfs_uri_next_path_component ( struct nfs_uri *uri ); 26 | void nfs_uri_free ( struct nfs_uri *uri ); 27 | 28 | 29 | #endif /* _IPXE_NFS_URI_H */ 30 | -------------------------------------------------------------------------------- /src/include/ipxe/null_acpi.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_NULL_ACPI_H 2 | #define _IPXE_NULL_ACPI_H 3 | 4 | /** @file 5 | * 6 | * Standard do-nothing ACPI interface 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef ACPI_NULL 13 | #define ACPI_PREFIX_null 14 | #else 15 | #define ACPI_PREFIX_null __null_ 16 | #endif 17 | 18 | static inline __attribute__ (( always_inline )) userptr_t 19 | ACPI_INLINE ( null, acpi_find ) ( uint32_t signature __unused, 20 | unsigned int index __unused ) { 21 | 22 | return UNULL; 23 | } 24 | 25 | #endif /* _IPXE_NULL_ACPI_H */ 26 | -------------------------------------------------------------------------------- /src/include/ipxe/null_mp.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_NULL_MP_H 2 | #define _IPXE_NULL_MP_H 3 | 4 | /** @file 5 | * 6 | * Null multiprocessor API implementation 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef MPAPI_NULL 13 | #define MPAPI_PREFIX_null 14 | #else 15 | #define MPAPI_PREFIX_null __null_ 16 | #endif 17 | 18 | static inline __attribute__ (( always_inline )) mp_addr_t 19 | MPAPI_INLINE ( null, mp_address ) ( void *address ) { 20 | 21 | return ( ( mp_addr_t ) address ); 22 | } 23 | 24 | static inline __attribute__ (( always_inline )) void 25 | MPAPI_INLINE ( null, mp_exec_boot ) ( mp_func_t func __unused, 26 | void *opaque __unused ) { 27 | /* Do nothing */ 28 | } 29 | 30 | static inline __attribute__ (( always_inline )) void 31 | MPAPI_INLINE ( null, mp_start_all ) ( mp_func_t func __unused, 32 | void *opaque __unused ) { 33 | /* Do nothing */ 34 | } 35 | 36 | #endif /* _IPXE_NULL_MP_H */ 37 | -------------------------------------------------------------------------------- /src/include/ipxe/null_nap.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_NULL_NAP_H 2 | #define _IPXE_NULL_NAP_H 3 | 4 | /** @file 5 | * 6 | * Null CPU sleeping 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef NAP_NULL 13 | #define NAP_PREFIX_null 14 | #else 15 | #define NAP_PREFIX_null __null_ 16 | #endif 17 | 18 | static inline __always_inline void 19 | NAP_INLINE ( null, cpu_nap ) ( void ) { 20 | /* Do nothing */ 21 | } 22 | 23 | #endif /* _IPXE_NULL_NAP_H */ 24 | -------------------------------------------------------------------------------- /src/include/ipxe/null_reboot.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_NULL_REBOOT_H 2 | #define _IPXE_NULL_REBOOT_H 3 | 4 | /** @file 5 | * 6 | * iPXE do-nothing reboot API 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef REBOOT_NULL 13 | #define REBOOT_PREFIX_null 14 | #else 15 | #define REBOOT_PREFIX_null __null_ 16 | #endif 17 | 18 | #endif /* _IPXE_NULL_REBOOT_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/null_sanboot.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_NULL_SANBOOT_H 2 | #define _IPXE_NULL_SANBOOT_H 3 | 4 | /** @file 5 | * 6 | * Standard do-nothing sanboot interface 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef SANBOOT_NULL 13 | #define SANBOOT_PREFIX_null 14 | #else 15 | #define SANBOOT_PREFIX_null __null_ 16 | #endif 17 | 18 | #endif /* _IPXE_NULL_SANBOOT_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/null_smbios.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_NULL_SMBIOS_H 2 | #define _IPXE_NULL_SMBIOS_H 3 | 4 | /** @file 5 | * 6 | * Null SMBIOS API 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef SMBIOS_NULL 13 | #define SMBIOS_PREFIX_null 14 | #else 15 | #define SMBIOS_PREFIX_null __null_ 16 | #endif 17 | 18 | #endif /* _IPXE_NULL_SMBIOS_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/null_time.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_NULL_TIME_H 2 | #define _IPXE_NULL_TIME_H 3 | 4 | /** @file 5 | * 6 | * Nonexistent time source 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #ifdef TIME_NULL 13 | #define TIME_PREFIX_null 14 | #else 15 | #define TIME_PREFIX_null __null_ 16 | #endif 17 | 18 | static inline __always_inline time_t 19 | TIME_INLINE ( null, time_now ) ( void ) { 20 | return 0; 21 | } 22 | 23 | #endif /* _IPXE_NULL_TIME_H */ 24 | -------------------------------------------------------------------------------- /src/include/ipxe/nvsvpd.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_NVSVPD_H 2 | #define _IPXE_NVSVPD_H 3 | 4 | /** 5 | * @file 6 | * 7 | * Non-Volatile Storage using Vital Product Data 8 | * 9 | */ 10 | 11 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 12 | 13 | #include 14 | #include 15 | 16 | struct nvo_block; 17 | struct refcnt; 18 | 19 | /** An NVS VPD device */ 20 | struct nvs_vpd_device { 21 | /** NVS device */ 22 | struct nvs_device nvs; 23 | /** PCI VPD device */ 24 | struct pci_vpd vpd; 25 | }; 26 | 27 | extern int nvs_vpd_init ( struct nvs_vpd_device *nvsvpd, 28 | struct pci_device *pci ); 29 | extern void nvs_vpd_nvo_init ( struct nvs_vpd_device *nvsvpd, 30 | unsigned int field, struct nvo_block *nvo, 31 | struct refcnt *refcnt ); 32 | 33 | #endif /* IPXE_NVSVPD_H */ 34 | -------------------------------------------------------------------------------- /src/include/ipxe/p256.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_P256_H 2 | #define _IPXE_P256_H 3 | 4 | /** @file 5 | * 6 | * NIST P-256 elliptic curve 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** P-256 value length */ 15 | #define P256_LEN ( 256 / 8 ) 16 | 17 | extern struct elliptic_curve p256_curve; 18 | 19 | #endif /* _IPXE_P256_H */ 20 | -------------------------------------------------------------------------------- /src/include/ipxe/p384.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_P384_H 2 | #define _IPXE_P384_H 3 | 4 | /** @file 5 | * 6 | * NIST P-384 elliptic curve 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** P-384 value length */ 15 | #define P384_LEN ( 384 / 8 ) 16 | 17 | extern struct elliptic_curve p384_curve; 18 | 19 | #endif /* _IPXE_P384_H */ 20 | -------------------------------------------------------------------------------- /src/include/ipxe/pem.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_PEM_H 2 | #define _IPXE_PEM_H 3 | 4 | /** @file 5 | * 6 | * PEM-encoded ASN.1 data 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | /** Pre-encapsulation boundary marker */ 18 | #define PEM_BEGIN "-----BEGIN" 19 | 20 | /** Post-encapsulation boundary marker */ 21 | #define PEM_END "-----END" 22 | 23 | extern int pem_asn1 ( userptr_t data, size_t len, size_t offset, 24 | struct asn1_cursor **cursor ); 25 | 26 | extern struct image_type pem_image_type __image_type ( PROBE_NORMAL ); 27 | 28 | #endif /* _IPXE_PEM_H */ 29 | -------------------------------------------------------------------------------- /src/include/ipxe/ping.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_PING_H 2 | #define _IPXE_PING_H 3 | 4 | /** @file 5 | * 6 | * ICMP ping protocol 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | 15 | extern int ping_rx ( struct io_buffer *iobuf, 16 | struct sockaddr_tcpip *st_src ); 17 | 18 | #endif /* _IPXE_PING_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/pinger.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_PINGER_H 2 | #define _IPXE_PINGER_H 3 | 4 | /** @file 5 | * 6 | * ICMP ping sender 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | extern int create_pinger ( struct interface *job, const char *hostname, 17 | unsigned long timeout, size_t len, 18 | unsigned int count, 19 | void ( * callback ) ( struct sockaddr *peer, 20 | unsigned int sequence, 21 | size_t len, 22 | int rc ) ); 23 | 24 | #endif /* _IPXE_PINGER_H */ 25 | -------------------------------------------------------------------------------- /src/include/ipxe/quiesce.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_QUIESCE_H 2 | #define _IPXE_QUIESCE_H 3 | 4 | /** @file 5 | * 6 | * Quiesce system 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** A quiescer */ 15 | struct quiescer { 16 | /** Quiesce system */ 17 | void ( * quiesce ) ( void ); 18 | /** Unquiesce system */ 19 | void ( * unquiesce ) ( void ); 20 | }; 21 | 22 | /** Quiescer table */ 23 | #define QUIESCERS __table ( struct quiescer, "quiescers" ) 24 | 25 | /** Declare a quiescer */ 26 | #define __quiescer __table_entry ( QUIESCERS, 01 ) 27 | 28 | extern void quiesce ( void ); 29 | extern void unquiesce ( void ); 30 | 31 | #endif /* _IPXE_QUIESCE_H */ 32 | -------------------------------------------------------------------------------- /src/include/ipxe/random_nz.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_RANDOM_NZ_H 2 | #define _IPXE_RANDOM_NZ_H 3 | 4 | /** @file 5 | * 6 | * HMAC_DRBG algorithm 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern int get_random_nz ( void *data, size_t len ); 15 | 16 | #endif /* _IPXE_RANDOM_NZ_H */ 17 | -------------------------------------------------------------------------------- /src/include/ipxe/rarp.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_RARP_H 2 | #define _IPXE_RARP_H 3 | 4 | /** @file 5 | * 6 | * Reverse Address Resolution Protocol 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern struct net_protocol rarp_protocol __net_protocol; 15 | 16 | #endif /* _IPXE_RARP_H */ 17 | -------------------------------------------------------------------------------- /src/include/ipxe/rbg.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_RBG_H 2 | #define _IPXE_RBG_H 3 | 4 | /** @file 5 | * 6 | * RBG mechanism 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | 15 | /** An RBG */ 16 | struct random_bit_generator { 17 | /** DRBG state */ 18 | struct drbg_state state; 19 | /** Startup has been attempted */ 20 | int started; 21 | }; 22 | 23 | extern struct random_bit_generator rbg; 24 | 25 | extern int rbg_generate ( const void *additional, size_t additional_len, 26 | int prediction_resist, void *data, size_t len ); 27 | 28 | #endif /* _IPXE_RBG_H */ 29 | -------------------------------------------------------------------------------- /src/include/ipxe/rc80211.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_RC80211_H 2 | #define _IPXE_RC80211_H 3 | 4 | /** @file 5 | * 6 | * Rate-control algorithm prototype for 802.11. 7 | */ 8 | 9 | FILE_LICENCE ( GPL2_OR_LATER ); 10 | 11 | struct net80211_device; 12 | struct rc80211_ctx; 13 | 14 | struct rc80211_ctx * rc80211_init ( struct net80211_device *dev ); 15 | void rc80211_update_tx ( struct net80211_device *dev, int retries, int rc ); 16 | void rc80211_update_rx ( struct net80211_device *dev, int retry, u16 rate ); 17 | void rc80211_free ( struct rc80211_ctx *ctx ); 18 | 19 | #endif /* _IPXE_RC80211_H */ 20 | -------------------------------------------------------------------------------- /src/include/ipxe/rootcert.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_ROOTCERT_H 2 | #define _IPXE_ROOTCERT_H 3 | 4 | /** @file 5 | * 6 | * Root certificate store 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern struct x509_root root_certificates; 15 | 16 | #endif /* _IPXE_ROOTCERT_H */ 17 | -------------------------------------------------------------------------------- /src/include/ipxe/script.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_SCRIPT_H 2 | #define _IPXE_SCRIPT_H 3 | 4 | /** @file 5 | * 6 | * iPXE scripts 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern struct image_type script_image_type __image_type ( PROBE_NORMAL ); 15 | 16 | #endif /* _IPXE_SCRIPT_H */ 17 | -------------------------------------------------------------------------------- /src/include/ipxe/segment.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_SEGMENT_H 2 | #define _IPXE_SEGMENT_H 3 | 4 | /** 5 | * @file 6 | * 7 | * Executable image segments 8 | * 9 | */ 10 | 11 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 12 | 13 | #include 14 | 15 | extern int prep_segment ( userptr_t segment, size_t filesz, size_t memsz ); 16 | 17 | #endif /* _IPXE_SEGMENT_H */ 18 | -------------------------------------------------------------------------------- /src/include/ipxe/serial.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_SERIAL_H 2 | #define _IPXE_SERIAL_H 3 | 4 | /** @file 5 | * 6 | * Serial console 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern struct uart serial_console; 15 | 16 | #endif /* _IPXE_SERIAL_H */ 17 | -------------------------------------------------------------------------------- /src/include/ipxe/settings_ui.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_SETTINGS_UI_H 2 | #define _IPXE_SETTINGS_UI_H 3 | 4 | /** @file 5 | * 6 | * Option configuration console 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | struct settings; 13 | 14 | extern int settings_ui ( struct settings *settings ) __nonnull; 15 | 16 | #endif /* _IPXE_SETTINGS_UI_H */ 17 | -------------------------------------------------------------------------------- /src/include/ipxe/shell.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_SHELL_H 2 | #define _IPXE_SHELL_H 3 | 4 | /** @file 5 | * 6 | * Minimal command shell 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | /** Shell stop states */ 13 | enum shell_stop_state { 14 | /** Continue processing */ 15 | SHELL_CONTINUE = 0, 16 | /** 17 | * Stop processing current command line 18 | * 19 | * This is the stop state entered by commands that change the flow 20 | * of execution, such as "goto". 21 | */ 22 | SHELL_STOP_COMMAND = 1, 23 | /** 24 | * Stop processing commands 25 | * 26 | * This is the stop state entered by commands that terminate 27 | * the flow of execution, such as "exit". 28 | */ 29 | SHELL_STOP_COMMAND_SEQUENCE = 2, 30 | }; 31 | 32 | extern void shell_stop ( int stop ); 33 | extern int shell_stopped ( int stop ); 34 | extern int shell ( void ); 35 | 36 | #endif /* _IPXE_SHELL_H */ 37 | -------------------------------------------------------------------------------- /src/include/ipxe/string.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_STRING_H 2 | #define _IPXE_STRING_H 3 | 4 | /** @file 5 | * 6 | * String functions 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern unsigned int digit_value ( unsigned int digit ); 13 | 14 | #endif /* _IPXE_STRING_H */ 15 | -------------------------------------------------------------------------------- /src/include/ipxe/udp.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_UDP_H 2 | #define _IPXE_UDP_H 3 | 4 | /** @file 5 | * 6 | * UDP protocol 7 | * 8 | * This file defines the iPXE UDP API. 9 | * 10 | */ 11 | 12 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | struct interface; 20 | struct sockaddr; 21 | 22 | /** 23 | * UDP constants 24 | */ 25 | 26 | /** 27 | * A UDP header 28 | */ 29 | struct udp_header { 30 | /** Source port */ 31 | uint16_t src; 32 | /** Destination port */ 33 | uint16_t dest; 34 | /** Length */ 35 | uint16_t len; 36 | /** Checksum */ 37 | uint16_t chksum; 38 | }; 39 | 40 | extern int udp_open_promisc ( struct interface *xfer ); 41 | extern int udp_open ( struct interface *xfer, struct sockaddr *peer, 42 | struct sockaddr *local ); 43 | 44 | #endif /* _IPXE_UDP_H */ 45 | 46 | -------------------------------------------------------------------------------- /src/include/ipxe/validator.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_VALIDATOR_H 2 | #define _IPXE_VALIDATOR_H 3 | 4 | /** @file 5 | * 6 | * Certificate validator 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | #include 14 | 15 | extern int create_validator ( struct interface *job, struct x509_chain *chain, 16 | struct x509_root *root ); 17 | 18 | #endif /* _IPXE_VALIDATOR_H */ 19 | -------------------------------------------------------------------------------- /src/include/ipxe/version.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPXE_VERSION_H 2 | #define _IPXE_VERSION_H 3 | 4 | /** @file 5 | * 6 | * Version number 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern unsigned long build_timestamp; 15 | extern unsigned long build_id; 16 | extern const int product_major_version; 17 | extern const int product_minor_version; 18 | extern const char product_version[]; 19 | extern const char product_name[]; 20 | extern const char product_short_name[]; 21 | extern const char build_name[]; 22 | extern const wchar_t product_wversion[]; 23 | extern const wchar_t product_wname[]; 24 | extern const wchar_t product_short_wname[]; 25 | extern const wchar_t build_wname[]; 26 | 27 | #endif /* _IPXE_VERSION_H */ 28 | -------------------------------------------------------------------------------- /src/include/libgen.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBGEN_H 2 | #define _LIBGEN_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | extern char * basename ( char *path ); 7 | extern char * dirname ( char *path ); 8 | 9 | #endif /* _LIBGEN_H */ 10 | -------------------------------------------------------------------------------- /src/include/pc_kbd.h: -------------------------------------------------------------------------------- 1 | #ifndef _PC_KBD_H 2 | #define _PC_KBD_H 3 | 4 | int kbd_ischar(void); 5 | 6 | int kbd_getc(void); 7 | #endif 8 | -------------------------------------------------------------------------------- /src/include/pcmcia-opts.h: -------------------------------------------------------------------------------- 1 | // pcmcia-opts.h 2 | // special options file for development time. Later this could end in Config(?) 3 | #ifndef __pcmciaopts 4 | #define __pcmciaopts 5 | 6 | #define _yes_ 1 7 | #define _no_ 0 8 | 9 | #define SUPPORT_I82365 (_yes_) 10 | // #define SUPPORT_YENTA (_no_) 11 | // #define SUPPORT_SOME_DRIVER (_no_) 12 | 13 | #define PCMCIA_SHUTDOWN (_yes_) 14 | #define MAP_ATTRMEM_TO 0xd0000 15 | #define MAP_ATTRMEM_LEN 0x02000 16 | 17 | #define PDEBUG 3 18 | // The higher the more output you get, 0..3 19 | // Not fully implemented though, but for the future... 20 | 21 | #undef _yes_ 22 | #undef _no_ 23 | #endif 24 | -------------------------------------------------------------------------------- /src/include/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _SETJMP_H 2 | #define _SETJMP_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #include 7 | 8 | extern int __asmcall __attribute__ (( returns_twice )) 9 | setjmp ( jmp_buf env ); 10 | 11 | extern void __asmcall __attribute__ (( noreturn )) 12 | longjmp ( jmp_buf env, int val ); 13 | 14 | #endif /* _SETJMP_H */ 15 | -------------------------------------------------------------------------------- /src/include/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDBOOL_H 2 | #define _STDBOOL_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #define bool _Bool 7 | #define true 1 8 | #define false 0 9 | 10 | #endif /* _STDBOOL_H */ 11 | -------------------------------------------------------------------------------- /src/include/sys/time.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_TIME_H 2 | #define _SYS_TIME_H 3 | 4 | /** @file 5 | * 6 | * Date and time 7 | */ 8 | 9 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 10 | 11 | #include 12 | 13 | /** Seconds since the Epoch 14 | * 15 | * We use a 64-bit type to avoid Y2K38 issues, since we may have to 16 | * handle distant future dates (e.g. X.509 certificate expiry dates). 17 | */ 18 | typedef int64_t time_t; 19 | 20 | #endif /* _SYS_TIME_H */ 21 | -------------------------------------------------------------------------------- /src/include/unistd.h: -------------------------------------------------------------------------------- 1 | #ifndef _UNISTD_H 2 | #define _UNISTD_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #include 7 | #include 8 | 9 | extern int execv ( const char *command, char * const argv[] ); 10 | 11 | /** 12 | * Execute command 13 | * 14 | * @v command Command name 15 | * @v arg ... Argument list (starting with argv[0]) 16 | * @ret rc Command exit status 17 | * 18 | * This is a front end to execv(). 19 | */ 20 | #define execl( command, arg, ... ) ( { \ 21 | char * const argv[] = { (arg), ## __VA_ARGS__ }; \ 22 | int rc = execv ( (command), argv ); \ 23 | rc; \ 24 | } ) 25 | 26 | /* Pick up udelay() and sleep() */ 27 | #include 28 | 29 | static inline __always_inline void usleep ( unsigned long usecs ) { 30 | udelay ( usecs ); 31 | } 32 | 33 | #endif /* _UNISTD_H */ 34 | -------------------------------------------------------------------------------- /src/include/usr/certmgmt.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_CERTMGMT_H 2 | #define _USR_CERTMGMT_H 3 | 4 | /** @file 5 | * 6 | * Certificate management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern void certstat ( struct x509_certificate *cert ); 15 | 16 | #endif /* _USR_CERTMGMT_H */ 17 | -------------------------------------------------------------------------------- /src/include/usr/dhcpmgmt.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_DHCPMGMT_H 2 | #define _USR_DHCPMGMT_H 3 | 4 | /** @file 5 | * 6 | * DHCP management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | struct net_device; 13 | 14 | extern int pxebs ( struct net_device *netdev, unsigned int pxe_type ); 15 | 16 | #endif /* _USR_DHCPMGMT_H */ 17 | -------------------------------------------------------------------------------- /src/include/usr/fcmgmt.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_FCMGMT_H 2 | #define _USR_FCMGMT_H 3 | 4 | /** @file 5 | * 6 | * Fibre Channel management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | struct fc_port; 13 | struct fc_peer; 14 | struct fc_els_handler; 15 | 16 | extern void fcportstat ( struct fc_port *port ); 17 | extern void fcpeerstat ( struct fc_peer *peer ); 18 | extern int fcels ( struct fc_port *port, struct fc_port_id *peer_port_id, 19 | struct fc_els_handler *handler ); 20 | 21 | #endif /* _USR_FCMGMT_H */ 22 | -------------------------------------------------------------------------------- /src/include/usr/ibmgmt.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_IBMGMT_H 2 | #define _USR_IBMGMT_H 3 | 4 | /** @file 5 | * 6 | * Infiniband device management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | struct ib_device; 13 | 14 | extern void ibstat ( struct ib_device *ibdev ); 15 | 16 | #endif /* _USR_IBMGMT_H */ 17 | -------------------------------------------------------------------------------- /src/include/usr/ifmgmt.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_IFMGMT_H 2 | #define _USR_IFMGMT_H 3 | 4 | /** @file 5 | * 6 | * Network interface management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | struct net_device; 13 | struct net_device_configurator; 14 | 15 | extern int ifopen ( struct net_device *netdev ); 16 | extern int ifconf ( struct net_device *netdev, 17 | struct net_device_configurator *configurator, 18 | unsigned long timeout ); 19 | extern void ifclose ( struct net_device *netdev ); 20 | extern void ifstat ( struct net_device *netdev ); 21 | extern int iflinkwait ( struct net_device *netdev, unsigned long timeout, 22 | int verbose ); 23 | 24 | #endif /* _USR_IFMGMT_H */ 25 | -------------------------------------------------------------------------------- /src/include/usr/imgarchive.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_IMGARCHIVE_H 2 | #define _USR_IMGARCHIVE_H 3 | 4 | /** @file 5 | * 6 | * Archive image management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern int imgextract ( struct image *image, const char *name ); 15 | 16 | #endif /* _USR_IMGARCHIVE_H */ 17 | -------------------------------------------------------------------------------- /src/include/usr/imgcrypt.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_IMGCRYPT_H 2 | #define _USR_IMGCRYPT_H 3 | 4 | /** @file 5 | * 6 | * Image encryption management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern int imgdecrypt ( struct image *image, struct image *envelope, 15 | const char *name ); 16 | 17 | #endif /* _USR_IMGCRYPT_H */ 18 | -------------------------------------------------------------------------------- /src/include/usr/imgmgmt.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_IMGMGMT_H 2 | #define _USR_IMGMGMT_H 3 | 4 | /** @file 5 | * 6 | * Image management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern int imgdownload ( struct uri *uri, unsigned long timeout, 15 | struct image **image ); 16 | extern int imgdownload_string ( const char *uri_string, unsigned long timeout, 17 | struct image **image ); 18 | extern int imgacquire ( const char *name, unsigned long timeout, 19 | struct image **image ); 20 | extern void imgstat ( struct image *image ); 21 | extern int imgmem ( const char *name, userptr_t data, size_t len ); 22 | 23 | #endif /* _USR_IMGMGMT_H */ 24 | -------------------------------------------------------------------------------- /src/include/usr/imgtrust.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_IMGTRUST_H 2 | #define _USR_IMGTRUST_H 3 | 4 | /** @file 5 | * 6 | * Image trust management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern int imgverify ( struct image *image, struct image *signature, 15 | const char *name ); 16 | 17 | #endif /* _USR_IMGTRUST_H */ 18 | -------------------------------------------------------------------------------- /src/include/usr/ipstat.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_IPSTAT_H 2 | #define _USR_IPSTAT_H 3 | 4 | /** @file 5 | * 6 | * IP statistics 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern void ipstat ( void ); 13 | 14 | #endif /* _USR_IPSTAT_H */ 15 | -------------------------------------------------------------------------------- /src/include/usr/iwmgmt.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_IWMGMT_H 2 | #define _USR_IWMGMT_H 3 | 4 | /** @file 5 | * 6 | * Wireless network interface management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER ); 11 | 12 | struct net80211_device; 13 | 14 | extern void iwstat ( struct net80211_device *dev ); 15 | extern int iwlist ( struct net80211_device *dev ); 16 | 17 | #endif /* _USR_IWMGMT_H */ 18 | -------------------------------------------------------------------------------- /src/include/usr/lotest.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_LOTEST_H 2 | #define _USR_LOTEST_H 3 | 4 | /** @file 5 | * 6 | * Loopback testing 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern int loopback_test ( struct net_device *sender, 13 | struct net_device *receiver, 14 | size_t mtu, int broadcast ); 15 | 16 | #endif /* _USR_LOTEST_H */ 17 | -------------------------------------------------------------------------------- /src/include/usr/neighmgmt.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_NEIGHMGMT_H 2 | #define _USR_NEIGHMGMT_H 3 | 4 | /** @file 5 | * 6 | * Neighbour management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern void nstat ( void ); 13 | 14 | #endif /* _USR_NEIGHMGMT_H */ 15 | -------------------------------------------------------------------------------- /src/include/usr/nslookup.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_NSLOOKUP_H 2 | #define _USR_NSLOOKUP_H 3 | 4 | /** @file 5 | * 6 | * Standalone name resolution 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER ); 11 | 12 | extern int nslookup ( const char *name, const char *setting_name ); 13 | 14 | #endif /* _USR_NSLOOKUP_H */ 15 | -------------------------------------------------------------------------------- /src/include/usr/ntpmgmt.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_NTPMGMT_H 2 | #define _USR_NTPMGMT_H 3 | 4 | /** @file 5 | * 6 | * NTP management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern int ntp ( const char *hostname ); 13 | 14 | #endif /* _USR_NTPMGMT_H */ 15 | -------------------------------------------------------------------------------- /src/include/usr/pingmgmt.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_PINGMGMT_H 2 | #define _USR_PINGMGMT_H 3 | 4 | /** @file 5 | * 6 | * ICMP ping management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern int ping ( const char *hostname, unsigned long timeout, size_t len, 15 | unsigned int count, int quiet ); 16 | 17 | #endif /* _USR_PINGMGMT_H */ 18 | -------------------------------------------------------------------------------- /src/include/usr/profstat.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_PROFSTAT_H 2 | #define _USR_PROFSTAT_H 3 | 4 | /** @file 5 | * 6 | * Profiling 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern void profstat ( void ); 13 | 14 | #endif /* _USR_PROFSTAT_H */ 15 | -------------------------------------------------------------------------------- /src/include/usr/prompt.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_PROMPT_H 2 | #define _USR_PROMPT_H 3 | 4 | /** @file 5 | * 6 | * Prompt for keypress 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern int prompt ( const char *text, unsigned long timeout, int key ); 13 | 14 | #endif /* _USR_PROMPT_H */ 15 | -------------------------------------------------------------------------------- /src/include/usr/route.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_ROUTE_H 2 | #define _USR_ROUTE_H 3 | 4 | /** @file 5 | * 6 | * Routing management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | /** A routing family */ 15 | struct routing_family { 16 | /** 17 | * Print routes for a network device 18 | * 19 | * @v netdev Network device 20 | */ 21 | void ( * print ) ( struct net_device *netdev ); 22 | }; 23 | 24 | /** Routing family table */ 25 | #define ROUTING_FAMILIES __table ( struct routing_family, "routing_families" ) 26 | 27 | /** Declare a routing family */ 28 | #define __routing_family( order ) __table_entry ( ROUTING_FAMILIES, order ) 29 | 30 | #define ROUTING_IPV4 01 31 | #define ROUTING_IPV6 02 32 | 33 | extern void route ( void ); 34 | 35 | #endif /* _USR_ROUTE_H */ 36 | -------------------------------------------------------------------------------- /src/include/usr/shimmgmt.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_SHIMMGMT_H 2 | #define _USR_SHIMMGMT_H 3 | 4 | /** @file 5 | * 6 | * EFI shim management 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | #include 13 | 14 | extern int shim ( struct image *image, int require_loader, int allow_pxe, 15 | int allow_sbat ); 16 | 17 | #endif /* _USR_SHIMMGMT_H */ 18 | -------------------------------------------------------------------------------- /src/include/usr/sync.h: -------------------------------------------------------------------------------- 1 | #ifndef _USR_SYNC_H 2 | #define _USR_SYNC_H 3 | 4 | /** @file 5 | * 6 | * Wait for pending operations to complete 7 | * 8 | */ 9 | 10 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 | 12 | extern int sync ( unsigned long timeout ); 13 | 14 | #endif /* _USR_SYNC_H */ 15 | -------------------------------------------------------------------------------- /src/include/wchar.h: -------------------------------------------------------------------------------- 1 | #ifndef WCHAR_H 2 | #define WCHAR_H 3 | 4 | FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 5 | 6 | #include 7 | 8 | typedef void mbstate_t; 9 | 10 | /** 11 | * Convert wide character to multibyte sequence 12 | * 13 | * @v buf Buffer 14 | * @v wc Wide character 15 | * @v ps Shift state 16 | * @ret len Number of characters written 17 | * 18 | * This is a stub implementation, sufficient to handle basic ASCII 19 | * characters. 20 | */ 21 | static inline __attribute__ (( always_inline )) 22 | size_t wcrtomb ( char *buf, wchar_t wc, mbstate_t *ps __unused ) { 23 | *buf = wc; 24 | return 1; 25 | } 26 | 27 | extern size_t wcslen ( const wchar_t *string ); 28 | 29 | #endif /* WCHAR_H */ 30 | -------------------------------------------------------------------------------- /src/libgcc/__divdi3.c: -------------------------------------------------------------------------------- 1 | /* 2 | * arch/i386/libgcc/__divdi3.c 3 | */ 4 | 5 | #include "libgcc.h" 6 | 7 | __libgcc int64_t __divdi3(int64_t num, int64_t den) 8 | { 9 | return __divmoddi4(num, den, NULL); 10 | } 11 | -------------------------------------------------------------------------------- /src/libgcc/__divmoddi4.c: -------------------------------------------------------------------------------- 1 | #include "libgcc.h" 2 | 3 | __libgcc int64_t __divmoddi4(int64_t num, int64_t den, int64_t *rem_p) 4 | { 5 | int minus = 0; 6 | int64_t v; 7 | 8 | if ( num < 0 ) { 9 | num = -num; 10 | minus = 1; 11 | } 12 | if ( den < 0 ) { 13 | den = -den; 14 | minus ^= 1; 15 | } 16 | 17 | v = __udivmoddi4(num, den, (uint64_t *)rem_p); 18 | if ( minus ) { 19 | v = -v; 20 | if ( rem_p ) 21 | *rem_p = -(*rem_p); 22 | } 23 | 24 | return v; 25 | } 26 | -------------------------------------------------------------------------------- /src/libgcc/__moddi3.c: -------------------------------------------------------------------------------- 1 | /* 2 | * arch/i386/libgcc/__moddi3.c 3 | */ 4 | 5 | #include "libgcc.h" 6 | 7 | __libgcc int64_t __moddi3(int64_t num, int64_t den) 8 | { 9 | int64_t v; 10 | 11 | (void) __divmoddi4(num, den, &v); 12 | return v; 13 | } 14 | -------------------------------------------------------------------------------- /src/libgcc/__udivdi3.c: -------------------------------------------------------------------------------- 1 | /* 2 | * arch/i386/libgcc/__divdi3.c 3 | */ 4 | 5 | #include "libgcc.h" 6 | 7 | __libgcc uint64_t __udivdi3(uint64_t num, uint64_t den) 8 | { 9 | return __udivmoddi4(num, den, NULL); 10 | } 11 | -------------------------------------------------------------------------------- /src/libgcc/__udivmoddi4.c: -------------------------------------------------------------------------------- 1 | #include "libgcc.h" 2 | 3 | __libgcc uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem_p) 4 | { 5 | uint64_t quot = 0, qbit = 1; 6 | 7 | if ( den == 0 ) { 8 | return 1/((unsigned)den); /* Intentional divide by zero, without 9 | triggering a compiler warning which 10 | would abort the build */ 11 | } 12 | 13 | /* Left-justify denominator and count shift */ 14 | while ( (int64_t)den >= 0 ) { 15 | den <<= 1; 16 | qbit <<= 1; 17 | } 18 | 19 | while ( qbit ) { 20 | if ( den <= num ) { 21 | num -= den; 22 | quot += qbit; 23 | } 24 | den >>= 1; 25 | qbit >>= 1; 26 | } 27 | 28 | if ( rem_p ) 29 | *rem_p = num; 30 | 31 | return quot; 32 | } 33 | -------------------------------------------------------------------------------- /src/libgcc/__umoddi3.c: -------------------------------------------------------------------------------- 1 | /* 2 | * arch/i386/libgcc/__umoddi3.c 3 | */ 4 | 5 | #include "libgcc.h" 6 | 7 | __libgcc uint64_t __umoddi3(uint64_t num, uint64_t den) 8 | { 9 | uint64_t v; 10 | 11 | (void) __udivmoddi4(num, den, &v); 12 | return v; 13 | } 14 | -------------------------------------------------------------------------------- /src/libgcc/icc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Intel's compiler creates an implicit call to this function at the 3 | * start of main(). 4 | * 5 | */ 6 | void __libgcc __intel_new_proc_init ( void ) { 7 | /* Do nothing */ 8 | } 9 | -------------------------------------------------------------------------------- /src/libgcc/implicit.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | * 3 | * gcc sometimes likes to insert implicit calls to memcpy() and 4 | * memset(). Unfortunately, there doesn't seem to be any way to 5 | * prevent it from doing this, or to force it to use the optimised 6 | * versions as seen by C code; it insists on inserting symbol 7 | * references to "memcpy" and "memset". We therefore include wrapper 8 | * functions just to keep gcc happy. 9 | * 10 | */ 11 | 12 | #include 13 | 14 | void * gcc_implicit_memcpy ( void *dest, const void *src, 15 | size_t len ) asm ( "memcpy" ); 16 | 17 | void * gcc_implicit_memcpy ( void *dest, const void *src, size_t len ) { 18 | return memcpy ( dest, src, len ); 19 | } 20 | 21 | void * gcc_implicit_memset ( void *dest, int character, 22 | size_t len ) asm ( "memset" ); 23 | 24 | void * gcc_implicit_memset ( void *dest, int character, size_t len ) { 25 | return memset ( dest, character, len ); 26 | } 27 | -------------------------------------------------------------------------------- /src/libgcc/libgcc.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBGCC_H 2 | #define _LIBGCC_H 3 | 4 | #include 5 | #include 6 | 7 | extern __libgcc uint64_t __udivmoddi4 ( uint64_t num, uint64_t den, 8 | uint64_t *rem ); 9 | extern __libgcc uint64_t __udivdi3 (uint64_t num, uint64_t den ); 10 | extern __libgcc uint64_t __umoddi3 ( uint64_t num, uint64_t den ); 11 | extern __libgcc int64_t __divmoddi4 ( int64_t num, int64_t den, int64_t *rem ); 12 | extern __libgcc int64_t __divdi3 ( int64_t num, int64_t den ); 13 | extern __libgcc int64_t __moddi3 ( int64_t num, int64_t den ); 14 | 15 | #endif /* _LIBGCC_H */ 16 | -------------------------------------------------------------------------------- /src/tests/umalloc_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | void umalloc_test ( void ) { 7 | struct memory_map memmap; 8 | userptr_t bob; 9 | userptr_t fred; 10 | 11 | printf ( "Before allocation:\n" ); 12 | get_memmap ( &memmap ); 13 | 14 | bob = umalloc ( 1234 ); 15 | bob = urealloc ( bob, 12345 ); 16 | fred = umalloc ( 999 ); 17 | 18 | printf ( "After allocation:\n" ); 19 | get_memmap ( &memmap ); 20 | 21 | ufree ( bob ); 22 | ufree ( fred ); 23 | 24 | printf ( "After freeing:\n" ); 25 | get_memmap ( &memmap ); 26 | } 27 | -------------------------------------------------------------------------------- /src/util/.gitignore: -------------------------------------------------------------------------------- 1 | nrv2b 2 | zbin 3 | hijack 4 | prototester 5 | elf2efi32 6 | elf2efi64 7 | efirom 8 | efifatbin 9 | einfo 10 | -------------------------------------------------------------------------------- /src/util/Makefile: -------------------------------------------------------------------------------- 1 | BLIB = ../bin/blib.a 2 | CFLAGS = -Os 3 | 4 | all : hijack mucurses_test 5 | 6 | hijack : hijack.c 7 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -Wall -lpcap -o $@ $< 8 | 9 | mucurses_test.o : mucurses_test.c 10 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -Wall -o $@ -c $< 11 | 12 | mucurses_test : mucurses_test.o $(BLIB) 13 | $(CC) -o $@ $< -lc $(BLIB) 14 | 15 | clean : 16 | rm -f hijack mucurses_test *.o 17 | -------------------------------------------------------------------------------- /src/util/catrom.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use warnings; 4 | use strict; 5 | 6 | use FindBin; 7 | use lib "$FindBin::Bin"; 8 | use Option::ROM qw ( :all ); 9 | 10 | my @romfiles = @ARGV 11 | or die "Usage: $0 rom-file-1 rom-file-2 ... > multi-rom-file\n"; 12 | 13 | while ( my $romfile = shift @romfiles ) { 14 | 15 | # Read ROM file 16 | my $rom = new Option::ROM; 17 | $rom->load ( $romfile ); 18 | 19 | # Tag final image as non-final in all except the final ROM 20 | if ( @romfiles ) { 21 | my $image = $rom; 22 | $image = $image->next_image() while $image->next_image(); 23 | $image->pci_header->{last_image} &= ~PCI_LAST_IMAGE; 24 | $image->fix_checksum(); 25 | } 26 | 27 | # Write ROM file to STDOUT 28 | $rom->save ( "-" ); 29 | } 30 | --------------------------------------------------------------------------------