summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/io.h
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/ipxe/io.h
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/ipxe/io.h')
-rw-r--r--src/include/ipxe/io.h87
1 files changed, 61 insertions, 26 deletions
diff --git a/src/include/ipxe/io.h b/src/include/ipxe/io.h
index fe1388191..1bb49370c 100644
--- a/src/include/ipxe/io.h
+++ b/src/include/ipxe/io.h
@@ -17,6 +17,7 @@
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+FILE_SECBOOT ( PERMITTED );
#include <stdint.h>
#include <ipxe/api.h>
@@ -330,6 +331,66 @@ void outl ( uint32_t data, volatile uint32_t *io_addr );
IOAPI_WRITE ( outl, uint32_t, data, io_addr, "IO", 8 )
/**
+ * Read byte from I/O-mapped or memory-mapped device
+ *
+ * @v io_addr I/O address
+ * @ret data Value read
+ */
+uint8_t ioread8 ( volatile uint8_t *io_addr );
+#define ioread8( io_addr ) \
+ IOAPI_READ ( ioread8, uint8_t, io_addr, "IO/MEM", 2 )
+
+/**
+ * Read 16-bit word from I/O-mapped or memory-mapped device
+ *
+ * @v io_addr I/O address
+ * @ret data Value read
+ */
+uint16_t ioread16 ( volatile uint16_t *io_addr );
+#define ioread16( io_addr ) \
+ IOAPI_READ ( ioread16, uint16_t, io_addr, "IO/MEM", 4 )
+
+/**
+ * Read 32-bit dword from I/O-mapped or memory-mapped device
+ *
+ * @v io_addr I/O address
+ * @ret data Value read
+ */
+uint32_t ioread32 ( volatile uint32_t *io_addr );
+#define ioread32( io_addr ) \
+ IOAPI_READ ( ioread32, uint32_t, io_addr, "IO/MEM", 8 )
+
+/**
+ * Write byte to I/O-mapped or memory-mapped device
+ *
+ * @v data Value to write
+ * @v io_addr I/O address
+ */
+void iowrite8 ( uint8_t data, volatile uint8_t *io_addr );
+#define iowrite8( data, io_addr ) \
+ IOAPI_WRITE ( iowrite8, uint8_t, data, io_addr, "IO/MEM", 2 )
+
+/**
+ * Write 16-bit word to I/O-mapped or memory-mapped device
+ *
+ * @v data Value to write
+ * @v io_addr I/O address
+ */
+void iowrite16 ( uint16_t data, volatile uint16_t *io_addr );
+#define iowrite16( data, io_addr ) \
+ IOAPI_WRITE ( iowrite16, uint16_t, data, io_addr, "IO/MEM", 4 )
+
+/**
+ * Write 32-bit dword to I/O-mapped or memory-mapped device
+ *
+ * @v data Value to write
+ * @v io_addr I/O address
+ */
+void iowrite32 ( uint32_t data, volatile uint32_t *io_addr );
+#define iowrite32( data, io_addr ) \
+ IOAPI_WRITE ( iowrite32, uint32_t, data, io_addr, "IO/MEM", 8 )
+
+/**
* Read bytes from I/O-mapped device
*
* @v io_addr I/O address
@@ -484,30 +545,4 @@ void mb ( void );
#define rmb() mb()
#define wmb() mb()
-/** A usable memory region */
-struct memory_region {
- /** Physical start address */
- uint64_t start;
- /** Physical end address */
- uint64_t end;
-};
-
-/** Maximum number of memory regions we expect to encounter */
-#define MAX_MEMORY_REGIONS 8
-
-/** A memory map */
-struct memory_map {
- /** Memory regions */
- struct memory_region regions[MAX_MEMORY_REGIONS];
- /** Number of used regions */
- unsigned int count;
-};
-
-/**
- * Get memory map
- *
- * @v memmap Memory map to fill in
- */
-void get_memmap ( struct memory_map *memmap );
-
#endif /* _IPXE_IO_H */