Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/tools/minios/include/asm-arm/assembler.h b/tools/minios/include/asm-arm/assembler.h
- new file mode 100644
- index 0000000..15f8a09
- --- /dev/null
- +++ b/tools/minios/include/asm-arm/assembler.h
- @@ -0,0 +1,129 @@
- +/*
- + * arch/arm/include/asm/assembler.h
- + *
- + * Copyright (C) 1996-2000 Russell King
- + *
- + * This program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License version 2 as
- + * published by the Free Software Foundation.
- + *
- + * This file contains arm architecture specific defines
- + * for the different processors.
- + *
- + * Do not include any C declarations in this file - it is included by
- + * assembler source.
- + */
- +#ifndef __ASSEMBLY__
- +#error "Only include this from assembly code"
- +#endif
- +
- +#include <asm/ptrace.h>
- +
- +/*
- + * Endian independent macros for shifting bytes within registers.
- + */
- +#ifndef __ARMEB__
- +#define pull lsr
- +#define push lsl
- +#define get_byte_0 lsl #0
- +#define get_byte_1 lsr #8
- +#define get_byte_2 lsr #16
- +#define get_byte_3 lsr #24
- +#define put_byte_0 lsl #0
- +#define put_byte_1 lsl #8
- +#define put_byte_2 lsl #16
- +#define put_byte_3 lsl #24
- +#else
- +#define pull lsl
- +#define push lsr
- +#define get_byte_0 lsr #24
- +#define get_byte_1 lsr #16
- +#define get_byte_2 lsr #8
- +#define get_byte_3 lsl #0
- +#define put_byte_0 lsl #24
- +#define put_byte_1 lsl #16
- +#define put_byte_2 lsl #8
- +#define put_byte_3 lsl #0
- +#endif
- +
- +/*
- + * Data preload for architectures that support it
- + */
- +#if __LINUX_ARM_ARCH__ >= 5
- +#define PLD(code...) code
- +#else
- +#define PLD(code...)
- +#endif
- +
- +/*
- + * This can be used to enable code to cacheline align the destination
- + * pointer when bulk writing to memory. Experiments on StrongARM and
- + * XScale didn't show this a worthwhile thing to do when the cache is not
- + * set to write-allocate (this would need further testing on XScale when WA
- + * is used).
- + *
- + * On Feroceon there is much to gain however, regardless of cache mode.
- + */
- +#ifdef CONFIG_CPU_FEROCEON
- +#define CALGN(code...) code
- +#else
- +#define CALGN(code...)
- +#endif
- +
- +/*
- + * Enable and disable interrupts
- + */
- +#if __LINUX_ARM_ARCH__ >= 6
- + .macro disable_irq
- + cpsid i
- + .endm
- +
- + .macro enable_irq
- + cpsie i
- + .endm
- +#else
- + .macro disable_irq
- + msr cpsr_c, #PSR_I_BIT | SVC_MODE
- + .endm
- +
- + .macro enable_irq
- + msr cpsr_c, #SVC_MODE
- + .endm
- +#endif
- +
- +/*
- + * Save the current IRQ state and disable IRQs. Note that this macro
- + * assumes FIQs are enabled, and that the processor is in SVC mode.
- + */
- + .macro save_and_disable_irqs, oldcpsr
- + mrs \oldcpsr, cpsr
- + disable_irq
- + .endm
- +
- +/*
- + * Restore interrupt state previously stored in a register. We don't
- + * guarantee that this will preserve the flags.
- + */
- + .macro restore_irqs, oldcpsr
- + msr cpsr_c, \oldcpsr
- + .endm
- +
- +#define USER(x...) \
- +9999: x; \
- + .section __ex_table,"a"; \
- + .align 3; \
- + .long 9999b,9001f; \
- + .previous
- +
- +/*
- + * SMP data memory barrier
- + */
- + .macro smp_dmb
- +#ifdef CONFIG_SMP
- +#if __LINUX_ARM_ARCH__ >= 7
- + dmb
- +#elif __LINUX_ARM_ARCH__ == 6
- + mcr p15, 0, r0, c7, c10, 5 @ dmb
- +#endif
- +#endif
- + .endm
- diff --git a/tools/minios/include/asm-arm/hwcap.h b/tools/minios/include/asm-arm/hwcap.h
- new file mode 100644
- index 0000000..f7bd52b
- --- /dev/null
- +++ b/tools/minios/include/asm-arm/hwcap.h
- @@ -0,0 +1,32 @@
- +#ifndef __ASMARM_HWCAP_H
- +#define __ASMARM_HWCAP_H
- +
- +/*
- + * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
- + */
- +#define HWCAP_SWP 1
- +#define HWCAP_HALF 2
- +#define HWCAP_THUMB 4
- +#define HWCAP_26BIT 8 /* Play it safe */
- +#define HWCAP_FAST_MULT 16
- +#define HWCAP_FPA 32
- +#define HWCAP_VFP 64
- +#define HWCAP_EDSP 128
- +#define HWCAP_JAVA 256
- +#define HWCAP_IWMMXT 512
- +#define HWCAP_CRUNCH 1024
- +#define HWCAP_THUMBEE 2048
- +#define HWCAP_NEON 4096
- +#define HWCAP_VFPv3 8192
- +#define HWCAP_VFPv3D16 16384
- +
- +#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
- +/*
- + * This yields a mask that user programs can use to figure out what
- + * instruction set this cpu supports.
- + */
- +#define ELF_HWCAP (elf_hwcap)
- +extern unsigned int elf_hwcap;
- +#endif
- +
- +#endif
- diff --git a/tools/minios/include/asm-arm/linkage.h b/tools/minios/include/asm-arm/linkage.h
- new file mode 100644
- index 0000000..5a25632
- --- /dev/null
- +++ b/tools/minios/include/asm-arm/linkage.h
- @@ -0,0 +1,11 @@
- +#ifndef __ASM_LINKAGE_H
- +#define __ASM_LINKAGE_H
- +
- +#define __ALIGN .align 0
- +#define __ALIGN_STR ".align 0"
- +
- +#define ENDPROC(name) \
- + .type name, %function; \
- + END(name)
- +
- +#endif
- diff --git a/tools/minios/include/asm-arm/ptrace.h b/tools/minios/include/asm-arm/ptrace.h
- new file mode 100644
- index 0000000..67b833c
- --- /dev/null
- +++ b/tools/minios/include/asm-arm/ptrace.h
- @@ -0,0 +1,176 @@
- +/*
- + * arch/arm/include/asm/ptrace.h
- + *
- + * Copyright (C) 1996-2003 Russell King
- + *
- + * This program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License version 2 as
- + * published by the Free Software Foundation.
- + */
- +#ifndef __ASM_ARM_PTRACE_H
- +#define __ASM_ARM_PTRACE_H
- +
- +#include <asm/hwcap.h>
- +
- +#define PTRACE_GETREGS 12
- +#define PTRACE_SETREGS 13
- +#define PTRACE_GETFPREGS 14
- +#define PTRACE_SETFPREGS 15
- +/* PTRACE_ATTACH is 16 */
- +/* PTRACE_DETACH is 17 */
- +#define PTRACE_GETWMMXREGS 18
- +#define PTRACE_SETWMMXREGS 19
- +/* 20 is unused */
- +#define PTRACE_OLDSETOPTIONS 21
- +#define PTRACE_GET_THREAD_AREA 22
- +#define PTRACE_SET_SYSCALL 23
- +/* PTRACE_SYSCALL is 24 */
- +#define PTRACE_GETCRUNCHREGS 25
- +#define PTRACE_SETCRUNCHREGS 26
- +#define PTRACE_GETVFPREGS 27
- +#define PTRACE_SETVFPREGS 28
- +
- +/*
- + * PSR bits
- + */
- +#define USR26_MODE 0x00000000
- +#define FIQ26_MODE 0x00000001
- +#define IRQ26_MODE 0x00000002
- +#define SVC26_MODE 0x00000003
- +#define USR_MODE 0x00000010
- +#define FIQ_MODE 0x00000011
- +#define IRQ_MODE 0x00000012
- +#define SVC_MODE 0x00000013
- +#define ABT_MODE 0x00000017
- +#define UND_MODE 0x0000001b
- +#define SYSTEM_MODE 0x0000001f
- +#define MODE32_BIT 0x00000010
- +#define MODE_MASK 0x0000001f
- +#define PSR_T_BIT 0x00000020
- +#define PSR_F_BIT 0x00000040
- +#define PSR_I_BIT 0x00000080
- +#define PSR_A_BIT 0x00000100
- +#define PSR_E_BIT 0x00000200
- +#define PSR_J_BIT 0x01000000
- +#define PSR_Q_BIT 0x08000000
- +#define PSR_V_BIT 0x10000000
- +#define PSR_C_BIT 0x20000000
- +#define PSR_Z_BIT 0x40000000
- +#define PSR_N_BIT 0x80000000
- +
- +/*
- + * Groups of PSR bits
- + */
- +#define PSR_f 0xff000000 /* Flags */
- +#define PSR_s 0x00ff0000 /* Status */
- +#define PSR_x 0x0000ff00 /* Extension */
- +#define PSR_c 0x000000ff /* Control */
- +
- +/*
- + * ARMv7 groups of APSR bits
- + */
- +#define PSR_ISET_MASK 0x01000010 /* ISA state (J, T) mask */
- +#define PSR_IT_MASK 0x0600fc00 /* If-Then execution state mask */
- +#define PSR_ENDIAN_MASK 0x00000200 /* Endianness state mask */
- +
- +/*
- + * Default endianness state
- + */
- +#ifdef CONFIG_CPU_ENDIAN_BE8
- +#define PSR_ENDSTATE PSR_E_BIT
- +#else
- +#define PSR_ENDSTATE 0
- +#endif
- +
- +#ifndef __ASSEMBLY__
- +
- +/*
- + * This struct defines the way the registers are stored on the
- + * stack during a system call. Note that sizeof(struct pt_regs)
- + * has to be a multiple of 8.
- + */
- +struct pt_regs {
- + long uregs[18];
- +};
- +
- +#define ARM_cpsr uregs[16]
- +#define ARM_pc uregs[15]
- +#define ARM_lr uregs[14]
- +#define ARM_sp uregs[13]
- +#define ARM_ip uregs[12]
- +#define ARM_fp uregs[11]
- +#define ARM_r10 uregs[10]
- +#define ARM_r9 uregs[9]
- +#define ARM_r8 uregs[8]
- +#define ARM_r7 uregs[7]
- +#define ARM_r6 uregs[6]
- +#define ARM_r5 uregs[5]
- +#define ARM_r4 uregs[4]
- +#define ARM_r3 uregs[3]
- +#define ARM_r2 uregs[2]
- +#define ARM_r1 uregs[1]
- +#define ARM_r0 uregs[0]
- +#define ARM_ORIG_r0 uregs[17]
- +
- +#ifdef __KERNEL__
- +
- +#define user_mode(regs) \
- + (((regs)->ARM_cpsr & 0xf) == 0)
- +
- +#ifdef CONFIG_ARM_THUMB
- +#define thumb_mode(regs) \
- + (((regs)->ARM_cpsr & PSR_T_BIT))
- +#else
- +#define thumb_mode(regs) (0)
- +#endif
- +
- +#define isa_mode(regs) \
- + ((((regs)->ARM_cpsr & PSR_J_BIT) >> 23) | \
- + (((regs)->ARM_cpsr & PSR_T_BIT) >> 5))
- +
- +#define processor_mode(regs) \
- + ((regs)->ARM_cpsr & MODE_MASK)
- +
- +#define interrupts_enabled(regs) \
- + (!((regs)->ARM_cpsr & PSR_I_BIT))
- +
- +#define fast_interrupts_enabled(regs) \
- + (!((regs)->ARM_cpsr & PSR_F_BIT))
- +
- +/* Are the current registers suitable for user mode?
- + * (used to maintain security in signal handlers)
- + */
- +static inline int valid_user_regs(struct pt_regs *regs)
- +{
- + if (user_mode(regs) && (regs->ARM_cpsr & PSR_I_BIT) == 0) {
- + regs->ARM_cpsr &= ~(PSR_F_BIT | PSR_A_BIT);
- + return 1;
- + }
- +
- + /*
- + * Force CPSR to something logical...
- + */
- + regs->ARM_cpsr &= PSR_f | PSR_s | (PSR_x & ~PSR_A_BIT) | PSR_T_BIT | MODE32_BIT;
- + if (!(elf_hwcap & HWCAP_26BIT))
- + regs->ARM_cpsr |= USR_MODE;
- +
- + return 0;
- +}
- +
- +#define instruction_pointer(regs) (regs)->ARM_pc
- +
- +#ifdef CONFIG_SMP
- +extern unsigned long profile_pc(struct pt_regs *regs);
- +#else
- +#define profile_pc(regs) instruction_pointer(regs)
- +#endif
- +
- +#define predicate(x) ((x) & 0xf0000000)
- +#define PREDICATE_ALWAYS 0xe0000000
- +
- +#endif /* __KERNEL__ */
- +
- +#endif /* __ASSEMBLY__ */
- +
- +#endif
- +
- diff --git a/tools/minios/include/linux/compiler.h b/tools/minios/include/linux/compiler.h
- new file mode 100644
- index 0000000..04fb513
- --- /dev/null
- +++ b/tools/minios/include/linux/compiler.h
- @@ -0,0 +1,283 @@
- +#ifndef __LINUX_COMPILER_H
- +#define __LINUX_COMPILER_H
- +
- +#ifndef __ASSEMBLY__
- +
- +#ifdef __CHECKER__
- +# define __user __attribute__((noderef, address_space(1)))
- +# define __kernel /* default address space */
- +# define __safe __attribute__((safe))
- +# define __force __attribute__((force))
- +# define __nocast __attribute__((nocast))
- +# define __iomem __attribute__((noderef, address_space(2)))
- +# define __acquires(x) __attribute__((context(x,0,1)))
- +# define __releases(x) __attribute__((context(x,1,0)))
- +# define __acquire(x) __context__(x,1)
- +# define __release(x) __context__(x,-1)
- +# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
- +extern void __chk_user_ptr(const volatile void __user *);
- +extern void __chk_io_ptr(const volatile void __iomem *);
- +#else
- +# define __user
- +# define __kernel
- +# define __safe
- +# define __force
- +# define __nocast
- +# define __iomem
- +# define __chk_user_ptr(x) (void)0
- +# define __chk_io_ptr(x) (void)0
- +# define __builtin_warning(x, y...) (1)
- +# define __acquires(x)
- +# define __releases(x)
- +# define __acquire(x) (void)0
- +# define __release(x) (void)0
- +# define __cond_lock(x,c) (c)
- +#endif
- +
- +#ifdef __KERNEL__
- +
- +#ifdef __GNUC__
- +#include <linux/compiler-gcc.h>
- +#endif
- +
- +#define notrace __attribute__((no_instrument_function))
- +
- +/* Intel compiler defines __GNUC__. So we will overwrite implementations
- + * coming from above header files here
- + */
- +#ifdef __INTEL_COMPILER
- +# include <linux/compiler-intel.h>
- +#endif
- +
- +/*
- + * Generic compiler-dependent macros required for kernel
- + * build go below this comment. Actual compiler/compiler version
- + * specific implementations come from the above header files
- + */
- +
- +struct ftrace_branch_data {
- + const char *func;
- + const char *file;
- + unsigned line;
- + union {
- + struct {
- + unsigned long correct;
- + unsigned long incorrect;
- + };
- + struct {
- + unsigned long miss;
- + unsigned long hit;
- + };
- + unsigned long miss_hit[2];
- + };
- +};
- +
- +/*
- + * Note: DISABLE_BRANCH_PROFILING can be used by special lowlevel code
- + * to disable branch tracing on a per file basis.
- + */
- +#if defined(CONFIG_TRACE_BRANCH_PROFILING) \
- + && !defined(DISABLE_BRANCH_PROFILING) && !defined(__CHECKER__)
- +void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
- +
- +#define likely_notrace(x) __builtin_expect(!!(x), 1)
- +#define unlikely_notrace(x) __builtin_expect(!!(x), 0)
- +
- +#define __branch_check__(x, expect) ({ \
- + int ______r; \
- + static struct ftrace_branch_data \
- + __attribute__((__aligned__(4))) \
- + __attribute__((section("_ftrace_annotated_branch"))) \
- + ______f = { \
- + .func = __func__, \
- + .file = __FILE__, \
- + .line = __LINE__, \
- + }; \
- + ______r = likely_notrace(x); \
- + ftrace_likely_update(&______f, ______r, expect); \
- + ______r; \
- + })
- +
- +/*
- + * Using __builtin_constant_p(x) to ignore cases where the return
- + * value is always the same. This idea is taken from a similar patch
- + * written by Daniel Walker.
- + */
- +# ifndef likely
- +# define likely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 1))
- +# endif
- +# ifndef unlikely
- +# define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0))
- +# endif
- +
- +#ifdef CONFIG_PROFILE_ALL_BRANCHES
- +/*
- + * "Define 'is'", Bill Clinton
- + * "Define 'if'", Steven Rostedt
- + */
- +#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
- +#define __trace_if(cond) \
- + if (__builtin_constant_p((cond)) ? !!(cond) : \
- + ({ \
- + int ______r; \
- + static struct ftrace_branch_data \
- + __attribute__((__aligned__(4))) \
- + __attribute__((section("_ftrace_branch"))) \
- + ______f = { \
- + .func = __func__, \
- + .file = __FILE__, \
- + .line = __LINE__, \
- + }; \
- + ______r = !!(cond); \
- + ______f.miss_hit[______r]++; \
- + ______r; \
- + }))
- +#endif /* CONFIG_PROFILE_ALL_BRANCHES */
- +
- +#else
- +# define likely(x) __builtin_expect(!!(x), 1)
- +# define unlikely(x) __builtin_expect(!!(x), 0)
- +#endif
- +
- +/* Optimization barrier */
- +#ifndef barrier
- +# define barrier() __memory_barrier()
- +#endif
- +
- +#ifndef RELOC_HIDE
- +# define RELOC_HIDE(ptr, off) \
- + ({ unsigned long __ptr; \
- + __ptr = (unsigned long) (ptr); \
- + (typeof(ptr)) (__ptr + (off)); })
- +#endif
- +
- +#endif /* __KERNEL__ */
- +
- +#endif /* __ASSEMBLY__ */
- +
- +#ifdef __KERNEL__
- +/*
- + * Allow us to mark functions as 'deprecated' and have gcc emit a nice
- + * warning for each use, in hopes of speeding the functions removal.
- + * Usage is:
- + * int __deprecated foo(void)
- + */
- +#ifndef __deprecated
- +# define __deprecated /* unimplemented */
- +#endif
- +
- +#ifdef MODULE
- +#define __deprecated_for_modules __deprecated
- +#else
- +#define __deprecated_for_modules
- +#endif
- +
- +#ifndef __must_check
- +#define __must_check
- +#endif
- +
- +#ifndef CONFIG_ENABLE_MUST_CHECK
- +#undef __must_check
- +#define __must_check
- +#endif
- +#ifndef CONFIG_ENABLE_WARN_DEPRECATED
- +#undef __deprecated
- +#undef __deprecated_for_modules
- +#define __deprecated
- +#define __deprecated_for_modules
- +#endif
- +
- +/*
- + * Allow us to avoid 'defined but not used' warnings on functions and data,
- + * as well as force them to be emitted to the assembly file.
- + *
- + * As of gcc 3.4, static functions that are not marked with attribute((used))
- + * may be elided from the assembly file. As of gcc 3.4, static data not so
- + * marked will not be elided, but this may change in a future gcc version.
- + *
- + * NOTE: Because distributions shipped with a backported unit-at-a-time
- + * compiler in gcc 3.3, we must define __used to be __attribute__((used))
- + * for gcc >=3.3 instead of 3.4.
- + *
- + * In prior versions of gcc, such functions and data would be emitted, but
- + * would be warned about except with attribute((unused)).
- + *
- + * Mark functions that are referenced only in inline assembly as __used so
- + * the code is emitted even though it appears to be unreferenced.
- + */
- +#ifndef __used
- +# define __used /* unimplemented */
- +#endif
- +
- +#ifndef __maybe_unused
- +# define __maybe_unused /* unimplemented */
- +#endif
- +
- +#ifndef noinline
- +#define noinline
- +#endif
- +
- +/*
- + * Rather then using noinline to prevent stack consumption, use
- + * noinline_for_stack instead. For documentaiton reasons.
- + */
- +#define noinline_for_stack noinline
- +
- +#ifndef __always_inline
- +#define __always_inline inline
- +#endif
- +
- +#endif /* __KERNEL__ */
- +
- +/*
- + * From the GCC manual:
- + *
- + * Many functions do not examine any values except their arguments,
- + * and have no effects except the return value. Basically this is
- + * just slightly more strict class than the `pure' attribute above,
- + * since function is not allowed to read global memory.
- + *
- + * Note that a function that has pointer arguments and examines the
- + * data pointed to must _not_ be declared `const'. Likewise, a
- + * function that calls a non-`const' function usually must not be
- + * `const'. It does not make sense for a `const' function to return
- + * `void'.
- + */
- +#ifndef __attribute_const__
- +# define __attribute_const__ /* unimplemented */
- +#endif
- +
- +/*
- + * Tell gcc if a function is cold. The compiler will assume any path
- + * directly leading to the call is unlikely.
- + */
- +
- +#ifndef __cold
- +#define __cold
- +#endif
- +
- +/* Simple shorthand for a section definition */
- +#ifndef __section
- +# define __section(S) __attribute__ ((__section__(#S)))
- +#endif
- +
- +/* Are two types/vars the same type (ignoring qualifiers)? */
- +#ifndef __same_type
- +# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
- +#endif
- +
- +/*
- + * Prevent the compiler from merging or refetching accesses. The compiler
- + * is also forbidden from reordering successive instances of ACCESS_ONCE(),
- + * but only when the compiler is aware of some particular ordering. One way
- + * to make the compiler aware of ordering is to put the two invocations of
- + * ACCESS_ONCE() in different C statements.
- + *
- + * This macro does absolutely -nothing- to prevent the CPU from reordering,
- + * merging, or refetching absolutely anything at any time. Its main intended
- + * use is to mediate communication between process-level code and irq/NMI
- + * handlers, all running on the same CPU.
- + */
- +#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
- +
- +#endif /* __LINUX_COMPILER_H */
- diff --git a/tools/minios/include/linux/linkage.h b/tools/minios/include/linux/linkage.h
- new file mode 100644
- index 0000000..691f591
- --- /dev/null
- +++ b/tools/minios/include/linux/linkage.h
- @@ -0,0 +1,97 @@
- +#ifndef _LINUX_LINKAGE_H
- +#define _LINUX_LINKAGE_H
- +
- +#include <linux/compiler.h>
- +#include <asm/linkage.h>
- +
- +#ifdef __cplusplus
- +#define CPP_ASMLINKAGE extern "C"
- +#else
- +#define CPP_ASMLINKAGE
- +#endif
- +
- +#ifndef asmlinkage
- +#define asmlinkage CPP_ASMLINKAGE
- +#endif
- +
- +#ifndef asmregparm
- +# define asmregparm
- +#endif
- +
- +#define __page_aligned_data __section(.data.page_aligned) __aligned(PAGE_SIZE)
- +#define __page_aligned_bss __section(.bss.page_aligned) __aligned(PAGE_SIZE)
- +
- +/*
- + * For assembly routines.
- + *
- + * Note when using these that you must specify the appropriate
- + * alignment directives yourself
- + */
- +#define __PAGE_ALIGNED_DATA .section ".data.page_aligned", "aw"
- +#define __PAGE_ALIGNED_BSS .section ".bss.page_aligned", "aw"
- +
- +/*
- + * This is used by architectures to keep arguments on the stack
- + * untouched by the compiler by keeping them live until the end.
- + * The argument stack may be owned by the assembly-language
- + * caller, not the callee, and gcc doesn't always understand
- + * that.
- + *
- + * We have the return value, and a maximum of six arguments.
- + *
- + * This should always be followed by a "return ret" for the
- + * protection to work (ie no more work that the compiler might
- + * end up needing stack temporaries for).
- + */
- +/* Assembly files may be compiled with -traditional .. */
- +#ifndef __ASSEMBLY__
- +#ifndef asmlinkage_protect
- +# define asmlinkage_protect(n, ret, args...) do { } while (0)
- +#endif
- +#endif
- +
- +#ifndef __ALIGN
- +#define __ALIGN .align 4,0x90
- +#define __ALIGN_STR ".align 4,0x90"
- +#endif
- +
- +#ifdef __ASSEMBLY__
- +
- +#define ALIGN __ALIGN
- +#define ALIGN_STR __ALIGN_STR
- +
- +#ifndef ENTRY
- +#define ENTRY(name) \
- + .globl name; \
- + ALIGN; \
- + name:
- +#endif
- +
- +#ifndef WEAK
- +#define WEAK(name) \
- + .weak name; \
- + name:
- +#endif
- +
- +#ifndef END
- +#define END(name) \
- + .size name, .-name
- +#endif
- +
- +/* If symbol 'name' is treated as a subroutine (gets called, and returns)
- + * then please use ENDPROC to mark 'name' as STT_FUNC for the benefit of
- + * static analysis tools such as stack depth analyzer.
- + */
- +#ifndef ENDPROC
- +#define ENDPROC(name) \
- + .type name, @function; \
- + END(name)
- +#endif
- +
- +#endif
- +
- +#define NORET_TYPE /**/
- +#define ATTRIB_NORET __attribute__((noreturn))
- +#define NORET_AND noreturn,
- +
- +#endif
Advertisement
Add Comment
Please, Sign In to add comment