summaryrefslogtreecommitdiffstats
path: root/src/include/bits
diff options
context:
space:
mode:
authorSimon Rettberg2026-01-28 12:53:53 +0100
committerSimon Rettberg2026-01-28 12:53:53 +0100
commit8e82785c584dc13e20f9229decb95bd17bbe9cd1 (patch)
treea8b359e59196be5b2e3862bed189107f4bc9975f /src/include/bits
parentMerge branch 'master' into openslx (diff)
parent[prefix] Make unlzma.S compatible with 386 class CPUs (diff)
downloadipxe-openslx.tar.gz
ipxe-openslx.tar.xz
ipxe-openslx.zip
Merge branch 'master' into openslxopenslx
Diffstat (limited to 'src/include/bits')
-rw-r--r--src/include/bits/acpi.h15
-rw-r--r--src/include/bits/dma.h16
-rw-r--r--src/include/bits/gdbmach.h45
-rw-r--r--src/include/bits/hyperv.h15
-rw-r--r--src/include/bits/iomap.h15
-rw-r--r--src/include/bits/lkrn.h17
-rw-r--r--src/include/bits/memmap.h15
-rw-r--r--src/include/bits/mp.h15
-rw-r--r--src/include/bits/nap.h15
-rw-r--r--src/include/bits/ns16550.h42
-rw-r--r--src/include/bits/pci_io.h15
-rw-r--r--src/include/bits/reboot.h15
-rw-r--r--src/include/bits/sanboot.h15
-rw-r--r--src/include/bits/smbios.h15
-rw-r--r--src/include/bits/tcpip.h32
-rw-r--r--src/include/bits/time.h15
-rw-r--r--src/include/bits/uaccess.h16
-rw-r--r--src/include/bits/umalloc.h16
-rw-r--r--src/include/bits/virt_offset.h16
-rw-r--r--src/include/bits/xen.h16
20 files changed, 381 insertions, 0 deletions
diff --git a/src/include/bits/acpi.h b/src/include/bits/acpi.h
new file mode 100644
index 000000000..d98420502
--- /dev/null
+++ b/src/include/bits/acpi.h
@@ -0,0 +1,15 @@
+#ifndef _BITS_ACPI_H
+#define _BITS_ACPI_H
+
+/** @file
+ *
+ * Dummy architecture-specific ACPI API implementations
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#endif /* _BITS_ACPI_H */
diff --git a/src/include/bits/dma.h b/src/include/bits/dma.h
new file mode 100644
index 000000000..c44b3e456
--- /dev/null
+++ b/src/include/bits/dma.h
@@ -0,0 +1,16 @@
+#ifndef _BITS_DMA_H
+#define _BITS_DMA_H
+
+/** @file
+ *
+ * Dummy architecture-specific DMA API implementations
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+FILE_SECBOOT ( PERMITTED );
+
+#endif /* _BITS_DMA_H */
diff --git a/src/include/bits/gdbmach.h b/src/include/bits/gdbmach.h
new file mode 100644
index 000000000..7e349856f
--- /dev/null
+++ b/src/include/bits/gdbmach.h
@@ -0,0 +1,45 @@
+#ifndef _BITS_GDBMACH_H
+#define _BITS_GDBMACH_H
+
+/** @file
+ *
+ * Dummy GDB architecture specifics
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+#include <stdint.h>
+
+typedef unsigned long gdbreg_t;
+
+/* Register snapshot */
+enum {
+ /* Not yet implemented */
+ GDBMACH_NREGS,
+};
+
+#define GDBMACH_SIZEOF_REGS ( GDBMACH_NREGS * sizeof ( gdbreg_t ) )
+
+static inline void gdbmach_set_pc ( gdbreg_t *regs, gdbreg_t pc ) {
+ /* Not yet implemented */
+ ( void ) regs;
+ ( void ) pc;
+}
+
+static inline void gdbmach_set_single_step ( gdbreg_t *regs, int step ) {
+ /* Not yet implemented */
+ ( void ) regs;
+ ( void ) step;
+}
+
+static inline void gdbmach_breakpoint ( void ) {
+ /* Not yet implemented */
+}
+
+extern int gdbmach_set_breakpoint ( int type, unsigned long addr, size_t len,
+ int enable );
+extern void gdbmach_init ( void );
+
+#endif /* _BITS_GDBMACH_H */
diff --git a/src/include/bits/hyperv.h b/src/include/bits/hyperv.h
new file mode 100644
index 000000000..fd7ceeea3
--- /dev/null
+++ b/src/include/bits/hyperv.h
@@ -0,0 +1,15 @@
+#ifndef _BITS_HYPERV_H
+#define _BITS_HYPERV_H
+
+/** @file
+ *
+ * Dummy architecture-specific Hyper-V interface
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#endif /* _BITS_HYPERV_H */
diff --git a/src/include/bits/iomap.h b/src/include/bits/iomap.h
new file mode 100644
index 000000000..b3d8d0c0d
--- /dev/null
+++ b/src/include/bits/iomap.h
@@ -0,0 +1,15 @@
+#ifndef _BITS_IOMAP_H
+#define _BITS_IOMAP_H
+
+/** @file
+ *
+ * Dummy architecture-specific I/O mapping API implementations
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#endif /* _BITS_IOMAP_H */
diff --git a/src/include/bits/lkrn.h b/src/include/bits/lkrn.h
new file mode 100644
index 000000000..58aee73a2
--- /dev/null
+++ b/src/include/bits/lkrn.h
@@ -0,0 +1,17 @@
+#ifndef _BITS_LKRN_H
+#define _BITS_LKRN_H
+
+/** @file
+ *
+ * Dummy architecture-specific Linux kernel image invocation
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#define LKRN_MAGIC_ARCH 0
+
+#endif /* _BITS_LKRN_H */
diff --git a/src/include/bits/memmap.h b/src/include/bits/memmap.h
new file mode 100644
index 000000000..d51ee4993
--- /dev/null
+++ b/src/include/bits/memmap.h
@@ -0,0 +1,15 @@
+#ifndef _BITS_MEMMAP_H
+#define _BITS_MEMMAP_H
+
+/** @file
+ *
+ * Dummy architecture-specific system memory map
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#endif /* _BITS_MEMMAP_H */
diff --git a/src/include/bits/mp.h b/src/include/bits/mp.h
new file mode 100644
index 000000000..d7d2cdc28
--- /dev/null
+++ b/src/include/bits/mp.h
@@ -0,0 +1,15 @@
+#ifndef _BITS_MP_H
+#define _BITS_MP_H
+
+/** @file
+ *
+ * Dummy architecture-specific multiprocessor API implementations
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#endif /* _BITS_MP_H */
diff --git a/src/include/bits/nap.h b/src/include/bits/nap.h
new file mode 100644
index 000000000..7b01f94e6
--- /dev/null
+++ b/src/include/bits/nap.h
@@ -0,0 +1,15 @@
+#ifndef _BITS_NAP_H
+#define _BITS_NAP_H
+
+/** @file
+ *
+ * Dummy architecture-specific CPU sleeping API implementations
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#endif /* _BITS_NAP_H */
diff --git a/src/include/bits/ns16550.h b/src/include/bits/ns16550.h
new file mode 100644
index 000000000..45e3e978f
--- /dev/null
+++ b/src/include/bits/ns16550.h
@@ -0,0 +1,42 @@
+#ifndef _BITS_NS16550_H
+#define _BITS_NS16550_H
+
+/** @file
+ *
+ * 16550-compatible UART
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#include <stdint.h>
+#include <ipxe/io.h>
+
+/**
+ * Write to UART register
+ *
+ * @v ns16550 16550 UART
+ * @v address Register address
+ * @v data Data
+ */
+static inline __attribute__ (( always_inline )) void
+ns16550_write ( struct ns16550_uart *ns16550, unsigned int address,
+ uint8_t data ) {
+
+ iowrite8 ( data, ( ns16550->base + ( address << ns16550->shift ) ) );
+}
+
+/**
+ * Read from UART register
+ *
+ * @v ns16550 16550 UART
+ * @v address Register address
+ * @ret data Data
+ */
+static inline __attribute__ (( always_inline )) uint8_t
+ns16550_read ( struct ns16550_uart *ns16550, unsigned int address ) {
+
+ return ioread8 ( ns16550->base + ( address << ns16550->shift ) );
+}
+
+#endif /* _BITS_NS16550_H */
diff --git a/src/include/bits/pci_io.h b/src/include/bits/pci_io.h
new file mode 100644
index 000000000..711449f19
--- /dev/null
+++ b/src/include/bits/pci_io.h
@@ -0,0 +1,15 @@
+#ifndef _BITS_PCI_IO_H
+#define _BITS_PCI_IO_H
+
+/** @file
+ *
+ * Dummy architecture-specific PCI I/O API implementations
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#endif /* _BITS_PCI_IO_H */
diff --git a/src/include/bits/reboot.h b/src/include/bits/reboot.h
new file mode 100644
index 000000000..023647fd6
--- /dev/null
+++ b/src/include/bits/reboot.h
@@ -0,0 +1,15 @@
+#ifndef _BITS_REBOOT_H
+#define _BITS_REBOOT_H
+
+/** @file
+ *
+ * Dummy architecture-specific reboot API implementations
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#endif /* _BITS_REBOOT_H */
diff --git a/src/include/bits/sanboot.h b/src/include/bits/sanboot.h
new file mode 100644
index 000000000..addbb5b07
--- /dev/null
+++ b/src/include/bits/sanboot.h
@@ -0,0 +1,15 @@
+#ifndef _BITS_SANBOOT_H
+#define _BITS_SANBOOT_H
+
+/** @file
+ *
+ * Dummy architecture-specific sanboot API implementations
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#endif /* _BITS_SANBOOT_H */
diff --git a/src/include/bits/smbios.h b/src/include/bits/smbios.h
new file mode 100644
index 000000000..3e06aadb4
--- /dev/null
+++ b/src/include/bits/smbios.h
@@ -0,0 +1,15 @@
+#ifndef _BITS_SMBIOS_H
+#define _BITS_SMBIOS_H
+
+/** @file
+ *
+ * Dummy architecture-specific SMBIOS API implementations
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#endif /* _BITS_SMBIOS_H */
diff --git a/src/include/bits/tcpip.h b/src/include/bits/tcpip.h
new file mode 100644
index 000000000..9cb54d432
--- /dev/null
+++ b/src/include/bits/tcpip.h
@@ -0,0 +1,32 @@
+#ifndef _BITS_TCPIP_H
+#define _BITS_TCPIP_H
+
+/** @file
+ *
+ * Generic architecture-specific transport-network layer interface
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#include <stdint.h>
+
+/**
+ * Calculate continued TCP/IP checkum
+ *
+ * @v partial Checksum of already-summed data, in network byte order
+ * @v data Data buffer
+ * @v len Length of data buffer
+ * @ret cksum Updated checksum, in network byte order
+ */
+static inline __attribute__ (( always_inline )) uint16_t
+tcpip_continue_chksum ( uint16_t partial, const void *data, size_t len ) {
+
+ /* Not yet optimised */
+ return generic_tcpip_continue_chksum ( partial, data, len );
+}
+
+#endif /* _BITS_TCPIP_H */
diff --git a/src/include/bits/time.h b/src/include/bits/time.h
new file mode 100644
index 000000000..aec9c2f39
--- /dev/null
+++ b/src/include/bits/time.h
@@ -0,0 +1,15 @@
+#ifndef _BITS_TIME_H
+#define _BITS_TIME_H
+
+/** @file
+ *
+ * Dummy architecture-specific time API implementations
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#endif /* _BITS_TIME_H */
diff --git a/src/include/bits/uaccess.h b/src/include/bits/uaccess.h
new file mode 100644
index 000000000..e3f8b1412
--- /dev/null
+++ b/src/include/bits/uaccess.h
@@ -0,0 +1,16 @@
+#ifndef _BITS_UACCESS_H
+#define _BITS_UACCESS_H
+
+/** @file
+ *
+ * Dummy architecture-specific user access API implementations
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+FILE_SECBOOT ( PERMITTED );
+
+#endif /* _BITS_UACCESS_H */
diff --git a/src/include/bits/umalloc.h b/src/include/bits/umalloc.h
new file mode 100644
index 000000000..689755b00
--- /dev/null
+++ b/src/include/bits/umalloc.h
@@ -0,0 +1,16 @@
+#ifndef _BITS_UMALLOC_H
+#define _BITS_UMALLOC_H
+
+/** @file
+ *
+ * Dummy architecture-specific user memory allocation API implementations
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+FILE_SECBOOT ( PERMITTED );
+
+#endif /* _BITS_UMALLOC_H */
diff --git a/src/include/bits/virt_offset.h b/src/include/bits/virt_offset.h
new file mode 100644
index 000000000..a67b6941e
--- /dev/null
+++ b/src/include/bits/virt_offset.h
@@ -0,0 +1,16 @@
+#ifndef _BITS_VIRT_OFFSET_H
+#define _BITS_VIRT_OFFSET_H
+
+/** @file
+ *
+ * Dummy architecture-specific virtual address offset
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+FILE_SECBOOT ( PERMITTED );
+
+#endif /* _BITS_VIRT_OFFSET_H */
diff --git a/src/include/bits/xen.h b/src/include/bits/xen.h
new file mode 100644
index 000000000..7d0036bc0
--- /dev/null
+++ b/src/include/bits/xen.h
@@ -0,0 +1,16 @@
+#ifndef _BITS_XEN_H
+#define _BITS_XEN_H
+
+/** @file
+ *
+ * Dummy architecture-specific Xen interface
+ *
+ * This file is included only if the architecture does not provide its
+ * own version of this file.
+ *
+ */
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#include <ipxe/nonxen.h>
+
+#endif /* _BITS_XEN_H */