summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/linux
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/ipxe/linux')
-rw-r--r--src/include/ipxe/linux/linux_acpi.h1
-rw-r--r--src/include/ipxe/linux/linux_nap.h1
-rw-r--r--src/include/ipxe/linux/linux_pci.h12
-rw-r--r--src/include/ipxe/linux/linux_smbios.h1
-rw-r--r--src/include/ipxe/linux/linux_time.h1
-rw-r--r--src/include/ipxe/linux/linux_uaccess.h105
-rw-r--r--src/include/ipxe/linux/linux_umalloc.h1
7 files changed, 38 insertions, 84 deletions
diff --git a/src/include/ipxe/linux/linux_acpi.h b/src/include/ipxe/linux/linux_acpi.h
index a2c33ce2c..f6dbc9252 100644
--- a/src/include/ipxe/linux/linux_acpi.h
+++ b/src/include/ipxe/linux/linux_acpi.h
@@ -8,6 +8,7 @@
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+FILE_SECBOOT ( PERMITTED );
#ifdef ACPI_LINUX
#define ACPI_PREFIX_linux
diff --git a/src/include/ipxe/linux/linux_nap.h b/src/include/ipxe/linux/linux_nap.h
index d072886c7..329124e52 100644
--- a/src/include/ipxe/linux/linux_nap.h
+++ b/src/include/ipxe/linux/linux_nap.h
@@ -8,6 +8,7 @@
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+FILE_SECBOOT ( PERMITTED );
#ifdef NAP_LINUX
#define NAP_PREFIX_linux
diff --git a/src/include/ipxe/linux/linux_pci.h b/src/include/ipxe/linux/linux_pci.h
index ec6ff8b1c..b0fddc41a 100644
--- a/src/include/ipxe/linux/linux_pci.h
+++ b/src/include/ipxe/linux/linux_pci.h
@@ -8,6 +8,7 @@
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+FILE_SECBOOT ( PERMITTED );
#ifdef PCIAPI_LINUX
#define PCIAPI_PREFIX_linux
@@ -23,6 +24,17 @@ extern int linux_pci_write ( struct pci_device *pci, unsigned long where,
unsigned long value, size_t len );
/**
+ * Check if PCI bus probing is allowed
+ *
+ * @v pci PCI device
+ * @ret ok Bus probing is allowed
+ */
+static inline __always_inline int
+PCIAPI_INLINE ( linux, pci_can_probe ) ( struct pci_device *pci __unused ) {
+ return 1;
+}
+
+/**
* Find next PCI bus:dev.fn address range in system
*
* @v busdevfn Starting PCI bus:dev.fn address
diff --git a/src/include/ipxe/linux/linux_smbios.h b/src/include/ipxe/linux/linux_smbios.h
index 16c6d8acd..32f006b66 100644
--- a/src/include/ipxe/linux/linux_smbios.h
+++ b/src/include/ipxe/linux/linux_smbios.h
@@ -8,6 +8,7 @@
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+FILE_SECBOOT ( PERMITTED );
#ifdef SMBIOS_LINUX
#define SMBIOS_PREFIX_linux
diff --git a/src/include/ipxe/linux/linux_time.h b/src/include/ipxe/linux/linux_time.h
index 872ef5ade..cf02452d7 100644
--- a/src/include/ipxe/linux/linux_time.h
+++ b/src/include/ipxe/linux/linux_time.h
@@ -8,6 +8,7 @@
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+FILE_SECBOOT ( PERMITTED );
#ifdef TIME_LINUX
#define TIME_PREFIX_linux
diff --git a/src/include/ipxe/linux/linux_uaccess.h b/src/include/ipxe/linux/linux_uaccess.h
index a642b6163..c3119a60e 100644
--- a/src/include/ipxe/linux/linux_uaccess.h
+++ b/src/include/ipxe/linux/linux_uaccess.h
@@ -5,18 +5,15 @@
*
* iPXE user access API for Linux
*
- * We run with no distinction between internal and external addresses,
- * so can use trivial_virt_to_user() et al.
- *
* We have no concept of the underlying physical addresses, since
* these are not exposed to userspace. We provide a stub
- * implementation of user_to_phys() since this is required by
- * alloc_memblock(). We provide no implementation of phys_to_user();
- * any code attempting to access physical addresses will therefore
- * (correctly) fail to link.
+ * implementation of virt_to_phys() since this is required by the heap
+ * allocator to determine physical address alignment. We provide a
+ * matching stub implementation of phys_to_virt().
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+FILE_SECBOOT ( PERMITTED );
#ifdef UACCESS_LINUX
#define UACCESS_PREFIX_linux
@@ -25,97 +22,37 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#endif
/**
- * Convert user pointer to physical address
+ * Convert virtual address to physical address
*
- * @v userptr User pointer
- * @v offset Offset from user pointer
- * @ret phys_addr Physical address
+ * @v virt Virtual address
+ * @ret phys Physical address
*/
-static inline __always_inline unsigned long
-UACCESS_INLINE ( linux, user_to_phys ) ( userptr_t userptr, off_t offset ) {
+static inline __always_inline physaddr_t
+UACCESS_INLINE ( linux, virt_to_phys ) ( volatile const void *virt ) {
/* We do not know the real underlying physical address. We
* provide this stub implementation only because it is
- * required by alloc_memblock() (which allocates memory with
- * specified physical address alignment). We assume that the
- * low-order bits of virtual addresses match the low-order
- * bits of physical addresses, and so simply returning the
- * virtual address will suffice for the purpose of determining
+ * required in order to allocate memory with a specified
+ * physical address alignment. We assume that the low-order
+ * bits of virtual addresses match the low-order bits of
+ * physical addresses, and so simply returning the virtual
+ * address will suffice for the purpose of determining
* alignment.
*/
- return ( userptr + offset );
+ return ( ( physaddr_t ) virt );
}
/**
- * Convert physical address to user pointer
+ * Convert physical address to virtual address
*
- * @v phys_addr Physical address
- * @ret userptr User pointer
+ * @v phys Physical address
+ * @ret virt Virtual address
*/
-static inline __always_inline userptr_t
-UACCESS_INLINE ( linux, phys_to_user ) ( physaddr_t phys_addr ) {
-
- /* For symmetry with the stub user_to_phys() */
- return phys_addr;
-}
-
-static inline __always_inline userptr_t
-UACCESS_INLINE ( linux, virt_to_user ) ( volatile const void *addr ) {
- return trivial_virt_to_user ( addr );
-}
-
static inline __always_inline void *
-UACCESS_INLINE ( linux, user_to_virt ) ( userptr_t userptr, off_t offset ) {
- return trivial_user_to_virt ( userptr, offset );
-}
-
-static inline __always_inline userptr_t
-UACCESS_INLINE ( linux, userptr_add ) ( userptr_t userptr, off_t offset ) {
- return trivial_userptr_add ( userptr, offset );
-}
-
-static inline __always_inline off_t
-UACCESS_INLINE ( linux, userptr_sub ) ( userptr_t userptr,
- userptr_t subtrahend ) {
- return trivial_userptr_sub ( userptr, subtrahend );
-}
-
-static inline __always_inline void
-UACCESS_INLINE ( linux, memcpy_user ) ( userptr_t dest, off_t dest_off,
- userptr_t src, off_t src_off,
- size_t len ) {
- trivial_memcpy_user ( dest, dest_off, src, src_off, len );
-}
-
-static inline __always_inline void
-UACCESS_INLINE ( linux, memmove_user ) ( userptr_t dest, off_t dest_off,
- userptr_t src, off_t src_off,
- size_t len ) {
- trivial_memmove_user ( dest, dest_off, src, src_off, len );
-}
-
-static inline __always_inline int
-UACCESS_INLINE ( linux, memcmp_user ) ( userptr_t first, off_t first_off,
- userptr_t second, off_t second_off,
- size_t len ) {
- return trivial_memcmp_user ( first, first_off, second, second_off, len);
-}
-
-static inline __always_inline void
-UACCESS_INLINE ( linux, memset_user ) ( userptr_t buffer, off_t offset,
- int c, size_t len ) {
- trivial_memset_user ( buffer, offset, c, len );
-}
-
-static inline __always_inline size_t
-UACCESS_INLINE ( linux, strlen_user ) ( userptr_t buffer, off_t offset ) {
- return trivial_strlen_user ( buffer, offset );
-}
+UACCESS_INLINE ( linux, phys_to_virt ) ( physaddr_t phys ) {
-static inline __always_inline off_t
-UACCESS_INLINE ( linux, memchr_user ) ( userptr_t buffer, off_t offset,
- int c, size_t len ) {
- return trivial_memchr_user ( buffer, offset, c, len );
+ /* For symmetry with the stub virt_to_phys() */
+ return ( ( void * ) phys );
}
#endif /* _IPXE_LINUX_UACCESS_H */
diff --git a/src/include/ipxe/linux/linux_umalloc.h b/src/include/ipxe/linux/linux_umalloc.h
index 1811d0bc6..c1669b42a 100644
--- a/src/include/ipxe/linux/linux_umalloc.h
+++ b/src/include/ipxe/linux/linux_umalloc.h
@@ -8,6 +8,7 @@
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+FILE_SECBOOT ( PERMITTED );
#ifdef UMALLOC_LINUX
#define UMALLOC_PREFIX_linux