diff options
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/barebox.lds.h | 11 | ||||
-rw-r--r-- | arch/x86/include/asm/bitsperlong.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/debug_ll.h | 6 | ||||
-rw-r--r-- | arch/x86/include/asm/dma.h | 40 | ||||
-rw-r--r-- | arch/x86/include/asm/elf.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/io.h | 6 | ||||
-rw-r--r-- | arch/x86/include/asm/linkage.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/mmu.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/pci.h | 7 | ||||
-rw-r--r-- | arch/x86/include/asm/posix_types.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/sections.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/setjmp.h | 44 | ||||
-rw-r--r-- | arch/x86/include/asm/swab.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/syslib.h | 13 | ||||
-rw-r--r-- | arch/x86/include/asm/types.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/unaligned.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/word-at-a-time.h | 73 |
17 files changed, 202 insertions, 16 deletions
diff --git a/arch/x86/include/asm/barebox.lds.h b/arch/x86/include/asm/barebox.lds.h new file mode 100644 index 0000000000..f00d36c4e7 --- /dev/null +++ b/arch/x86/include/asm/barebox.lds.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifdef CONFIG_X86_32 +#define BAREBOX_OUTPUT_FORMAT "elf32-i386", "elf32-i386", "elf32-i386" +#define BAREBOX_OUTPUT_ARCH "i386" +#else +#define BAREBOX_OUTPUT_FORMAT "elf64-x86-64", "elf64-x86-64", "elf64-x86-64" +#define BAREBOX_OUTPUT_ARCH "i386:x86-64" +#endif + +#include <asm-generic/barebox.lds.h> diff --git a/arch/x86/include/asm/bitsperlong.h b/arch/x86/include/asm/bitsperlong.h index 6dc0bb0c13..bf000a04cc 100644 --- a/arch/x86/include/asm/bitsperlong.h +++ b/arch/x86/include/asm/bitsperlong.h @@ -1 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #include <asm-generic/bitsperlong.h> diff --git a/arch/x86/include/asm/debug_ll.h b/arch/x86/include/asm/debug_ll.h new file mode 100644 index 0000000000..e75090b4ba --- /dev/null +++ b/arch/x86/include/asm/debug_ll.h @@ -0,0 +1,6 @@ +#ifndef __ASM_X86_DEBUG_LL_H +#define __ASM_X86_DEBUG_LL_H + +#include <mach/debug_ll.h> + +#endif /* __ASM_X86_DEBUG_LL_H */ diff --git a/arch/x86/include/asm/dma.h b/arch/x86/include/asm/dma.h index 3dab2b688d..fe486c687f 100644 --- a/arch/x86/include/asm/dma.h +++ b/arch/x86/include/asm/dma.h @@ -4,6 +4,44 @@ #ifndef __ASM_DMA_H #define __ASM_DMA_H -/* empty */ +#include <linux/string.h> +#include <linux/compiler.h> +#include <xfuncs.h> +#include <malloc.h> + +/* + * x86 is cache coherent, so we need not do anything special here + */ + +#define dma_alloc_coherent dma_alloc_coherent +static inline void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle) +{ + void *ret = xmemalign(4096, size); + if (dma_handle) + *dma_handle = (dma_addr_t)ret; + + memset(ret, 0, size); + + return ret; +} + +#define dma_free_coherent dma_free_coherent +static inline void dma_free_coherent(void *mem, dma_addr_t dma_handle, + size_t size) +{ + free(mem); +} + +#define arch_sync_dma_for_cpu arch_sync_dma_for_cpu +static inline void arch_sync_dma_for_cpu(void *vaddr, size_t size, + enum dma_data_direction dir) +{ +} + +#define arch_sync_dma_for_device arch_sync_dma_for_device +static inline void arch_sync_dma_for_device(void *vaddr, size_t size, + enum dma_data_direction dir) +{ +} #endif /* __ASM_DMA_H */ diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h index ddde035188..365e6cd02b 100644 --- a/arch/x86/include/asm/elf.h +++ b/arch/x86/include/asm/elf.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef __ASM_SANDBOX_ELF_H__ #define __ASM_SANDBOX_ELF_H__ diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index 5d19679b50..d4b5c26919 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + /* * Mostly stolen from the linux kernel */ @@ -63,13 +65,13 @@ BUILDIO(l, , int) #define outb outb #define outw outw -#define outl outb +#define outl outl #define inb inb #define inw inw #define inl inl #define outsb outsb #define outsw outsw -#define outsl outsb +#define outsl outsl #define insb insb #define insw insw #define insl insl diff --git a/arch/x86/include/asm/linkage.h b/arch/x86/include/asm/linkage.h index a8d1bdb7de..1d78d9169b 100644 --- a/arch/x86/include/asm/linkage.h +++ b/arch/x86/include/asm/linkage.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef __ASM_LINKAGE_H #define __ASM_LINKAGE_H diff --git a/arch/x86/include/asm/mmu.h b/arch/x86/include/asm/mmu.h index 95af871420..1c2646ebb3 100644 --- a/arch/x86/include/asm/mmu.h +++ b/arch/x86/include/asm/mmu.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef __ASM_MMU_H #define __ASM_MMU_H diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h new file mode 100644 index 0000000000..ca1c0f912d --- /dev/null +++ b/arch/x86/include/asm/pci.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_PCI_H +#define __ASM_PCI_H + +#define pcibios_assign_all_busses() 0 + +#endif diff --git a/arch/x86/include/asm/posix_types.h b/arch/x86/include/asm/posix_types.h index 22cae6230c..feaed42471 100644 --- a/arch/x86/include/asm/posix_types.h +++ b/arch/x86/include/asm/posix_types.h @@ -1 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #include <asm-generic/posix_types.h> diff --git a/arch/x86/include/asm/sections.h b/arch/x86/include/asm/sections.h index 2b8c516038..c6dd0eead2 100644 --- a/arch/x86/include/asm/sections.h +++ b/arch/x86/include/asm/sections.h @@ -1 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #include <asm-generic/sections.h> diff --git a/arch/x86/include/asm/setjmp.h b/arch/x86/include/asm/setjmp.h new file mode 100644 index 0000000000..5af5e62489 --- /dev/null +++ b/arch/x86/include/asm/setjmp.h @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Written by H. Peter Anvin <hpa@zytor.com> + * Brought in from Linux v4.4 and modified for U-Boot + * From Linux arch/um/sys-i386/setjmp.S + */ + +#ifndef __setjmp_h +#define __setjmp_h + +#include <linux/compiler.h> + +struct jmp_buf_data { +#if defined CONFIG_X86_64 +#define __sjlj_attr + unsigned long __rip; + unsigned long __rsp; + unsigned long __rbp; + unsigned long __rbx; + unsigned long __r12; + unsigned long __r13; + unsigned long __r14; + unsigned long __r15; +#elif defined CONFIG_X86_32 +#define __sjlj_attr __attribute__((regparm(3))) + unsigned int __ebx; + unsigned int __esp; + unsigned int __ebp; + unsigned int __esi; + unsigned int __edi; + unsigned int __eip; +#else +#error "Unsupported configuration" +#endif +}; + +typedef struct jmp_buf_data jmp_buf[1]; + +int setjmp(jmp_buf jmp) __attribute__((returns_twice)) __sjlj_attr; +void longjmp(jmp_buf jmp, int ret) __attribute__((noreturn)) __sjlj_attr; + +int initjmp(jmp_buf jmp, void __attribute__((noreturn)) (*func)(void), void *stack_top) __sjlj_attr; + +#endif diff --git a/arch/x86/include/asm/swab.h b/arch/x86/include/asm/swab.h index 557cd9f006..e2319d9776 100644 --- a/arch/x86/include/asm/swab.h +++ b/arch/x86/include/asm/swab.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef _ASM_X86_SWAB_H #define _ASM_X86_SWAB_H diff --git a/arch/x86/include/asm/syslib.h b/arch/x86/include/asm/syslib.h deleted file mode 100644 index 7e08cfd44e..0000000000 --- a/arch/x86/include/asm/syslib.h +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* SPDX-FileCopyrightText: 2009 Juergen Beisert, Pengutronix */ - -#ifdef CONFIG_X86_BIOS_BRINGUP - -extern int bios_disk_rw_int13_extensions(int, int, void*) __attribute__((regparm(3))); -extern uint16_t bios_get_memsize(void); - -#endif - -#ifdef CONFIG_CMD_LINUX16 -extern void bios_start_linux(unsigned) __attribute__((regparm(1))); -#endif diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h index 17947b2ff3..52a6e51fd4 100644 --- a/arch/x86/include/asm/types.h +++ b/arch/x86/include/asm/types.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef __ASM_I386_TYPES_H #define __ASM_I386_TYPES_H diff --git a/arch/x86/include/asm/unaligned.h b/arch/x86/include/asm/unaligned.h index 7e38706c5d..a62dc88922 100644 --- a/arch/x86/include/asm/unaligned.h +++ b/arch/x86/include/asm/unaligned.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef _ASM_X86_UNALIGNED_H #define _ASM_X86_UNALIGNED_H diff --git a/arch/x86/include/asm/word-at-a-time.h b/arch/x86/include/asm/word-at-a-time.h new file mode 100644 index 0000000000..a7e57b7fd6 --- /dev/null +++ b/arch/x86/include/asm/word-at-a-time.h @@ -0,0 +1,73 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_WORD_AT_A_TIME_H +#define _ASM_WORD_AT_A_TIME_H + +#include <linux/kernel.h> + +/* + * This is largely generic for little-endian machines, but the + * optimal byte mask counting is probably going to be something + * that is architecture-specific. If you have a reliably fast + * bit count instruction, that might be better than the multiply + * and shift, for example. + */ +struct word_at_a_time { + const unsigned long one_bits, high_bits; +}; + +#define WORD_AT_A_TIME_CONSTANTS { REPEAT_BYTE(0x01), REPEAT_BYTE(0x80) } + +#ifdef CONFIG_64BIT + +/* + * Jan Achrenius on G+: microoptimized version of + * the simpler "(mask & ONEBYTES) * ONEBYTES >> 56" + * that works for the bytemasks without having to + * mask them first. + */ +static inline long count_masked_bytes(unsigned long mask) +{ + return mask*0x0001020304050608ul >> 56; +} + +#else /* 32-bit case */ + +/* Carl Chatfield / Jan Achrenius G+ version for 32-bit */ +static inline long count_masked_bytes(long mask) +{ + /* (000000 0000ff 00ffff ffffff) -> ( 1 1 2 3 ) */ + long a = (0x0ff0001+mask) >> 23; + /* Fix the 1 for 00 case */ + return a & mask; +} + +#endif + +/* Return nonzero if it has a zero */ +static inline unsigned long has_zero(unsigned long a, unsigned long *bits, const struct word_at_a_time *c) +{ + unsigned long mask = ((a - c->one_bits) & ~a) & c->high_bits; + *bits = mask; + return mask; +} + +static inline unsigned long prep_zero_mask(unsigned long a, unsigned long bits, const struct word_at_a_time *c) +{ + return bits; +} + +static inline unsigned long create_zero_mask(unsigned long bits) +{ + bits = (bits - 1) & ~bits; + return bits >> 7; +} + +/* The mask we created is directly usable as a bytemask */ +#define zero_bytemask(mask) (mask) + +static inline unsigned long find_zero(unsigned long mask) +{ + return count_masked_bytes(mask); +} + +#endif /* _ASM_WORD_AT_A_TIME_H */ |