mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
Merge ssh://master.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-x86
* ssh://master.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-x86: (114 commits) x86: delete vsyscall files during make clean kbuild: fix typo SRCARCH in find_sources x86: fix kernel rebuild due to vsyscall fallout .gitignore update for x86 arch x86: unify include/asm/debugreg_32/64.h x86: unify include/asm/unwind_32/64.h x86: unify include/asm/types_32/64.h x86: unify include/asm/tlb_32/64.h x86: unify include/asm/siginfo_32/64.h x86: unify include/asm/bug_32/64.h x86: unify include/asm/mman_32/64.h x86: unify include/asm/agp_32/64.h x86: unify include/asm/kdebug_32/64.h x86: unify include/asm/ioctls_32/64.h x86: unify include/asm/floppy_32/64.h x86: apply missing DMA/OOM prevention to floppy_32.h x86: unify include/asm/cache_32/64.h x86: unify include/asm/cache_32/64.h x86: unify include/asm/dmi_32/64.h x86: unify include/asm/delay_32/64.h ...
This commit is contained in:
commit
d20ead9e86
252 changed files with 2688 additions and 4294 deletions
|
|
@ -1,40 +1,22 @@
|
|||
include include/asm-generic/Kbuild.asm
|
||||
|
||||
header-y += boot.h
|
||||
header-y += debugreg_32.h
|
||||
header-y += debugreg_64.h
|
||||
header-y += debugreg.h
|
||||
header-y += ldt_32.h
|
||||
header-y += ldt_64.h
|
||||
header-y += ldt.h
|
||||
header-y += msr-index.h
|
||||
header-y += prctl.h
|
||||
header-y += ptrace-abi_32.h
|
||||
header-y += ptrace-abi_64.h
|
||||
header-y += ptrace-abi.h
|
||||
header-y += sigcontext32.h
|
||||
header-y += ucontext_32.h
|
||||
header-y += ucontext_64.h
|
||||
header-y += ucontext.h
|
||||
header-y += vsyscall32.h
|
||||
|
||||
unifdef-y += a.out_32.h
|
||||
unifdef-y += a.out_64.h
|
||||
unifdef-y += auxvec_32.h
|
||||
unifdef-y += auxvec_64.h
|
||||
unifdef-y += byteorder_32.h
|
||||
unifdef-y += byteorder_64.h
|
||||
unifdef-y += elf_32.h
|
||||
unifdef-y += elf_64.h
|
||||
unifdef-y += errno_32.h
|
||||
unifdef-y += errno_64.h
|
||||
unifdef-y += ioctls_32.h
|
||||
unifdef-y += ioctls_64.h
|
||||
unifdef-y += ipcbuf_32.h
|
||||
unifdef-y += ipcbuf_64.h
|
||||
unifdef-y += mce.h
|
||||
unifdef-y += mman_32.h
|
||||
unifdef-y += mman_64.h
|
||||
unifdef-y += msgbuf_32.h
|
||||
unifdef-y += msgbuf_64.h
|
||||
unifdef-y += msr_32.h
|
||||
|
|
@ -45,40 +27,22 @@ unifdef-y += mtrr_64.h
|
|||
unifdef-y += mtrr.h
|
||||
unifdef-y += page_32.h
|
||||
unifdef-y += page_64.h
|
||||
unifdef-y += param_32.h
|
||||
unifdef-y += param_64.h
|
||||
unifdef-y += posix_types_32.h
|
||||
unifdef-y += posix_types_64.h
|
||||
unifdef-y += ptrace_32.h
|
||||
unifdef-y += ptrace_64.h
|
||||
unifdef-y += resource_32.h
|
||||
unifdef-y += resource_64.h
|
||||
unifdef-y += sembuf_32.h
|
||||
unifdef-y += sembuf_64.h
|
||||
unifdef-y += setup_32.h
|
||||
unifdef-y += setup_64.h
|
||||
unifdef-y += shmbuf_32.h
|
||||
unifdef-y += shmbuf_64.h
|
||||
unifdef-y += shmparam_32.h
|
||||
unifdef-y += shmparam_64.h
|
||||
unifdef-y += sigcontext_32.h
|
||||
unifdef-y += sigcontext_64.h
|
||||
unifdef-y += siginfo_32.h
|
||||
unifdef-y += siginfo_64.h
|
||||
unifdef-y += signal_32.h
|
||||
unifdef-y += signal_64.h
|
||||
unifdef-y += sockios_32.h
|
||||
unifdef-y += sockios_64.h
|
||||
unifdef-y += stat_32.h
|
||||
unifdef-y += stat_64.h
|
||||
unifdef-y += statfs_32.h
|
||||
unifdef-y += statfs_64.h
|
||||
unifdef-y += termbits_32.h
|
||||
unifdef-y += termbits_64.h
|
||||
unifdef-y += termios_32.h
|
||||
unifdef-y += termios_64.h
|
||||
unifdef-y += types_32.h
|
||||
unifdef-y += types_64.h
|
||||
unifdef-y += unistd_32.h
|
||||
unifdef-y += unistd_64.h
|
||||
unifdef-y += user_32.h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,40 @@
|
|||
#ifdef CONFIG_X86_32
|
||||
# include "agp_32.h"
|
||||
#else
|
||||
# include "agp_64.h"
|
||||
#ifndef _ASM_X86_AGP_H
|
||||
#define _ASM_X86_AGP_H
|
||||
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/cacheflush.h>
|
||||
|
||||
/*
|
||||
* Functions to keep the agpgart mappings coherent with the MMU. The
|
||||
* GART gives the CPU a physical alias of pages in memory. The alias
|
||||
* region is mapped uncacheable. Make sure there are no conflicting
|
||||
* mappings with different cachability attributes for the same
|
||||
* page. This avoids data corruption on some CPUs.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Caller's responsibility to call global_flush_tlb() for performance
|
||||
* reasons
|
||||
*/
|
||||
#define map_page_into_agp(page) change_page_attr(page, 1, PAGE_KERNEL_NOCACHE)
|
||||
#define unmap_page_from_agp(page) change_page_attr(page, 1, PAGE_KERNEL)
|
||||
#define flush_agp_mappings() global_flush_tlb()
|
||||
|
||||
/*
|
||||
* Could use CLFLUSH here if the cpu supports it. But then it would
|
||||
* need to be called for each cacheline of the whole page so it may
|
||||
* not be worth it. Would need a page for it.
|
||||
*/
|
||||
#define flush_agp_cache() wbinvd()
|
||||
|
||||
/* Convert a physical address to an address suitable for the GART. */
|
||||
#define phys_to_gart(x) (x)
|
||||
#define gart_to_phys(x) (x)
|
||||
|
||||
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
|
||||
#define alloc_gatt_pages(order) \
|
||||
((char *)__get_free_pages(GFP_KERNEL, (order)))
|
||||
#define free_gatt_pages(table, order) \
|
||||
free_pages((unsigned long)(table), (order))
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
#ifndef AGP_H
|
||||
#define AGP_H 1
|
||||
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/cacheflush.h>
|
||||
|
||||
/*
|
||||
* Functions to keep the agpgart mappings coherent with the MMU.
|
||||
* The GART gives the CPU a physical alias of pages in memory. The alias region is
|
||||
* mapped uncacheable. Make sure there are no conflicting mappings
|
||||
* with different cachability attributes for the same page. This avoids
|
||||
* data corruption on some CPUs.
|
||||
*/
|
||||
|
||||
/* Caller's responsibility to call global_flush_tlb() for
|
||||
* performance reasons */
|
||||
#define map_page_into_agp(page) change_page_attr(page, 1, PAGE_KERNEL_NOCACHE)
|
||||
#define unmap_page_from_agp(page) change_page_attr(page, 1, PAGE_KERNEL)
|
||||
#define flush_agp_mappings() global_flush_tlb()
|
||||
|
||||
/* Could use CLFLUSH here if the cpu supports it. But then it would
|
||||
need to be called for each cacheline of the whole page so it may not be
|
||||
worth it. Would need a page for it. */
|
||||
#define flush_agp_cache() wbinvd()
|
||||
|
||||
/* Convert a physical address to an address suitable for the GART. */
|
||||
#define phys_to_gart(x) (x)
|
||||
#define gart_to_phys(x) (x)
|
||||
|
||||
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
|
||||
#define alloc_gatt_pages(order) \
|
||||
((char *)__get_free_pages(GFP_KERNEL, (order)))
|
||||
#define free_gatt_pages(table, order) \
|
||||
free_pages((unsigned long)(table), (order))
|
||||
|
||||
#endif
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
#ifndef AGP_H
|
||||
#define AGP_H 1
|
||||
|
||||
#include <asm/cacheflush.h>
|
||||
|
||||
/*
|
||||
* Functions to keep the agpgart mappings coherent.
|
||||
* The GART gives the CPU a physical alias of memory. The alias is
|
||||
* mapped uncacheable. Make sure there are no conflicting mappings
|
||||
* with different cachability attributes for the same page.
|
||||
*/
|
||||
|
||||
/* Caller's responsibility to call global_flush_tlb() for
|
||||
* performance reasons */
|
||||
#define map_page_into_agp(page) change_page_attr(page, 1, PAGE_KERNEL_NOCACHE)
|
||||
#define unmap_page_from_agp(page) change_page_attr(page, 1, PAGE_KERNEL)
|
||||
#define flush_agp_mappings() global_flush_tlb()
|
||||
|
||||
/* Could use CLFLUSH here if the cpu supports it. But then it would
|
||||
need to be called for each cacheline of the whole page so it may not be
|
||||
worth it. Would need a page for it. */
|
||||
#define flush_agp_cache() asm volatile("wbinvd":::"memory")
|
||||
|
||||
/* Convert a physical address to an address suitable for the GART. */
|
||||
#define phys_to_gart(x) (x)
|
||||
#define gart_to_phys(x) (x)
|
||||
|
||||
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
|
||||
#define alloc_gatt_pages(order) \
|
||||
((char *)__get_free_pages(GFP_KERNEL, (order)))
|
||||
#define free_gatt_pages(table, order) \
|
||||
free_pages((unsigned long)(table), (order))
|
||||
|
||||
#endif
|
||||
22
include/asm-x86/alternative-asm.h
Normal file
22
include/asm-x86/alternative-asm.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#ifdef __ASSEMBLY__
|
||||
|
||||
#ifdef CONFIG_X86_32
|
||||
# define X86_ALIGN .long
|
||||
#else
|
||||
# define X86_ALIGN .quad
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
.macro LOCK_PREFIX
|
||||
1: lock
|
||||
.section .smp_locks,"a"
|
||||
.align 4
|
||||
X86_ALIGN 1b
|
||||
.previous
|
||||
.endm
|
||||
#else
|
||||
.macro LOCK_PREFIX
|
||||
.endm
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#ifdef CONFIG_X86_32
|
||||
# include "alternative-asm_32.i"
|
||||
#else
|
||||
# include "alternative-asm_64.i"
|
||||
#endif
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
#ifdef CONFIG_SMP
|
||||
.macro LOCK_PREFIX
|
||||
1: lock
|
||||
.section .smp_locks,"a"
|
||||
.align 4
|
||||
.long 1b
|
||||
.previous
|
||||
.endm
|
||||
#else
|
||||
.macro LOCK_PREFIX
|
||||
.endm
|
||||
#endif
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
#ifdef CONFIG_SMP
|
||||
.macro LOCK_PREFIX
|
||||
1: lock
|
||||
.section .smp_locks,"a"
|
||||
.align 8
|
||||
.quad 1b
|
||||
.previous
|
||||
.endm
|
||||
#else
|
||||
.macro LOCK_PREFIX
|
||||
.endm
|
||||
#endif
|
||||
|
|
@ -206,7 +206,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t *v)
|
|||
|
||||
/* An 64bit atomic type */
|
||||
|
||||
typedef struct { volatile long counter; } atomic64_t;
|
||||
typedef struct { long counter; } atomic64_t;
|
||||
|
||||
#define ATOMIC64_INIT(i) { (i) }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
#ifdef __KERNEL__
|
||||
# ifdef CONFIG_X86_32
|
||||
# include "auxvec_32.h"
|
||||
# else
|
||||
# include "auxvec_64.h"
|
||||
# endif
|
||||
#else
|
||||
# ifdef __i386__
|
||||
# include "auxvec_32.h"
|
||||
# else
|
||||
# include "auxvec_64.h"
|
||||
# endif
|
||||
#ifndef _ASM_X86_AUXVEC_H
|
||||
#define _ASM_X86_AUXVEC_H
|
||||
/*
|
||||
* Architecture-neutral AT_ values in 0-17, leave some room
|
||||
* for more of them, start the x86-specific ones at 32.
|
||||
*/
|
||||
#ifdef __i386__
|
||||
#define AT_SYSINFO 32
|
||||
#endif
|
||||
#define AT_SYSINFO_EHDR 33
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
#ifndef __ASMi386_AUXVEC_H
|
||||
#define __ASMi386_AUXVEC_H
|
||||
|
||||
/*
|
||||
* Architecture-neutral AT_ values in 0-17, leave some room
|
||||
* for more of them, start the x86-specific ones at 32.
|
||||
*/
|
||||
#define AT_SYSINFO 32
|
||||
#define AT_SYSINFO_EHDR 33
|
||||
|
||||
#endif
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef __ASM_X86_64_AUXVEC_H
|
||||
#define __ASM_X86_64_AUXVEC_H
|
||||
|
||||
#define AT_SYSINFO_EHDR 33
|
||||
|
||||
#endif
|
||||
|
|
@ -260,7 +260,7 @@ extern long find_first_bit(const unsigned long * addr, unsigned long size);
|
|||
extern long find_next_bit(const unsigned long * addr, long size, long offset);
|
||||
|
||||
/* return index of first bet set in val or max when no bit is set */
|
||||
static inline unsigned long __scanbit(unsigned long val, unsigned long max)
|
||||
static inline long __scanbit(unsigned long val, unsigned long max)
|
||||
{
|
||||
asm("bsfq %1,%0 ; cmovz %2,%0" : "=&r" (val) : "r" (val), "r" (max));
|
||||
return val;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,42 @@
|
|||
#ifndef _ASM_X86_BUG_H
|
||||
#define _ASM_X86_BUG_H
|
||||
|
||||
#ifdef CONFIG_BUG
|
||||
#define HAVE_ARCH_BUG
|
||||
|
||||
#ifdef CONFIG_DEBUG_BUGVERBOSE
|
||||
|
||||
#ifdef CONFIG_X86_32
|
||||
# include "bug_32.h"
|
||||
# define __BUG_C0 "2:\t.long 1b, %c0\n"
|
||||
#else
|
||||
# include "bug_64.h"
|
||||
# define __BUG_C0 "2:\t.quad 1b, %c0\n"
|
||||
#endif
|
||||
|
||||
#define BUG() \
|
||||
do { \
|
||||
asm volatile("1:\tud2\n" \
|
||||
".pushsection __bug_table,\"a\"\n" \
|
||||
__BUG_C0 \
|
||||
"\t.word %c1, 0\n" \
|
||||
"\t.org 2b+%c2\n" \
|
||||
".popsection" \
|
||||
: : "i" (__FILE__), "i" (__LINE__), \
|
||||
"i" (sizeof(struct bug_entry))); \
|
||||
for(;;) ; \
|
||||
} while(0)
|
||||
|
||||
#else
|
||||
#define BUG() \
|
||||
do { \
|
||||
asm volatile("ud2"); \
|
||||
for(;;) ; \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
void out_of_line_bug(void);
|
||||
#else /* CONFIG_BUG */
|
||||
static inline void out_of_line_bug(void) { }
|
||||
#endif /* !CONFIG_BUG */
|
||||
|
||||
#include <asm-generic/bug.h>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
#ifndef _I386_BUG_H
|
||||
#define _I386_BUG_H
|
||||
|
||||
|
||||
/*
|
||||
* Tell the user there is some problem.
|
||||
* The offending file and line are encoded encoded in the __bug_table section.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_BUG
|
||||
#define HAVE_ARCH_BUG
|
||||
|
||||
#ifdef CONFIG_DEBUG_BUGVERBOSE
|
||||
#define BUG() \
|
||||
do { \
|
||||
asm volatile("1:\tud2\n" \
|
||||
".pushsection __bug_table,\"a\"\n" \
|
||||
"2:\t.long 1b, %c0\n" \
|
||||
"\t.word %c1, 0\n" \
|
||||
"\t.org 2b+%c2\n" \
|
||||
".popsection" \
|
||||
: : "i" (__FILE__), "i" (__LINE__), \
|
||||
"i" (sizeof(struct bug_entry))); \
|
||||
for(;;) ; \
|
||||
} while(0)
|
||||
|
||||
#else
|
||||
#define BUG() \
|
||||
do { \
|
||||
asm volatile("ud2"); \
|
||||
for(;;) ; \
|
||||
} while(0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <asm-generic/bug.h>
|
||||
#endif
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
#ifndef __ASM_X8664_BUG_H
|
||||
#define __ASM_X8664_BUG_H 1
|
||||
|
||||
#ifdef CONFIG_BUG
|
||||
#define HAVE_ARCH_BUG
|
||||
|
||||
#ifdef CONFIG_DEBUG_BUGVERBOSE
|
||||
#define BUG() \
|
||||
do { \
|
||||
asm volatile("1:\tud2\n" \
|
||||
".pushsection __bug_table,\"a\"\n" \
|
||||
"2:\t.quad 1b, %c0\n" \
|
||||
"\t.word %c1, 0\n" \
|
||||
"\t.org 2b+%c2\n" \
|
||||
".popsection" \
|
||||
: : "i" (__FILE__), "i" (__LINE__), \
|
||||
"i" (sizeof(struct bug_entry))); \
|
||||
for(;;) ; \
|
||||
} while(0)
|
||||
#else
|
||||
#define BUG() \
|
||||
do { \
|
||||
asm volatile("ud2"); \
|
||||
for(;;) ; \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
void out_of_line_bug(void);
|
||||
#else
|
||||
static inline void out_of_line_bug(void) { }
|
||||
#endif
|
||||
|
||||
#include <asm-generic/bug.h>
|
||||
#endif
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
#ifdef CONFIG_X86_32
|
||||
# include "bugs_32.h"
|
||||
#else
|
||||
# include "bugs_64.h"
|
||||
#endif
|
||||
#ifndef _ASM_X86_BUGS_H
|
||||
#define _ASM_X86_BUGS_H
|
||||
|
||||
void check_bugs(void);
|
||||
|
||||
#endif /* _ASM_X86_BUGS_H */
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
/*
|
||||
* This is included by init/main.c to check for architecture-dependent bugs.
|
||||
*
|
||||
* Needs:
|
||||
* void check_bugs(void);
|
||||
*/
|
||||
#ifndef _ASM_I386_BUG_H
|
||||
#define _ASM_I386_BUG_H
|
||||
|
||||
void check_bugs(void);
|
||||
|
||||
#endif /* _ASM_I386_BUG_H */
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef _ASM_X86_64_BUGS_H
|
||||
#define _ASM_X86_64_BUGS_H
|
||||
|
||||
void check_bugs(void);
|
||||
|
||||
#endif /* _ASM_X86_64_BUGS_H */
|
||||
|
|
@ -1,5 +1,20 @@
|
|||
#ifdef CONFIG_X86_32
|
||||
# include "cache_32.h"
|
||||
#else
|
||||
# include "cache_64.h"
|
||||
#ifndef _ARCH_X86_CACHE_H
|
||||
#define _ARCH_X86_CACHE_H
|
||||
|
||||
/* L1 cache line size */
|
||||
#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
|
||||
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
|
||||
|
||||
#define __read_mostly __attribute__((__section__(".data.read_mostly")))
|
||||
|
||||
#ifdef CONFIG_X86_VSMP
|
||||
/* vSMP Internode cacheline shift */
|
||||
#define INTERNODE_CACHE_SHIFT (12)
|
||||
#ifdef CONFIG_SMP
|
||||
#define __cacheline_aligned_in_smp \
|
||||
__attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT)))) \
|
||||
__attribute__((__section__(".data.page_aligned")))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
/*
|
||||
* include/asm-i386/cache.h
|
||||
*/
|
||||
#ifndef __ARCH_I386_CACHE_H
|
||||
#define __ARCH_I386_CACHE_H
|
||||
|
||||
|
||||
/* L1 cache line size */
|
||||
#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
|
||||
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
|
||||
|
||||
#define __read_mostly __attribute__((__section__(".data.read_mostly")))
|
||||
|
||||
#endif
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* include/asm-x86_64/cache.h
|
||||
*/
|
||||
#ifndef __ARCH_X8664_CACHE_H
|
||||
#define __ARCH_X8664_CACHE_H
|
||||
|
||||
|
||||
/* L1 cache line size */
|
||||
#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
|
||||
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
|
||||
|
||||
#ifdef CONFIG_X86_VSMP
|
||||
|
||||
/* vSMP Internode cacheline shift */
|
||||
#define INTERNODE_CACHE_SHIFT (12)
|
||||
#ifdef CONFIG_SMP
|
||||
#define __cacheline_aligned_in_smp \
|
||||
__attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT)))) \
|
||||
__attribute__((__section__(".data.page_aligned")))
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define __read_mostly __attribute__((__section__(".data.read_mostly")))
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,40 @@
|
|||
#ifdef CONFIG_X86_32
|
||||
# include "cacheflush_32.h"
|
||||
#else
|
||||
# include "cacheflush_64.h"
|
||||
#ifndef _ASM_X86_CACHEFLUSH_H
|
||||
#define _ASM_X86_CACHEFLUSH_H
|
||||
|
||||
/* Keep includes the same across arches. */
|
||||
#include <linux/mm.h>
|
||||
|
||||
/* Caches aren't brain-dead on the intel. */
|
||||
#define flush_cache_all() do { } while (0)
|
||||
#define flush_cache_mm(mm) do { } while (0)
|
||||
#define flush_cache_dup_mm(mm) do { } while (0)
|
||||
#define flush_cache_range(vma, start, end) do { } while (0)
|
||||
#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
|
||||
#define flush_dcache_page(page) do { } while (0)
|
||||
#define flush_dcache_mmap_lock(mapping) do { } while (0)
|
||||
#define flush_dcache_mmap_unlock(mapping) do { } while (0)
|
||||
#define flush_icache_range(start, end) do { } while (0)
|
||||
#define flush_icache_page(vma,pg) do { } while (0)
|
||||
#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
|
||||
#define flush_cache_vmap(start, end) do { } while (0)
|
||||
#define flush_cache_vunmap(start, end) do { } while (0)
|
||||
|
||||
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
|
||||
memcpy(dst, src, len)
|
||||
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
|
||||
memcpy(dst, src, len)
|
||||
|
||||
void global_flush_tlb(void);
|
||||
int change_page_attr(struct page *page, int numpages, pgprot_t prot);
|
||||
int change_page_attr_addr(unsigned long addr, int numpages, pgprot_t prot);
|
||||
|
||||
#ifdef CONFIG_DEBUG_PAGEALLOC
|
||||
/* internal debugging function */
|
||||
void kernel_map_pages(struct page *page, int numpages, int enable);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_RODATA
|
||||
void mark_rodata_ro(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
#ifndef _I386_CACHEFLUSH_H
|
||||
#define _I386_CACHEFLUSH_H
|
||||
|
||||
/* Keep includes the same across arches. */
|
||||
#include <linux/mm.h>
|
||||
|
||||
/* Caches aren't brain-dead on the intel. */
|
||||
#define flush_cache_all() do { } while (0)
|
||||
#define flush_cache_mm(mm) do { } while (0)
|
||||
#define flush_cache_dup_mm(mm) do { } while (0)
|
||||
#define flush_cache_range(vma, start, end) do { } while (0)
|
||||
#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
|
||||
#define flush_dcache_page(page) do { } while (0)
|
||||
#define flush_dcache_mmap_lock(mapping) do { } while (0)
|
||||
#define flush_dcache_mmap_unlock(mapping) do { } while (0)
|
||||
#define flush_icache_range(start, end) do { } while (0)
|
||||
#define flush_icache_page(vma,pg) do { } while (0)
|
||||
#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
|
||||
#define flush_cache_vmap(start, end) do { } while (0)
|
||||
#define flush_cache_vunmap(start, end) do { } while (0)
|
||||
|
||||
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
|
||||
memcpy(dst, src, len)
|
||||
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
|
||||
memcpy(dst, src, len)
|
||||
|
||||
void global_flush_tlb(void);
|
||||
int change_page_attr(struct page *page, int numpages, pgprot_t prot);
|
||||
|
||||
#ifdef CONFIG_DEBUG_PAGEALLOC
|
||||
/* internal debugging function */
|
||||
void kernel_map_pages(struct page *page, int numpages, int enable);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_RODATA
|
||||
void mark_rodata_ro(void);
|
||||
#endif
|
||||
|
||||
#endif /* _I386_CACHEFLUSH_H */
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
#ifndef _X8664_CACHEFLUSH_H
|
||||
#define _X8664_CACHEFLUSH_H
|
||||
|
||||
/* Keep includes the same across arches. */
|
||||
#include <linux/mm.h>
|
||||
|
||||
/* Caches aren't brain-dead on the intel. */
|
||||
#define flush_cache_all() do { } while (0)
|
||||
#define flush_cache_mm(mm) do { } while (0)
|
||||
#define flush_cache_dup_mm(mm) do { } while (0)
|
||||
#define flush_cache_range(vma, start, end) do { } while (0)
|
||||
#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
|
||||
#define flush_dcache_page(page) do { } while (0)
|
||||
#define flush_dcache_mmap_lock(mapping) do { } while (0)
|
||||
#define flush_dcache_mmap_unlock(mapping) do { } while (0)
|
||||
#define flush_icache_range(start, end) do { } while (0)
|
||||
#define flush_icache_page(vma,pg) do { } while (0)
|
||||
#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
|
||||
#define flush_cache_vmap(start, end) do { } while (0)
|
||||
#define flush_cache_vunmap(start, end) do { } while (0)
|
||||
|
||||
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
|
||||
memcpy(dst, src, len)
|
||||
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
|
||||
memcpy(dst, src, len)
|
||||
|
||||
void global_flush_tlb(void);
|
||||
int change_page_attr(struct page *page, int numpages, pgprot_t prot);
|
||||
int change_page_attr_addr(unsigned long addr, int numpages, pgprot_t prot);
|
||||
|
||||
#ifdef CONFIG_DEBUG_RODATA
|
||||
void mark_rodata_ro(void);
|
||||
#endif
|
||||
|
||||
#endif /* _X8664_CACHEFLUSH_H */
|
||||
|
|
@ -13,9 +13,6 @@ struct i386_cpu {
|
|||
extern int arch_register_cpu(int num);
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
extern void arch_unregister_cpu(int);
|
||||
extern int enable_cpu_hotplug;
|
||||
#else
|
||||
#define enable_cpu_hotplug 0
|
||||
#endif
|
||||
|
||||
DECLARE_PER_CPU(int, cpu_state);
|
||||
|
|
|
|||
|
|
@ -1,5 +1 @@
|
|||
#ifdef CONFIG_X86_32
|
||||
# include "cputime_32.h"
|
||||
#else
|
||||
# include "cputime_64.h"
|
||||
#endif
|
||||
#include <asm-generic/cputime.h>
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef __I386_CPUTIME_H
|
||||
#define __I386_CPUTIME_H
|
||||
|
||||
#include <asm-generic/cputime.h>
|
||||
|
||||
#endif /* __I386_CPUTIME_H */
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef __X86_64_CPUTIME_H
|
||||
#define __X86_64_CPUTIME_H
|
||||
|
||||
#include <asm-generic/cputime.h>
|
||||
|
||||
#endif /* __X86_64_CPUTIME_H */
|
||||
|
|
@ -1,13 +1,70 @@
|
|||
#ifdef __KERNEL__
|
||||
# ifdef CONFIG_X86_32
|
||||
# include "debugreg_32.h"
|
||||
# else
|
||||
# include "debugreg_64.h"
|
||||
# endif
|
||||
#ifndef _ASM_X86_DEBUGREG_H
|
||||
#define _ASM_X86_DEBUGREG_H
|
||||
|
||||
|
||||
/* Indicate the register numbers for a number of the specific
|
||||
debug registers. Registers 0-3 contain the addresses we wish to trap on */
|
||||
#define DR_FIRSTADDR 0 /* u_debugreg[DR_FIRSTADDR] */
|
||||
#define DR_LASTADDR 3 /* u_debugreg[DR_LASTADDR] */
|
||||
|
||||
#define DR_STATUS 6 /* u_debugreg[DR_STATUS] */
|
||||
#define DR_CONTROL 7 /* u_debugreg[DR_CONTROL] */
|
||||
|
||||
/* Define a few things for the status register. We can use this to determine
|
||||
which debugging register was responsible for the trap. The other bits
|
||||
are either reserved or not of interest to us. */
|
||||
|
||||
#define DR_TRAP0 (0x1) /* db0 */
|
||||
#define DR_TRAP1 (0x2) /* db1 */
|
||||
#define DR_TRAP2 (0x4) /* db2 */
|
||||
#define DR_TRAP3 (0x8) /* db3 */
|
||||
|
||||
#define DR_STEP (0x4000) /* single-step */
|
||||
#define DR_SWITCH (0x8000) /* task switch */
|
||||
|
||||
/* Now define a bunch of things for manipulating the control register.
|
||||
The top two bytes of the control register consist of 4 fields of 4
|
||||
bits - each field corresponds to one of the four debug registers,
|
||||
and indicates what types of access we trap on, and how large the data
|
||||
field is that we are looking at */
|
||||
|
||||
#define DR_CONTROL_SHIFT 16 /* Skip this many bits in ctl register */
|
||||
#define DR_CONTROL_SIZE 4 /* 4 control bits per register */
|
||||
|
||||
#define DR_RW_EXECUTE (0x0) /* Settings for the access types to trap on */
|
||||
#define DR_RW_WRITE (0x1)
|
||||
#define DR_RW_READ (0x3)
|
||||
|
||||
#define DR_LEN_1 (0x0) /* Settings for data length to trap on */
|
||||
#define DR_LEN_2 (0x4)
|
||||
#define DR_LEN_4 (0xC)
|
||||
#define DR_LEN_8 (0x8)
|
||||
|
||||
/* The low byte to the control register determine which registers are
|
||||
enabled. There are 4 fields of two bits. One bit is "local", meaning
|
||||
that the processor will reset the bit after a task switch and the other
|
||||
is global meaning that we have to explicitly reset the bit. With linux,
|
||||
you can use either one, since we explicitly zero the register when we enter
|
||||
kernel mode. */
|
||||
|
||||
#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */
|
||||
#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */
|
||||
#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */
|
||||
|
||||
#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */
|
||||
#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */
|
||||
|
||||
/* The second byte to the control register has a few special things.
|
||||
We can slow the instruction pipeline for instructions coming via the
|
||||
gdt or the ldt if we want to. I am not sure why this is an advantage */
|
||||
|
||||
#ifdef __i386__
|
||||
#define DR_CONTROL_RESERVED (0xFC00) /* Reserved by Intel */
|
||||
#else
|
||||
# ifdef __i386__
|
||||
# include "debugreg_32.h"
|
||||
# else
|
||||
# include "debugreg_64.h"
|
||||
# endif
|
||||
#define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00UL) /* Reserved */
|
||||
#endif
|
||||
|
||||
#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */
|
||||
#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,64 +0,0 @@
|
|||
#ifndef _I386_DEBUGREG_H
|
||||
#define _I386_DEBUGREG_H
|
||||
|
||||
|
||||
/* Indicate the register numbers for a number of the specific
|
||||
debug registers. Registers 0-3 contain the addresses we wish to trap on */
|
||||
#define DR_FIRSTADDR 0 /* u_debugreg[DR_FIRSTADDR] */
|
||||
#define DR_LASTADDR 3 /* u_debugreg[DR_LASTADDR] */
|
||||
|
||||
#define DR_STATUS 6 /* u_debugreg[DR_STATUS] */
|
||||
#define DR_CONTROL 7 /* u_debugreg[DR_CONTROL] */
|
||||
|
||||
/* Define a few things for the status register. We can use this to determine
|
||||
which debugging register was responsible for the trap. The other bits
|
||||
are either reserved or not of interest to us. */
|
||||
|
||||
#define DR_TRAP0 (0x1) /* db0 */
|
||||
#define DR_TRAP1 (0x2) /* db1 */
|
||||
#define DR_TRAP2 (0x4) /* db2 */
|
||||
#define DR_TRAP3 (0x8) /* db3 */
|
||||
|
||||
#define DR_STEP (0x4000) /* single-step */
|
||||
#define DR_SWITCH (0x8000) /* task switch */
|
||||
|
||||
/* Now define a bunch of things for manipulating the control register.
|
||||
The top two bytes of the control register consist of 4 fields of 4
|
||||
bits - each field corresponds to one of the four debug registers,
|
||||
and indicates what types of access we trap on, and how large the data
|
||||
field is that we are looking at */
|
||||
|
||||
#define DR_CONTROL_SHIFT 16 /* Skip this many bits in ctl register */
|
||||
#define DR_CONTROL_SIZE 4 /* 4 control bits per register */
|
||||
|
||||
#define DR_RW_EXECUTE (0x0) /* Settings for the access types to trap on */
|
||||
#define DR_RW_WRITE (0x1)
|
||||
#define DR_RW_READ (0x3)
|
||||
|
||||
#define DR_LEN_1 (0x0) /* Settings for data length to trap on */
|
||||
#define DR_LEN_2 (0x4)
|
||||
#define DR_LEN_4 (0xC)
|
||||
|
||||
/* The low byte to the control register determine which registers are
|
||||
enabled. There are 4 fields of two bits. One bit is "local", meaning
|
||||
that the processor will reset the bit after a task switch and the other
|
||||
is global meaning that we have to explicitly reset the bit. With linux,
|
||||
you can use either one, since we explicitly zero the register when we enter
|
||||
kernel mode. */
|
||||
|
||||
#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */
|
||||
#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */
|
||||
#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */
|
||||
|
||||
#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */
|
||||
#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */
|
||||
|
||||
/* The second byte to the control register has a few special things.
|
||||
We can slow the instruction pipeline for instructions coming via the
|
||||
gdt or the ldt if we want to. I am not sure why this is an advantage */
|
||||
|
||||
#define DR_CONTROL_RESERVED (0xFC00) /* Reserved by Intel */
|
||||
#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */
|
||||
#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
#ifndef _X86_64_DEBUGREG_H
|
||||
#define _X86_64_DEBUGREG_H
|
||||
|
||||
|
||||
/* Indicate the register numbers for a number of the specific
|
||||
debug registers. Registers 0-3 contain the addresses we wish to trap on */
|
||||
#define DR_FIRSTADDR 0 /* u_debugreg[DR_FIRSTADDR] */
|
||||
#define DR_LASTADDR 3 /* u_debugreg[DR_LASTADDR] */
|
||||
|
||||
#define DR_STATUS 6 /* u_debugreg[DR_STATUS] */
|
||||
#define DR_CONTROL 7 /* u_debugreg[DR_CONTROL] */
|
||||
|
||||
/* Define a few things for the status register. We can use this to determine
|
||||
which debugging register was responsible for the trap. The other bits
|
||||
are either reserved or not of interest to us. */
|
||||
|
||||
#define DR_TRAP0 (0x1) /* db0 */
|
||||
#define DR_TRAP1 (0x2) /* db1 */
|
||||
#define DR_TRAP2 (0x4) /* db2 */
|
||||
#define DR_TRAP3 (0x8) /* db3 */
|
||||
|
||||
#define DR_STEP (0x4000) /* single-step */
|
||||
#define DR_SWITCH (0x8000) /* task switch */
|
||||
|
||||
/* Now define a bunch of things for manipulating the control register.
|
||||
The top two bytes of the control register consist of 4 fields of 4
|
||||
bits - each field corresponds to one of the four debug registers,
|
||||
and indicates what types of access we trap on, and how large the data
|
||||
field is that we are looking at */
|
||||
|
||||
#define DR_CONTROL_SHIFT 16 /* Skip this many bits in ctl register */
|
||||
#define DR_CONTROL_SIZE 4 /* 4 control bits per register */
|
||||
|
||||
#define DR_RW_EXECUTE (0x0) /* Settings for the access types to trap on */
|
||||
#define DR_RW_WRITE (0x1)
|
||||
#define DR_RW_READ (0x3)
|
||||
|
||||
#define DR_LEN_1 (0x0) /* Settings for data length to trap on */
|
||||
#define DR_LEN_2 (0x4)
|
||||
#define DR_LEN_4 (0xC)
|
||||
#define DR_LEN_8 (0x8)
|
||||
|
||||
/* The low byte to the control register determine which registers are
|
||||
enabled. There are 4 fields of two bits. One bit is "local", meaning
|
||||
that the processor will reset the bit after a task switch and the other
|
||||
is global meaning that we have to explicitly reset the bit. With linux,
|
||||
you can use either one, since we explicitly zero the register when we enter
|
||||
kernel mode. */
|
||||
|
||||
#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */
|
||||
#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */
|
||||
#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */
|
||||
|
||||
#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */
|
||||
#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */
|
||||
|
||||
/* The second byte to the control register has a few special things.
|
||||
We can slow the instruction pipeline for instructions coming via the
|
||||
gdt or the ldt if we want to. I am not sure why this is an advantage */
|
||||
|
||||
#define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00UL) /* Reserved */
|
||||
#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */
|
||||
#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,31 @@
|
|||
#ifdef CONFIG_X86_32
|
||||
# include "delay_32.h"
|
||||
#else
|
||||
# include "delay_64.h"
|
||||
#endif
|
||||
#ifndef _ASM_X86_DELAY_H
|
||||
#define _ASM_X86_DELAY_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 1993 Linus Torvalds
|
||||
*
|
||||
* Delay routines calling functions in arch/x86/lib/delay.c
|
||||
*/
|
||||
|
||||
/* Undefined functions to get compile-time errors */
|
||||
extern void __bad_udelay(void);
|
||||
extern void __bad_ndelay(void);
|
||||
|
||||
extern void __udelay(unsigned long usecs);
|
||||
extern void __ndelay(unsigned long nsecs);
|
||||
extern void __const_udelay(unsigned long usecs);
|
||||
extern void __delay(unsigned long loops);
|
||||
|
||||
/* 0x10c7 is 2**32 / 1000000 (rounded up) */
|
||||
#define udelay(n) (__builtin_constant_p(n) ? \
|
||||
((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) : \
|
||||
__udelay(n))
|
||||
|
||||
/* 0x5 is 2**32 / 1000000000 (rounded up) */
|
||||
#define ndelay(n) (__builtin_constant_p(n) ? \
|
||||
((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
|
||||
__ndelay(n))
|
||||
|
||||
void use_tsc_delay(void);
|
||||
|
||||
#endif /* _ASM_X86_DELAY_H */
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
#ifndef _I386_DELAY_H
|
||||
#define _I386_DELAY_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 1993 Linus Torvalds
|
||||
*
|
||||
* Delay routines calling functions in arch/i386/lib/delay.c
|
||||
*/
|
||||
|
||||
/* Undefined functions to get compile-time errors */
|
||||
extern void __bad_udelay(void);
|
||||
extern void __bad_ndelay(void);
|
||||
|
||||
extern void __udelay(unsigned long usecs);
|
||||
extern void __ndelay(unsigned long nsecs);
|
||||
extern void __const_udelay(unsigned long usecs);
|
||||
extern void __delay(unsigned long loops);
|
||||
|
||||
/* 0x10c7 is 2**32 / 1000000 (rounded up) */
|
||||
#define udelay(n) (__builtin_constant_p(n) ? \
|
||||
((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) : \
|
||||
__udelay(n))
|
||||
|
||||
/* 0x5 is 2**32 / 1000000000 (rounded up) */
|
||||
#define ndelay(n) (__builtin_constant_p(n) ? \
|
||||
((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
|
||||
__ndelay(n))
|
||||
|
||||
void use_tsc_delay(void);
|
||||
|
||||
#endif /* defined(_I386_DELAY_H) */
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
#ifndef _X8664_DELAY_H
|
||||
#define _X8664_DELAY_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 1993 Linus Torvalds
|
||||
*
|
||||
* Delay routines calling functions in arch/x86_64/lib/delay.c
|
||||
*/
|
||||
|
||||
/* Undefined functions to get compile-time errors */
|
||||
extern void __bad_udelay(void);
|
||||
extern void __bad_ndelay(void);
|
||||
|
||||
extern void __udelay(unsigned long usecs);
|
||||
extern void __ndelay(unsigned long nsecs);
|
||||
extern void __const_udelay(unsigned long usecs);
|
||||
extern void __delay(unsigned long loops);
|
||||
|
||||
/* 0x10c7 is 2**32 / 1000000 (rounded up) */
|
||||
#define udelay(n) (__builtin_constant_p(n) ? \
|
||||
((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) : \
|
||||
__udelay(n))
|
||||
|
||||
/* 0x5 is 2**32 / 1000000000 (rounded up) */
|
||||
#define ndelay(n) (__builtin_constant_p(n) ? \
|
||||
((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
|
||||
__ndelay(n))
|
||||
|
||||
|
||||
#endif /* defined(_X8664_DELAY_H) */
|
||||
|
|
@ -1,5 +1,10 @@
|
|||
#ifdef CONFIG_X86_32
|
||||
# include "device_32.h"
|
||||
#else
|
||||
# include "device_64.h"
|
||||
#ifndef _ASM_X86_DEVICE_H
|
||||
#define _ASM_X86_DEVICE_H
|
||||
|
||||
struct dev_archdata {
|
||||
#ifdef CONFIG_ACPI
|
||||
void *acpi_handle;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* _ASM_X86_DEVICE_H */
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#ifndef _ASM_I386_DEVICE_H
|
||||
#define _ASM_I386_DEVICE_H
|
||||
|
||||
struct dev_archdata {
|
||||
#ifdef CONFIG_ACPI
|
||||
void *acpi_handle;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* _ASM_I386_DEVICE_H */
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#ifndef _ASM_X86_64_DEVICE_H
|
||||
#define _ASM_X86_64_DEVICE_H
|
||||
|
||||
struct dev_archdata {
|
||||
#ifdef CONFIG_ACPI
|
||||
void *acpi_handle;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* _ASM_X86_64_DEVICE_H */
|
||||
|
|
@ -1,5 +1,35 @@
|
|||
#ifndef _ASM_X86_DMI_H
|
||||
#define _ASM_X86_DMI_H
|
||||
|
||||
#include <asm/io.h>
|
||||
|
||||
#ifdef CONFIG_X86_32
|
||||
# include "dmi_32.h"
|
||||
#else
|
||||
# include "dmi_64.h"
|
||||
|
||||
/* Use early IO mappings for DMI because it's initialized early */
|
||||
#define dmi_ioremap bt_ioremap
|
||||
#define dmi_iounmap bt_iounmap
|
||||
#define dmi_alloc alloc_bootmem
|
||||
|
||||
#else /* CONFIG_X86_32 */
|
||||
|
||||
#define DMI_MAX_DATA 2048
|
||||
|
||||
extern int dmi_alloc_index;
|
||||
extern char dmi_alloc_data[DMI_MAX_DATA];
|
||||
|
||||
/* This is so early that there is no good way to allocate dynamic memory.
|
||||
Allocate data in an BSS array. */
|
||||
static inline void *dmi_alloc(unsigned len)
|
||||
{
|
||||
int idx = dmi_alloc_index;
|
||||
if ((dmi_alloc_index += len) > DMI_MAX_DATA)
|
||||
return NULL;
|
||||
return dmi_alloc_data + idx;
|
||||
}
|
||||
|
||||
#define dmi_ioremap early_ioremap
|
||||
#define dmi_iounmap early_iounmap
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
#ifndef _ASM_DMI_H
|
||||
#define _ASM_DMI_H 1
|
||||
|
||||
#include <asm/io.h>
|
||||
|
||||
/* Use early IO mappings for DMI because it's initialized early */
|
||||
#define dmi_ioremap bt_ioremap
|
||||
#define dmi_iounmap bt_iounmap
|
||||
#define dmi_alloc alloc_bootmem
|
||||
|
||||
#endif
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
#ifndef _ASM_DMI_H
|
||||
#define _ASM_DMI_H 1
|
||||
|
||||
#include <asm/io.h>
|
||||
|
||||
#define DMI_MAX_DATA 2048
|
||||
|
||||
extern int dmi_alloc_index;
|
||||
extern char dmi_alloc_data[DMI_MAX_DATA];
|
||||
|
||||
/* This is so early that there is no good way to allocate dynamic memory.
|
||||
Allocate data in an BSS array. */
|
||||
static inline void *dmi_alloc(unsigned len)
|
||||
{
|
||||
int idx = dmi_alloc_index;
|
||||
if ((dmi_alloc_index += len) > DMI_MAX_DATA)
|
||||
return NULL;
|
||||
return dmi_alloc_data + idx;
|
||||
}
|
||||
|
||||
#define dmi_ioremap early_ioremap
|
||||
#define dmi_iounmap early_iounmap
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,18 @@
|
|||
#ifdef CONFIG_X86_32
|
||||
# include "edac_32.h"
|
||||
#else
|
||||
# include "edac_64.h"
|
||||
#ifndef _ASM_X86_EDAC_H
|
||||
#define _ASM_X86_EDAC_H
|
||||
|
||||
/* ECC atomic, DMA, SMP and interrupt safe scrub function */
|
||||
|
||||
static __inline__ void atomic_scrub(void *va, u32 size)
|
||||
{
|
||||
u32 i, *virt_addr = va;
|
||||
|
||||
/*
|
||||
* Very carefully read and write to memory atomically so we
|
||||
* are interrupt, DMA and SMP safe.
|
||||
*/
|
||||
for (i = 0; i < size / 4; i++, virt_addr++)
|
||||
__asm__ __volatile__("lock; addl $0, %0"::"m"(*virt_addr));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
#ifndef ASM_EDAC_H
|
||||
#define ASM_EDAC_H
|
||||
|
||||
/* ECC atomic, DMA, SMP and interrupt safe scrub function */
|
||||
|
||||
static __inline__ void atomic_scrub(void *va, u32 size)
|
||||
{
|
||||
unsigned long *virt_addr = va;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < size / 4; i++, virt_addr++)
|
||||
/* Very carefully read and write to memory atomically
|
||||
* so we are interrupt, DMA and SMP safe.
|
||||
*/
|
||||
__asm__ __volatile__("lock; addl $0, %0"::"m"(*virt_addr));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
#ifndef ASM_EDAC_H
|
||||
#define ASM_EDAC_H
|
||||
|
||||
/* ECC atomic, DMA, SMP and interrupt safe scrub function */
|
||||
|
||||
static __inline__ void atomic_scrub(void *va, u32 size)
|
||||
{
|
||||
unsigned int *virt_addr = va;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < size / 4; i++, virt_addr++)
|
||||
/* Very carefully read and write to memory atomically
|
||||
* so we are interrupt, DMA and SMP safe.
|
||||
*/
|
||||
__asm__ __volatile__("lock; addl $0, %0"::"m"(*virt_addr));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,13 +1 @@
|
|||
#ifdef __KERNEL__
|
||||
# ifdef CONFIG_X86_32
|
||||
# include "errno_32.h"
|
||||
# else
|
||||
# include "errno_64.h"
|
||||
# endif
|
||||
#else
|
||||
# ifdef __i386__
|
||||
# include "errno_32.h"
|
||||
# else
|
||||
# include "errno_64.h"
|
||||
# endif
|
||||
#endif
|
||||
#include <asm-generic/errno.h>
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef _I386_ERRNO_H
|
||||
#define _I386_ERRNO_H
|
||||
|
||||
#include <asm-generic/errno.h>
|
||||
|
||||
#endif
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef _X8664_ERRNO_H
|
||||
#define _X8664_ERRNO_H
|
||||
|
||||
#include <asm-generic/errno.h>
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,21 @@
|
|||
#ifndef _ASM_X86_FB_H
|
||||
#define _ASM_X86_FB_H
|
||||
|
||||
#include <linux/fb.h>
|
||||
#include <linux/fs.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
|
||||
unsigned long off)
|
||||
{
|
||||
if (boot_cpu_data.x86 > 3)
|
||||
pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86_32
|
||||
# include "fb_32.h"
|
||||
extern int fb_is_primary_device(struct fb_info *info);
|
||||
#else
|
||||
# include "fb_64.h"
|
||||
static inline int fb_is_primary_device(struct fb_info *info) { return 0; }
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_X86_FB_H */
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
#ifndef _ASM_FB_H_
|
||||
#define _ASM_FB_H_
|
||||
|
||||
#include <linux/fb.h>
|
||||
#include <linux/fs.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
extern int fb_is_primary_device(struct fb_info *info);
|
||||
|
||||
static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
|
||||
unsigned long off)
|
||||
{
|
||||
if (boot_cpu_data.x86 > 3)
|
||||
pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
|
||||
}
|
||||
|
||||
#endif /* _ASM_FB_H_ */
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
#ifndef _ASM_FB_H_
|
||||
#define _ASM_FB_H_
|
||||
#include <linux/fb.h>
|
||||
#include <linux/fs.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
|
||||
unsigned long off)
|
||||
{
|
||||
if (boot_cpu_data.x86 > 3)
|
||||
pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
|
||||
}
|
||||
|
||||
static inline int fb_is_primary_device(struct fb_info *info)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* _ASM_FB_H_ */
|
||||
|
|
@ -1,5 +1,278 @@
|
|||
#ifdef CONFIG_X86_32
|
||||
# include "floppy_32.h"
|
||||
#else
|
||||
# include "floppy_64.h"
|
||||
/*
|
||||
* Architecture specific parts of the Floppy driver
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 1995
|
||||
*/
|
||||
#ifndef _ASM_X86_FLOPPY_H
|
||||
#define _ASM_X86_FLOPPY_H
|
||||
|
||||
#include <linux/vmalloc.h>
|
||||
|
||||
/*
|
||||
* The DMA channel used by the floppy controller cannot access data at
|
||||
* addresses >= 16MB
|
||||
*
|
||||
* Went back to the 1MB limit, as some people had problems with the floppy
|
||||
* driver otherwise. It doesn't matter much for performance anyway, as most
|
||||
* floppy accesses go through the track buffer.
|
||||
*/
|
||||
#define _CROSS_64KB(a,s,vdma) \
|
||||
(!(vdma) && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64))
|
||||
|
||||
#define CROSS_64KB(a,s) _CROSS_64KB(a,s,use_virtual_dma & 1)
|
||||
|
||||
|
||||
#define SW fd_routine[use_virtual_dma&1]
|
||||
#define CSW fd_routine[can_use_virtual_dma & 1]
|
||||
|
||||
|
||||
#define fd_inb(port) inb_p(port)
|
||||
#define fd_outb(value,port) outb_p(value,port)
|
||||
|
||||
#define fd_request_dma() CSW._request_dma(FLOPPY_DMA,"floppy")
|
||||
#define fd_free_dma() CSW._free_dma(FLOPPY_DMA)
|
||||
#define fd_enable_irq() enable_irq(FLOPPY_IRQ)
|
||||
#define fd_disable_irq() disable_irq(FLOPPY_IRQ)
|
||||
#define fd_free_irq() free_irq(FLOPPY_IRQ, NULL)
|
||||
#define fd_get_dma_residue() SW._get_dma_residue(FLOPPY_DMA)
|
||||
#define fd_dma_mem_alloc(size) SW._dma_mem_alloc(size)
|
||||
#define fd_dma_setup(addr, size, mode, io) SW._dma_setup(addr, size, mode, io)
|
||||
|
||||
#define FLOPPY_CAN_FALLBACK_ON_NODMA
|
||||
|
||||
static int virtual_dma_count;
|
||||
static int virtual_dma_residue;
|
||||
static char *virtual_dma_addr;
|
||||
static int virtual_dma_mode;
|
||||
static int doing_pdma;
|
||||
|
||||
static irqreturn_t floppy_hardint(int irq, void *dev_id)
|
||||
{
|
||||
register unsigned char st;
|
||||
|
||||
#undef TRACE_FLPY_INT
|
||||
|
||||
#ifdef TRACE_FLPY_INT
|
||||
static int calls=0;
|
||||
static int bytes=0;
|
||||
static int dma_wait=0;
|
||||
#endif
|
||||
if (!doing_pdma)
|
||||
return floppy_interrupt(irq, dev_id);
|
||||
|
||||
#ifdef TRACE_FLPY_INT
|
||||
if(!calls)
|
||||
bytes = virtual_dma_count;
|
||||
#endif
|
||||
|
||||
{
|
||||
register int lcount;
|
||||
register char *lptr;
|
||||
|
||||
st = 1;
|
||||
for(lcount=virtual_dma_count, lptr=virtual_dma_addr;
|
||||
lcount; lcount--, lptr++) {
|
||||
st=inb(virtual_dma_port+4) & 0xa0 ;
|
||||
if(st != 0xa0)
|
||||
break;
|
||||
if(virtual_dma_mode)
|
||||
outb_p(*lptr, virtual_dma_port+5);
|
||||
else
|
||||
*lptr = inb_p(virtual_dma_port+5);
|
||||
}
|
||||
virtual_dma_count = lcount;
|
||||
virtual_dma_addr = lptr;
|
||||
st = inb(virtual_dma_port+4);
|
||||
}
|
||||
|
||||
#ifdef TRACE_FLPY_INT
|
||||
calls++;
|
||||
#endif
|
||||
if(st == 0x20)
|
||||
return IRQ_HANDLED;
|
||||
if(!(st & 0x20)) {
|
||||
virtual_dma_residue += virtual_dma_count;
|
||||
virtual_dma_count=0;
|
||||
#ifdef TRACE_FLPY_INT
|
||||
printk("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n",
|
||||
virtual_dma_count, virtual_dma_residue, calls, bytes,
|
||||
dma_wait);
|
||||
calls = 0;
|
||||
dma_wait=0;
|
||||
#endif
|
||||
doing_pdma = 0;
|
||||
floppy_interrupt(irq, dev_id);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
#ifdef TRACE_FLPY_INT
|
||||
if(!virtual_dma_count)
|
||||
dma_wait++;
|
||||
#endif
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static void fd_disable_dma(void)
|
||||
{
|
||||
if(! (can_use_virtual_dma & 1))
|
||||
disable_dma(FLOPPY_DMA);
|
||||
doing_pdma = 0;
|
||||
virtual_dma_residue += virtual_dma_count;
|
||||
virtual_dma_count=0;
|
||||
}
|
||||
|
||||
static int vdma_request_dma(unsigned int dmanr, const char * device_id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void vdma_nop(unsigned int dummy)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
static int vdma_get_dma_residue(unsigned int dummy)
|
||||
{
|
||||
return virtual_dma_count + virtual_dma_residue;
|
||||
}
|
||||
|
||||
|
||||
static int fd_request_irq(void)
|
||||
{
|
||||
if(can_use_virtual_dma)
|
||||
return request_irq(FLOPPY_IRQ, floppy_hardint,
|
||||
IRQF_DISABLED, "floppy", NULL);
|
||||
else
|
||||
return request_irq(FLOPPY_IRQ, floppy_interrupt,
|
||||
IRQF_DISABLED, "floppy", NULL);
|
||||
}
|
||||
|
||||
static unsigned long dma_mem_alloc(unsigned long size)
|
||||
{
|
||||
return __get_dma_pages(GFP_KERNEL|__GFP_NORETRY,get_order(size));
|
||||
}
|
||||
|
||||
|
||||
static unsigned long vdma_mem_alloc(unsigned long size)
|
||||
{
|
||||
return (unsigned long) vmalloc(size);
|
||||
|
||||
}
|
||||
|
||||
#define nodma_mem_alloc(size) vdma_mem_alloc(size)
|
||||
|
||||
static void _fd_dma_mem_free(unsigned long addr, unsigned long size)
|
||||
{
|
||||
if((unsigned long) addr >= (unsigned long) high_memory)
|
||||
vfree((void *)addr);
|
||||
else
|
||||
free_pages(addr, get_order(size));
|
||||
}
|
||||
|
||||
#define fd_dma_mem_free(addr, size) _fd_dma_mem_free(addr, size)
|
||||
|
||||
static void _fd_chose_dma_mode(char *addr, unsigned long size)
|
||||
{
|
||||
if(can_use_virtual_dma == 2) {
|
||||
if((unsigned long) addr >= (unsigned long) high_memory ||
|
||||
isa_virt_to_bus(addr) >= 0x1000000 ||
|
||||
_CROSS_64KB(addr, size, 0))
|
||||
use_virtual_dma = 1;
|
||||
else
|
||||
use_virtual_dma = 0;
|
||||
} else {
|
||||
use_virtual_dma = can_use_virtual_dma & 1;
|
||||
}
|
||||
}
|
||||
|
||||
#define fd_chose_dma_mode(addr, size) _fd_chose_dma_mode(addr, size)
|
||||
|
||||
|
||||
static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io)
|
||||
{
|
||||
doing_pdma = 1;
|
||||
virtual_dma_port = io;
|
||||
virtual_dma_mode = (mode == DMA_MODE_WRITE);
|
||||
virtual_dma_addr = addr;
|
||||
virtual_dma_count = size;
|
||||
virtual_dma_residue = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
|
||||
{
|
||||
#ifdef FLOPPY_SANITY_CHECK
|
||||
if (CROSS_64KB(addr, size)) {
|
||||
printk("DMA crossing 64-K boundary %p-%p\n", addr, addr+size);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
/* actual, physical DMA */
|
||||
doing_pdma = 0;
|
||||
clear_dma_ff(FLOPPY_DMA);
|
||||
set_dma_mode(FLOPPY_DMA,mode);
|
||||
set_dma_addr(FLOPPY_DMA,isa_virt_to_bus(addr));
|
||||
set_dma_count(FLOPPY_DMA,size);
|
||||
enable_dma(FLOPPY_DMA);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct fd_routine_l {
|
||||
int (*_request_dma)(unsigned int dmanr, const char * device_id);
|
||||
void (*_free_dma)(unsigned int dmanr);
|
||||
int (*_get_dma_residue)(unsigned int dummy);
|
||||
unsigned long (*_dma_mem_alloc) (unsigned long size);
|
||||
int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
|
||||
} fd_routine[] = {
|
||||
{
|
||||
request_dma,
|
||||
free_dma,
|
||||
get_dma_residue,
|
||||
dma_mem_alloc,
|
||||
hard_dma_setup
|
||||
},
|
||||
{
|
||||
vdma_request_dma,
|
||||
vdma_nop,
|
||||
vdma_get_dma_residue,
|
||||
vdma_mem_alloc,
|
||||
vdma_dma_setup
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static int FDC1 = 0x3f0;
|
||||
static int FDC2 = -1;
|
||||
|
||||
/*
|
||||
* Floppy types are stored in the rtc's CMOS RAM and so rtc_lock
|
||||
* is needed to prevent corrupted CMOS RAM in case "insmod floppy"
|
||||
* coincides with another rtc CMOS user. Paul G.
|
||||
*/
|
||||
#define FLOPPY0_TYPE ({ \
|
||||
unsigned long flags; \
|
||||
unsigned char val; \
|
||||
spin_lock_irqsave(&rtc_lock, flags); \
|
||||
val = (CMOS_READ(0x10) >> 4) & 15; \
|
||||
spin_unlock_irqrestore(&rtc_lock, flags); \
|
||||
val; \
|
||||
})
|
||||
|
||||
#define FLOPPY1_TYPE ({ \
|
||||
unsigned long flags; \
|
||||
unsigned char val; \
|
||||
spin_lock_irqsave(&rtc_lock, flags); \
|
||||
val = CMOS_READ(0x10) & 15; \
|
||||
spin_unlock_irqrestore(&rtc_lock, flags); \
|
||||
val; \
|
||||
})
|
||||
|
||||
#define N_FDC 2
|
||||
#define N_DRIVE 8
|
||||
|
||||
#define EXTRA_FLOPPY_PARAMS
|
||||
|
||||
#endif /* _ASM_X86_FLOPPY_H */
|
||||
|
|
|
|||
|
|
@ -1,280 +0,0 @@
|
|||
/*
|
||||
* Architecture specific parts of the Floppy driver
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 1995
|
||||
*/
|
||||
#ifndef __ASM_I386_FLOPPY_H
|
||||
#define __ASM_I386_FLOPPY_H
|
||||
|
||||
#include <linux/vmalloc.h>
|
||||
|
||||
|
||||
/*
|
||||
* The DMA channel used by the floppy controller cannot access data at
|
||||
* addresses >= 16MB
|
||||
*
|
||||
* Went back to the 1MB limit, as some people had problems with the floppy
|
||||
* driver otherwise. It doesn't matter much for performance anyway, as most
|
||||
* floppy accesses go through the track buffer.
|
||||
*/
|
||||
#define _CROSS_64KB(a,s,vdma) \
|
||||
(!(vdma) && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64))
|
||||
|
||||
#define CROSS_64KB(a,s) _CROSS_64KB(a,s,use_virtual_dma & 1)
|
||||
|
||||
|
||||
#define SW fd_routine[use_virtual_dma&1]
|
||||
#define CSW fd_routine[can_use_virtual_dma & 1]
|
||||
|
||||
|
||||
#define fd_inb(port) inb_p(port)
|
||||
#define fd_outb(value,port) outb_p(value,port)
|
||||
|
||||
#define fd_request_dma() CSW._request_dma(FLOPPY_DMA,"floppy")
|
||||
#define fd_free_dma() CSW._free_dma(FLOPPY_DMA)
|
||||
#define fd_enable_irq() enable_irq(FLOPPY_IRQ)
|
||||
#define fd_disable_irq() disable_irq(FLOPPY_IRQ)
|
||||
#define fd_free_irq() free_irq(FLOPPY_IRQ, NULL)
|
||||
#define fd_get_dma_residue() SW._get_dma_residue(FLOPPY_DMA)
|
||||
#define fd_dma_mem_alloc(size) SW._dma_mem_alloc(size)
|
||||
#define fd_dma_setup(addr, size, mode, io) SW._dma_setup(addr, size, mode, io)
|
||||
|
||||
#define FLOPPY_CAN_FALLBACK_ON_NODMA
|
||||
|
||||
static int virtual_dma_count;
|
||||
static int virtual_dma_residue;
|
||||
static char *virtual_dma_addr;
|
||||
static int virtual_dma_mode;
|
||||
static int doing_pdma;
|
||||
|
||||
static irqreturn_t floppy_hardint(int irq, void *dev_id)
|
||||
{
|
||||
register unsigned char st;
|
||||
|
||||
#undef TRACE_FLPY_INT
|
||||
|
||||
#ifdef TRACE_FLPY_INT
|
||||
static int calls=0;
|
||||
static int bytes=0;
|
||||
static int dma_wait=0;
|
||||
#endif
|
||||
if (!doing_pdma)
|
||||
return floppy_interrupt(irq, dev_id);
|
||||
|
||||
#ifdef TRACE_FLPY_INT
|
||||
if(!calls)
|
||||
bytes = virtual_dma_count;
|
||||
#endif
|
||||
|
||||
{
|
||||
register int lcount;
|
||||
register char *lptr;
|
||||
|
||||
st = 1;
|
||||
for(lcount=virtual_dma_count, lptr=virtual_dma_addr;
|
||||
lcount; lcount--, lptr++) {
|
||||
st=inb(virtual_dma_port+4) & 0xa0 ;
|
||||
if(st != 0xa0)
|
||||
break;
|
||||
if(virtual_dma_mode)
|
||||
outb_p(*lptr, virtual_dma_port+5);
|
||||
else
|
||||
*lptr = inb_p(virtual_dma_port+5);
|
||||
}
|
||||
virtual_dma_count = lcount;
|
||||
virtual_dma_addr = lptr;
|
||||
st = inb(virtual_dma_port+4);
|
||||
}
|
||||
|
||||
#ifdef TRACE_FLPY_INT
|
||||
calls++;
|
||||
#endif
|
||||
if(st == 0x20)
|
||||
return IRQ_HANDLED;
|
||||
if(!(st & 0x20)) {
|
||||
virtual_dma_residue += virtual_dma_count;
|
||||
virtual_dma_count=0;
|
||||
#ifdef TRACE_FLPY_INT
|
||||
printk("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n",
|
||||
virtual_dma_count, virtual_dma_residue, calls, bytes,
|
||||
dma_wait);
|
||||
calls = 0;
|
||||
dma_wait=0;
|
||||
#endif
|
||||
doing_pdma = 0;
|
||||
floppy_interrupt(irq, dev_id);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
#ifdef TRACE_FLPY_INT
|
||||
if(!virtual_dma_count)
|
||||
dma_wait++;
|
||||
#endif
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static void fd_disable_dma(void)
|
||||
{
|
||||
if(! (can_use_virtual_dma & 1))
|
||||
disable_dma(FLOPPY_DMA);
|
||||
doing_pdma = 0;
|
||||
virtual_dma_residue += virtual_dma_count;
|
||||
virtual_dma_count=0;
|
||||
}
|
||||
|
||||
static int vdma_request_dma(unsigned int dmanr, const char * device_id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void vdma_nop(unsigned int dummy)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
static int vdma_get_dma_residue(unsigned int dummy)
|
||||
{
|
||||
return virtual_dma_count + virtual_dma_residue;
|
||||
}
|
||||
|
||||
|
||||
static int fd_request_irq(void)
|
||||
{
|
||||
if(can_use_virtual_dma)
|
||||
return request_irq(FLOPPY_IRQ, floppy_hardint,
|
||||
IRQF_DISABLED, "floppy", NULL);
|
||||
else
|
||||
return request_irq(FLOPPY_IRQ, floppy_interrupt,
|
||||
IRQF_DISABLED, "floppy", NULL);
|
||||
|
||||
}
|
||||
|
||||
static unsigned long dma_mem_alloc(unsigned long size)
|
||||
{
|
||||
return __get_dma_pages(GFP_KERNEL,get_order(size));
|
||||
}
|
||||
|
||||
|
||||
static unsigned long vdma_mem_alloc(unsigned long size)
|
||||
{
|
||||
return (unsigned long) vmalloc(size);
|
||||
|
||||
}
|
||||
|
||||
#define nodma_mem_alloc(size) vdma_mem_alloc(size)
|
||||
|
||||
static void _fd_dma_mem_free(unsigned long addr, unsigned long size)
|
||||
{
|
||||
if((unsigned int) addr >= (unsigned int) high_memory)
|
||||
vfree((void *)addr);
|
||||
else
|
||||
free_pages(addr, get_order(size));
|
||||
}
|
||||
|
||||
#define fd_dma_mem_free(addr, size) _fd_dma_mem_free(addr, size)
|
||||
|
||||
static void _fd_chose_dma_mode(char *addr, unsigned long size)
|
||||
{
|
||||
if(can_use_virtual_dma == 2) {
|
||||
if((unsigned int) addr >= (unsigned int) high_memory ||
|
||||
isa_virt_to_bus(addr) >= 0x1000000 ||
|
||||
_CROSS_64KB(addr, size, 0))
|
||||
use_virtual_dma = 1;
|
||||
else
|
||||
use_virtual_dma = 0;
|
||||
} else {
|
||||
use_virtual_dma = can_use_virtual_dma & 1;
|
||||
}
|
||||
}
|
||||
|
||||
#define fd_chose_dma_mode(addr, size) _fd_chose_dma_mode(addr, size)
|
||||
|
||||
|
||||
static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io)
|
||||
{
|
||||
doing_pdma = 1;
|
||||
virtual_dma_port = io;
|
||||
virtual_dma_mode = (mode == DMA_MODE_WRITE);
|
||||
virtual_dma_addr = addr;
|
||||
virtual_dma_count = size;
|
||||
virtual_dma_residue = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
|
||||
{
|
||||
#ifdef FLOPPY_SANITY_CHECK
|
||||
if (CROSS_64KB(addr, size)) {
|
||||
printk("DMA crossing 64-K boundary %p-%p\n", addr, addr+size);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
/* actual, physical DMA */
|
||||
doing_pdma = 0;
|
||||
clear_dma_ff(FLOPPY_DMA);
|
||||
set_dma_mode(FLOPPY_DMA,mode);
|
||||
set_dma_addr(FLOPPY_DMA,isa_virt_to_bus(addr));
|
||||
set_dma_count(FLOPPY_DMA,size);
|
||||
enable_dma(FLOPPY_DMA);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct fd_routine_l {
|
||||
int (*_request_dma)(unsigned int dmanr, const char * device_id);
|
||||
void (*_free_dma)(unsigned int dmanr);
|
||||
int (*_get_dma_residue)(unsigned int dummy);
|
||||
unsigned long (*_dma_mem_alloc) (unsigned long size);
|
||||
int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
|
||||
} fd_routine[] = {
|
||||
{
|
||||
request_dma,
|
||||
free_dma,
|
||||
get_dma_residue,
|
||||
dma_mem_alloc,
|
||||
hard_dma_setup
|
||||
},
|
||||
{
|
||||
vdma_request_dma,
|
||||
vdma_nop,
|
||||
vdma_get_dma_residue,
|
||||
vdma_mem_alloc,
|
||||
vdma_dma_setup
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static int FDC1 = 0x3f0;
|
||||
static int FDC2 = -1;
|
||||
|
||||
/*
|
||||
* Floppy types are stored in the rtc's CMOS RAM and so rtc_lock
|
||||
* is needed to prevent corrupted CMOS RAM in case "insmod floppy"
|
||||
* coincides with another rtc CMOS user. Paul G.
|
||||
*/
|
||||
#define FLOPPY0_TYPE ({ \
|
||||
unsigned long flags; \
|
||||
unsigned char val; \
|
||||
spin_lock_irqsave(&rtc_lock, flags); \
|
||||
val = (CMOS_READ(0x10) >> 4) & 15; \
|
||||
spin_unlock_irqrestore(&rtc_lock, flags); \
|
||||
val; \
|
||||
})
|
||||
|
||||
#define FLOPPY1_TYPE ({ \
|
||||
unsigned long flags; \
|
||||
unsigned char val; \
|
||||
spin_lock_irqsave(&rtc_lock, flags); \
|
||||
val = CMOS_READ(0x10) & 15; \
|
||||
spin_unlock_irqrestore(&rtc_lock, flags); \
|
||||
val; \
|
||||
})
|
||||
|
||||
#define N_FDC 2
|
||||
#define N_DRIVE 8
|
||||
|
||||
#define EXTRA_FLOPPY_PARAMS
|
||||
|
||||
#endif /* __ASM_I386_FLOPPY_H */
|
||||
|
|
@ -1,279 +0,0 @@
|
|||
/*
|
||||
* Architecture specific parts of the Floppy driver
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 1995
|
||||
*/
|
||||
#ifndef __ASM_X86_64_FLOPPY_H
|
||||
#define __ASM_X86_64_FLOPPY_H
|
||||
|
||||
#include <linux/vmalloc.h>
|
||||
|
||||
|
||||
/*
|
||||
* The DMA channel used by the floppy controller cannot access data at
|
||||
* addresses >= 16MB
|
||||
*
|
||||
* Went back to the 1MB limit, as some people had problems with the floppy
|
||||
* driver otherwise. It doesn't matter much for performance anyway, as most
|
||||
* floppy accesses go through the track buffer.
|
||||
*/
|
||||
#define _CROSS_64KB(a,s,vdma) \
|
||||
(!(vdma) && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64))
|
||||
|
||||
#define CROSS_64KB(a,s) _CROSS_64KB(a,s,use_virtual_dma & 1)
|
||||
|
||||
|
||||
#define SW fd_routine[use_virtual_dma&1]
|
||||
#define CSW fd_routine[can_use_virtual_dma & 1]
|
||||
|
||||
|
||||
#define fd_inb(port) inb_p(port)
|
||||
#define fd_outb(value,port) outb_p(value,port)
|
||||
|
||||
#define fd_request_dma() CSW._request_dma(FLOPPY_DMA,"floppy")
|
||||
#define fd_free_dma() CSW._free_dma(FLOPPY_DMA)
|
||||
#define fd_enable_irq() enable_irq(FLOPPY_IRQ)
|
||||
#define fd_disable_irq() disable_irq(FLOPPY_IRQ)
|
||||
#define fd_free_irq() free_irq(FLOPPY_IRQ, NULL)
|
||||
#define fd_get_dma_residue() SW._get_dma_residue(FLOPPY_DMA)
|
||||
#define fd_dma_mem_alloc(size) SW._dma_mem_alloc(size)
|
||||
#define fd_dma_setup(addr, size, mode, io) SW._dma_setup(addr, size, mode, io)
|
||||
|
||||
#define FLOPPY_CAN_FALLBACK_ON_NODMA
|
||||
|
||||
static int virtual_dma_count;
|
||||
static int virtual_dma_residue;
|
||||
static char *virtual_dma_addr;
|
||||
static int virtual_dma_mode;
|
||||
static int doing_pdma;
|
||||
|
||||
static irqreturn_t floppy_hardint(int irq, void *dev_id)
|
||||
{
|
||||
register unsigned char st;
|
||||
|
||||
#undef TRACE_FLPY_INT
|
||||
|
||||
#ifdef TRACE_FLPY_INT
|
||||
static int calls=0;
|
||||
static int bytes=0;
|
||||
static int dma_wait=0;
|
||||
#endif
|
||||
if (!doing_pdma)
|
||||
return floppy_interrupt(irq, dev_id);
|
||||
|
||||
#ifdef TRACE_FLPY_INT
|
||||
if(!calls)
|
||||
bytes = virtual_dma_count;
|
||||
#endif
|
||||
|
||||
{
|
||||
register int lcount;
|
||||
register char *lptr;
|
||||
|
||||
st = 1;
|
||||
for(lcount=virtual_dma_count, lptr=virtual_dma_addr;
|
||||
lcount; lcount--, lptr++) {
|
||||
st=inb(virtual_dma_port+4) & 0xa0 ;
|
||||
if(st != 0xa0)
|
||||
break;
|
||||
if(virtual_dma_mode)
|
||||
outb_p(*lptr, virtual_dma_port+5);
|
||||
else
|
||||
*lptr = inb_p(virtual_dma_port+5);
|
||||
}
|
||||
virtual_dma_count = lcount;
|
||||
virtual_dma_addr = lptr;
|
||||
st = inb(virtual_dma_port+4);
|
||||
}
|
||||
|
||||
#ifdef TRACE_FLPY_INT
|
||||
calls++;
|
||||
#endif
|
||||
if(st == 0x20)
|
||||
return IRQ_HANDLED;
|
||||
if(!(st & 0x20)) {
|
||||
virtual_dma_residue += virtual_dma_count;
|
||||
virtual_dma_count=0;
|
||||
#ifdef TRACE_FLPY_INT
|
||||
printk("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n",
|
||||
virtual_dma_count, virtual_dma_residue, calls, bytes,
|
||||
dma_wait);
|
||||
calls = 0;
|
||||
dma_wait=0;
|
||||
#endif
|
||||
doing_pdma = 0;
|
||||
floppy_interrupt(irq, dev_id);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
#ifdef TRACE_FLPY_INT
|
||||
if(!virtual_dma_count)
|
||||
dma_wait++;
|
||||
#endif
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static void fd_disable_dma(void)
|
||||
{
|
||||
if(! (can_use_virtual_dma & 1))
|
||||
disable_dma(FLOPPY_DMA);
|
||||
doing_pdma = 0;
|
||||
virtual_dma_residue += virtual_dma_count;
|
||||
virtual_dma_count=0;
|
||||
}
|
||||
|
||||
static int vdma_request_dma(unsigned int dmanr, const char * device_id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void vdma_nop(unsigned int dummy)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
static int vdma_get_dma_residue(unsigned int dummy)
|
||||
{
|
||||
return virtual_dma_count + virtual_dma_residue;
|
||||
}
|
||||
|
||||
|
||||
static int fd_request_irq(void)
|
||||
{
|
||||
if(can_use_virtual_dma)
|
||||
return request_irq(FLOPPY_IRQ, floppy_hardint,
|
||||
IRQF_DISABLED, "floppy", NULL);
|
||||
else
|
||||
return request_irq(FLOPPY_IRQ, floppy_interrupt,
|
||||
IRQF_DISABLED, "floppy", NULL);
|
||||
}
|
||||
|
||||
static unsigned long dma_mem_alloc(unsigned long size)
|
||||
{
|
||||
return __get_dma_pages(GFP_KERNEL|__GFP_NORETRY,get_order(size));
|
||||
}
|
||||
|
||||
|
||||
static unsigned long vdma_mem_alloc(unsigned long size)
|
||||
{
|
||||
return (unsigned long) vmalloc(size);
|
||||
|
||||
}
|
||||
|
||||
#define nodma_mem_alloc(size) vdma_mem_alloc(size)
|
||||
|
||||
static void _fd_dma_mem_free(unsigned long addr, unsigned long size)
|
||||
{
|
||||
if((unsigned long) addr >= (unsigned long) high_memory)
|
||||
vfree((void *)addr);
|
||||
else
|
||||
free_pages(addr, get_order(size));
|
||||
}
|
||||
|
||||
#define fd_dma_mem_free(addr, size) _fd_dma_mem_free(addr, size)
|
||||
|
||||
static void _fd_chose_dma_mode(char *addr, unsigned long size)
|
||||
{
|
||||
if(can_use_virtual_dma == 2) {
|
||||
if((unsigned long) addr >= (unsigned long) high_memory ||
|
||||
isa_virt_to_bus(addr) >= 0x1000000 ||
|
||||
_CROSS_64KB(addr, size, 0))
|
||||
use_virtual_dma = 1;
|
||||
else
|
||||
use_virtual_dma = 0;
|
||||
} else {
|
||||
use_virtual_dma = can_use_virtual_dma & 1;
|
||||
}
|
||||
}
|
||||
|
||||
#define fd_chose_dma_mode(addr, size) _fd_chose_dma_mode(addr, size)
|
||||
|
||||
|
||||
static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io)
|
||||
{
|
||||
doing_pdma = 1;
|
||||
virtual_dma_port = io;
|
||||
virtual_dma_mode = (mode == DMA_MODE_WRITE);
|
||||
virtual_dma_addr = addr;
|
||||
virtual_dma_count = size;
|
||||
virtual_dma_residue = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
|
||||
{
|
||||
#ifdef FLOPPY_SANITY_CHECK
|
||||
if (CROSS_64KB(addr, size)) {
|
||||
printk("DMA crossing 64-K boundary %p-%p\n", addr, addr+size);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
/* actual, physical DMA */
|
||||
doing_pdma = 0;
|
||||
clear_dma_ff(FLOPPY_DMA);
|
||||
set_dma_mode(FLOPPY_DMA,mode);
|
||||
set_dma_addr(FLOPPY_DMA,isa_virt_to_bus(addr));
|
||||
set_dma_count(FLOPPY_DMA,size);
|
||||
enable_dma(FLOPPY_DMA);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct fd_routine_l {
|
||||
int (*_request_dma)(unsigned int dmanr, const char * device_id);
|
||||
void (*_free_dma)(unsigned int dmanr);
|
||||
int (*_get_dma_residue)(unsigned int dummy);
|
||||
unsigned long (*_dma_mem_alloc) (unsigned long size);
|
||||
int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
|
||||
} fd_routine[] = {
|
||||
{
|
||||
request_dma,
|
||||
free_dma,
|
||||
get_dma_residue,
|
||||
dma_mem_alloc,
|
||||
hard_dma_setup
|
||||
},
|
||||
{
|
||||
vdma_request_dma,
|
||||
vdma_nop,
|
||||
vdma_get_dma_residue,
|
||||
vdma_mem_alloc,
|
||||
vdma_dma_setup
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static int FDC1 = 0x3f0;
|
||||
static int FDC2 = -1;
|
||||
|
||||
/*
|
||||
* Floppy types are stored in the rtc's CMOS RAM and so rtc_lock
|
||||
* is needed to prevent corrupted CMOS RAM in case "insmod floppy"
|
||||
* coincides with another rtc CMOS user. Paul G.
|
||||
*/
|
||||
#define FLOPPY0_TYPE ({ \
|
||||
unsigned long flags; \
|
||||
unsigned char val; \
|
||||
spin_lock_irqsave(&rtc_lock, flags); \
|
||||
val = (CMOS_READ(0x10) >> 4) & 15; \
|
||||
spin_unlock_irqrestore(&rtc_lock, flags); \
|
||||
val; \
|
||||
})
|
||||
|
||||
#define FLOPPY1_TYPE ({ \
|
||||
unsigned long flags; \
|
||||
unsigned char val; \
|
||||
spin_lock_irqsave(&rtc_lock, flags); \
|
||||
val = CMOS_READ(0x10) & 15; \
|
||||
spin_unlock_irqrestore(&rtc_lock, flags); \
|
||||
val; \
|
||||
})
|
||||
|
||||
#define N_FDC 2
|
||||
#define N_DRIVE 8
|
||||
|
||||
#define EXTRA_FLOPPY_PARAMS
|
||||
|
||||
#endif /* __ASM_X86_64_FLOPPY_H */
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
#ifdef __ASSEMBLY__
|
||||
|
||||
#include <asm/dwarf2.h>
|
||||
|
||||
/* The annotation hides the frame from the unwinder and makes it look
|
||||
|
|
@ -21,3 +23,5 @@
|
|||
.macro ENDFRAME
|
||||
.endm
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
|
@ -10,10 +10,14 @@ typedef struct {
|
|||
unsigned int __nmi_count; /* arch dependent */
|
||||
unsigned int apic_timer_irqs; /* arch dependent */
|
||||
unsigned int irq0_irqs;
|
||||
unsigned int irq_resched_count;
|
||||
unsigned int irq_call_count;
|
||||
unsigned int irq_tlb_count;
|
||||
unsigned int irq_thermal_count;
|
||||
unsigned int irq_spurious_count;
|
||||
} ____cacheline_aligned irq_cpustat_t;
|
||||
|
||||
DECLARE_PER_CPU(irq_cpustat_t, irq_stat);
|
||||
extern irq_cpustat_t irq_stat[];
|
||||
|
||||
#define __ARCH_IRQ_STAT
|
||||
#define __IRQ_STAT(cpu, member) (per_cpu(irq_stat, cpu).member)
|
||||
|
|
|
|||
|
|
@ -40,22 +40,22 @@
|
|||
/*
|
||||
* Vectors 0x30-0x3f are used for ISA interrupts.
|
||||
*/
|
||||
#define IRQ0_VECTOR FIRST_EXTERNAL_VECTOR + 0x10
|
||||
#define IRQ1_VECTOR IRQ0_VECTOR + 1
|
||||
#define IRQ2_VECTOR IRQ0_VECTOR + 2
|
||||
#define IRQ3_VECTOR IRQ0_VECTOR + 3
|
||||
#define IRQ4_VECTOR IRQ0_VECTOR + 4
|
||||
#define IRQ5_VECTOR IRQ0_VECTOR + 5
|
||||
#define IRQ6_VECTOR IRQ0_VECTOR + 6
|
||||
#define IRQ7_VECTOR IRQ0_VECTOR + 7
|
||||
#define IRQ8_VECTOR IRQ0_VECTOR + 8
|
||||
#define IRQ9_VECTOR IRQ0_VECTOR + 9
|
||||
#define IRQ10_VECTOR IRQ0_VECTOR + 10
|
||||
#define IRQ11_VECTOR IRQ0_VECTOR + 11
|
||||
#define IRQ12_VECTOR IRQ0_VECTOR + 12
|
||||
#define IRQ13_VECTOR IRQ0_VECTOR + 13
|
||||
#define IRQ14_VECTOR IRQ0_VECTOR + 14
|
||||
#define IRQ15_VECTOR IRQ0_VECTOR + 15
|
||||
#define IRQ0_VECTOR (FIRST_EXTERNAL_VECTOR + 0x10)
|
||||
#define IRQ1_VECTOR (IRQ0_VECTOR + 1)
|
||||
#define IRQ2_VECTOR (IRQ0_VECTOR + 2)
|
||||
#define IRQ3_VECTOR (IRQ0_VECTOR + 3)
|
||||
#define IRQ4_VECTOR (IRQ0_VECTOR + 4)
|
||||
#define IRQ5_VECTOR (IRQ0_VECTOR + 5)
|
||||
#define IRQ6_VECTOR (IRQ0_VECTOR + 6)
|
||||
#define IRQ7_VECTOR (IRQ0_VECTOR + 7)
|
||||
#define IRQ8_VECTOR (IRQ0_VECTOR + 8)
|
||||
#define IRQ9_VECTOR (IRQ0_VECTOR + 9)
|
||||
#define IRQ10_VECTOR (IRQ0_VECTOR + 10)
|
||||
#define IRQ11_VECTOR (IRQ0_VECTOR + 11)
|
||||
#define IRQ12_VECTOR (IRQ0_VECTOR + 12)
|
||||
#define IRQ13_VECTOR (IRQ0_VECTOR + 13)
|
||||
#define IRQ14_VECTOR (IRQ0_VECTOR + 14)
|
||||
#define IRQ15_VECTOR (IRQ0_VECTOR + 15)
|
||||
|
||||
/*
|
||||
* Special IRQ vectors used by the SMP architecture, 0xf0-0xff
|
||||
|
|
@ -148,9 +148,6 @@ extern atomic_t irq_mis_count;
|
|||
|
||||
#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
|
||||
|
||||
#define __STR(x) #x
|
||||
#define STR(x) __STR(x)
|
||||
|
||||
#include <asm/ptrace.h>
|
||||
|
||||
#define IRQ_NAME2(nr) nr##_interrupt(void)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,31 @@
|
|||
#ifdef CONFIG_X86_32
|
||||
# include "intel_arch_perfmon_32.h"
|
||||
#else
|
||||
# include "intel_arch_perfmon_64.h"
|
||||
#endif
|
||||
#ifndef _ASM_X86_INTEL_ARCH_PERFMON_H
|
||||
#define _ASM_X86_INTEL_ARCH_PERFMON_H
|
||||
|
||||
#define MSR_ARCH_PERFMON_PERFCTR0 0xc1
|
||||
#define MSR_ARCH_PERFMON_PERFCTR1 0xc2
|
||||
|
||||
#define MSR_ARCH_PERFMON_EVENTSEL0 0x186
|
||||
#define MSR_ARCH_PERFMON_EVENTSEL1 0x187
|
||||
|
||||
#define ARCH_PERFMON_EVENTSEL0_ENABLE (1 << 22)
|
||||
#define ARCH_PERFMON_EVENTSEL_INT (1 << 20)
|
||||
#define ARCH_PERFMON_EVENTSEL_OS (1 << 17)
|
||||
#define ARCH_PERFMON_EVENTSEL_USR (1 << 16)
|
||||
|
||||
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL (0x3c)
|
||||
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8)
|
||||
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX (0)
|
||||
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT \
|
||||
(1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX))
|
||||
|
||||
union cpuid10_eax {
|
||||
struct {
|
||||
unsigned int version_id:8;
|
||||
unsigned int num_counters:8;
|
||||
unsigned int bit_width:8;
|
||||
unsigned int mask_length:8;
|
||||
} split;
|
||||
unsigned int full;
|
||||
};
|
||||
|
||||
#endif /* _ASM_X86_INTEL_ARCH_PERFMON_H */
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
#ifndef X86_INTEL_ARCH_PERFMON_H
|
||||
#define X86_INTEL_ARCH_PERFMON_H 1
|
||||
|
||||
#define MSR_ARCH_PERFMON_PERFCTR0 0xc1
|
||||
#define MSR_ARCH_PERFMON_PERFCTR1 0xc2
|
||||
|
||||
#define MSR_ARCH_PERFMON_EVENTSEL0 0x186
|
||||
#define MSR_ARCH_PERFMON_EVENTSEL1 0x187
|
||||
|
||||
#define ARCH_PERFMON_EVENTSEL0_ENABLE (1 << 22)
|
||||
#define ARCH_PERFMON_EVENTSEL_INT (1 << 20)
|
||||
#define ARCH_PERFMON_EVENTSEL_OS (1 << 17)
|
||||
#define ARCH_PERFMON_EVENTSEL_USR (1 << 16)
|
||||
|
||||
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL (0x3c)
|
||||
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8)
|
||||
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX (0)
|
||||
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT \
|
||||
(1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX))
|
||||
|
||||
union cpuid10_eax {
|
||||
struct {
|
||||
unsigned int version_id:8;
|
||||
unsigned int num_counters:8;
|
||||
unsigned int bit_width:8;
|
||||
unsigned int mask_length:8;
|
||||
} split;
|
||||
unsigned int full;
|
||||
};
|
||||
|
||||
#endif /* X86_INTEL_ARCH_PERFMON_H */
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
#ifndef X86_64_INTEL_ARCH_PERFMON_H
|
||||
#define X86_64_INTEL_ARCH_PERFMON_H 1
|
||||
|
||||
#define MSR_ARCH_PERFMON_PERFCTR0 0xc1
|
||||
#define MSR_ARCH_PERFMON_PERFCTR1 0xc2
|
||||
|
||||
#define MSR_ARCH_PERFMON_EVENTSEL0 0x186
|
||||
#define MSR_ARCH_PERFMON_EVENTSEL1 0x187
|
||||
|
||||
#define ARCH_PERFMON_EVENTSEL0_ENABLE (1 << 22)
|
||||
#define ARCH_PERFMON_EVENTSEL_INT (1 << 20)
|
||||
#define ARCH_PERFMON_EVENTSEL_OS (1 << 17)
|
||||
#define ARCH_PERFMON_EVENTSEL_USR (1 << 16)
|
||||
|
||||
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL (0x3c)
|
||||
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8)
|
||||
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX (0)
|
||||
#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT \
|
||||
(1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX))
|
||||
|
||||
union cpuid10_eax {
|
||||
struct {
|
||||
unsigned int version_id:8;
|
||||
unsigned int num_counters:8;
|
||||
unsigned int bit_width:8;
|
||||
unsigned int mask_length:8;
|
||||
} split;
|
||||
unsigned int full;
|
||||
};
|
||||
|
||||
#endif /* X86_64_INTEL_ARCH_PERFMON_H */
|
||||
|
|
@ -199,17 +199,22 @@ static inline void writel(unsigned int b, volatile void __iomem *addr)
|
|||
|
||||
#define mmiowb()
|
||||
|
||||
static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count)
|
||||
static inline void
|
||||
memset_io(volatile void __iomem *addr, unsigned char val, int count)
|
||||
{
|
||||
memset((void __force *) addr, val, count);
|
||||
memset((void __force *)addr, val, count);
|
||||
}
|
||||
static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
|
||||
|
||||
static inline void
|
||||
memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
|
||||
{
|
||||
__memcpy(dst, (void __force *) src, count);
|
||||
__memcpy(dst, (const void __force *)src, count);
|
||||
}
|
||||
static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int count)
|
||||
|
||||
static inline void
|
||||
memcpy_toio(volatile void __iomem *dst, const void *src, int count)
|
||||
{
|
||||
__memcpy((void __force *) dst, src, count);
|
||||
__memcpy((void __force *)dst, src, count);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,13 +1,87 @@
|
|||
#ifdef __KERNEL__
|
||||
# ifdef CONFIG_X86_32
|
||||
# include "ioctls_32.h"
|
||||
# else
|
||||
# include "ioctls_64.h"
|
||||
# endif
|
||||
#else
|
||||
# ifdef __i386__
|
||||
# include "ioctls_32.h"
|
||||
# else
|
||||
# include "ioctls_64.h"
|
||||
# endif
|
||||
#ifndef _ASM_X86_IOCTLS_H
|
||||
#define _ASM_X86_IOCTLS_H
|
||||
|
||||
#include <asm/ioctl.h>
|
||||
|
||||
/* 0x54 is just a magic number to make these relatively unique ('T') */
|
||||
|
||||
#define TCGETS 0x5401
|
||||
#define TCSETS 0x5402 /* Clashes with SNDCTL_TMR_START sound ioctl */
|
||||
#define TCSETSW 0x5403
|
||||
#define TCSETSF 0x5404
|
||||
#define TCGETA 0x5405
|
||||
#define TCSETA 0x5406
|
||||
#define TCSETAW 0x5407
|
||||
#define TCSETAF 0x5408
|
||||
#define TCSBRK 0x5409
|
||||
#define TCXONC 0x540A
|
||||
#define TCFLSH 0x540B
|
||||
#define TIOCEXCL 0x540C
|
||||
#define TIOCNXCL 0x540D
|
||||
#define TIOCSCTTY 0x540E
|
||||
#define TIOCGPGRP 0x540F
|
||||
#define TIOCSPGRP 0x5410
|
||||
#define TIOCOUTQ 0x5411
|
||||
#define TIOCSTI 0x5412
|
||||
#define TIOCGWINSZ 0x5413
|
||||
#define TIOCSWINSZ 0x5414
|
||||
#define TIOCMGET 0x5415
|
||||
#define TIOCMBIS 0x5416
|
||||
#define TIOCMBIC 0x5417
|
||||
#define TIOCMSET 0x5418
|
||||
#define TIOCGSOFTCAR 0x5419
|
||||
#define TIOCSSOFTCAR 0x541A
|
||||
#define FIONREAD 0x541B
|
||||
#define TIOCINQ FIONREAD
|
||||
#define TIOCLINUX 0x541C
|
||||
#define TIOCCONS 0x541D
|
||||
#define TIOCGSERIAL 0x541E
|
||||
#define TIOCSSERIAL 0x541F
|
||||
#define TIOCPKT 0x5420
|
||||
#define FIONBIO 0x5421
|
||||
#define TIOCNOTTY 0x5422
|
||||
#define TIOCSETD 0x5423
|
||||
#define TIOCGETD 0x5424
|
||||
#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
|
||||
/* #define TIOCTTYGSTRUCT 0x5426 - Former debugging-only ioctl */
|
||||
#define TIOCSBRK 0x5427 /* BSD compatibility */
|
||||
#define TIOCCBRK 0x5428 /* BSD compatibility */
|
||||
#define TIOCGSID 0x5429 /* Return the session ID of FD */
|
||||
#define TCGETS2 _IOR('T',0x2A, struct termios2)
|
||||
#define TCSETS2 _IOW('T',0x2B, struct termios2)
|
||||
#define TCSETSW2 _IOW('T',0x2C, struct termios2)
|
||||
#define TCSETSF2 _IOW('T',0x2D, struct termios2)
|
||||
#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
|
||||
#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
|
||||
|
||||
#define FIONCLEX 0x5450
|
||||
#define FIOCLEX 0x5451
|
||||
#define FIOASYNC 0x5452
|
||||
#define TIOCSERCONFIG 0x5453
|
||||
#define TIOCSERGWILD 0x5454
|
||||
#define TIOCSERSWILD 0x5455
|
||||
#define TIOCGLCKTRMIOS 0x5456
|
||||
#define TIOCSLCKTRMIOS 0x5457
|
||||
#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
|
||||
#define TIOCSERGETLSR 0x5459 /* Get line status register */
|
||||
#define TIOCSERGETMULTI 0x545A /* Get multiport config */
|
||||
#define TIOCSERSETMULTI 0x545B /* Set multiport config */
|
||||
|
||||
#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
|
||||
#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
|
||||
#define TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */
|
||||
#define TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */
|
||||
#define FIOQSIZE 0x5460
|
||||
|
||||
/* Used for packet mode */
|
||||
#define TIOCPKT_DATA 0
|
||||
#define TIOCPKT_FLUSHREAD 1
|
||||
#define TIOCPKT_FLUSHWRITE 2
|
||||
#define TIOCPKT_STOP 4
|
||||
#define TIOCPKT_START 8
|
||||
#define TIOCPKT_NOSTOP 16
|
||||
#define TIOCPKT_DOSTOP 32
|
||||
|
||||
#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,87 +0,0 @@
|
|||
#ifndef __ARCH_I386_IOCTLS_H__
|
||||
#define __ARCH_I386_IOCTLS_H__
|
||||
|
||||
#include <asm/ioctl.h>
|
||||
|
||||
/* 0x54 is just a magic number to make these relatively unique ('T') */
|
||||
|
||||
#define TCGETS 0x5401
|
||||
#define TCSETS 0x5402 /* Clashes with SNDCTL_TMR_START sound ioctl */
|
||||
#define TCSETSW 0x5403
|
||||
#define TCSETSF 0x5404
|
||||
#define TCGETA 0x5405
|
||||
#define TCSETA 0x5406
|
||||
#define TCSETAW 0x5407
|
||||
#define TCSETAF 0x5408
|
||||
#define TCSBRK 0x5409
|
||||
#define TCXONC 0x540A
|
||||
#define TCFLSH 0x540B
|
||||
#define TIOCEXCL 0x540C
|
||||
#define TIOCNXCL 0x540D
|
||||
#define TIOCSCTTY 0x540E
|
||||
#define TIOCGPGRP 0x540F
|
||||
#define TIOCSPGRP 0x5410
|
||||
#define TIOCOUTQ 0x5411
|
||||
#define TIOCSTI 0x5412
|
||||
#define TIOCGWINSZ 0x5413
|
||||
#define TIOCSWINSZ 0x5414
|
||||
#define TIOCMGET 0x5415
|
||||
#define TIOCMBIS 0x5416
|
||||
#define TIOCMBIC 0x5417
|
||||
#define TIOCMSET 0x5418
|
||||
#define TIOCGSOFTCAR 0x5419
|
||||
#define TIOCSSOFTCAR 0x541A
|
||||
#define FIONREAD 0x541B
|
||||
#define TIOCINQ FIONREAD
|
||||
#define TIOCLINUX 0x541C
|
||||
#define TIOCCONS 0x541D
|
||||
#define TIOCGSERIAL 0x541E
|
||||
#define TIOCSSERIAL 0x541F
|
||||
#define TIOCPKT 0x5420
|
||||
#define FIONBIO 0x5421
|
||||
#define TIOCNOTTY 0x5422
|
||||
#define TIOCSETD 0x5423
|
||||
#define TIOCGETD 0x5424
|
||||
#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
|
||||
/* #define TIOCTTYGSTRUCT 0x5426 - Former debugging-only ioctl */
|
||||
#define TIOCSBRK 0x5427 /* BSD compatibility */
|
||||
#define TIOCCBRK 0x5428 /* BSD compatibility */
|
||||
#define TIOCGSID 0x5429 /* Return the session ID of FD */
|
||||
#define TCGETS2 _IOR('T',0x2A, struct termios2)
|
||||
#define TCSETS2 _IOW('T',0x2B, struct termios2)
|
||||
#define TCSETSW2 _IOW('T',0x2C, struct termios2)
|
||||
#define TCSETSF2 _IOW('T',0x2D, struct termios2)
|
||||
#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
|
||||
#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
|
||||
|
||||
#define FIONCLEX 0x5450
|
||||
#define FIOCLEX 0x5451
|
||||
#define FIOASYNC 0x5452
|
||||
#define TIOCSERCONFIG 0x5453
|
||||
#define TIOCSERGWILD 0x5454
|
||||
#define TIOCSERSWILD 0x5455
|
||||
#define TIOCGLCKTRMIOS 0x5456
|
||||
#define TIOCSLCKTRMIOS 0x5457
|
||||
#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
|
||||
#define TIOCSERGETLSR 0x5459 /* Get line status register */
|
||||
#define TIOCSERGETMULTI 0x545A /* Get multiport config */
|
||||
#define TIOCSERSETMULTI 0x545B /* Set multiport config */
|
||||
|
||||
#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
|
||||
#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
|
||||
#define TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */
|
||||
#define TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */
|
||||
#define FIOQSIZE 0x5460
|
||||
|
||||
/* Used for packet mode */
|
||||
#define TIOCPKT_DATA 0
|
||||
#define TIOCPKT_FLUSHREAD 1
|
||||
#define TIOCPKT_FLUSHWRITE 2
|
||||
#define TIOCPKT_STOP 4
|
||||
#define TIOCPKT_START 8
|
||||
#define TIOCPKT_NOSTOP 16
|
||||
#define TIOCPKT_DOSTOP 32
|
||||
|
||||
#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
#ifndef __ARCH_X8664_IOCTLS_H__
|
||||
#define __ARCH_X8664_IOCTLS_H__
|
||||
|
||||
#include <asm/ioctl.h>
|
||||
|
||||
/* 0x54 is just a magic number to make these relatively unique ('T') */
|
||||
|
||||
#define TCGETS 0x5401
|
||||
#define TCSETS 0x5402
|
||||
#define TCSETSW 0x5403
|
||||
#define TCSETSF 0x5404
|
||||
#define TCGETA 0x5405
|
||||
#define TCSETA 0x5406
|
||||
#define TCSETAW 0x5407
|
||||
#define TCSETAF 0x5408
|
||||
#define TCSBRK 0x5409
|
||||
#define TCXONC 0x540A
|
||||
#define TCFLSH 0x540B
|
||||
#define TIOCEXCL 0x540C
|
||||
#define TIOCNXCL 0x540D
|
||||
#define TIOCSCTTY 0x540E
|
||||
#define TIOCGPGRP 0x540F
|
||||
#define TIOCSPGRP 0x5410
|
||||
#define TIOCOUTQ 0x5411
|
||||
#define TIOCSTI 0x5412
|
||||
#define TIOCGWINSZ 0x5413
|
||||
#define TIOCSWINSZ 0x5414
|
||||
#define TIOCMGET 0x5415
|
||||
#define TIOCMBIS 0x5416
|
||||
#define TIOCMBIC 0x5417
|
||||
#define TIOCMSET 0x5418
|
||||
#define TIOCGSOFTCAR 0x5419
|
||||
#define TIOCSSOFTCAR 0x541A
|
||||
#define FIONREAD 0x541B
|
||||
#define TIOCINQ FIONREAD
|
||||
#define TIOCLINUX 0x541C
|
||||
#define TIOCCONS 0x541D
|
||||
#define TIOCGSERIAL 0x541E
|
||||
#define TIOCSSERIAL 0x541F
|
||||
#define TIOCPKT 0x5420
|
||||
#define FIONBIO 0x5421
|
||||
#define TIOCNOTTY 0x5422
|
||||
#define TIOCSETD 0x5423
|
||||
#define TIOCGETD 0x5424
|
||||
#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
|
||||
#define TIOCSBRK 0x5427 /* BSD compatibility */
|
||||
#define TIOCCBRK 0x5428 /* BSD compatibility */
|
||||
#define TIOCGSID 0x5429 /* Return the session ID of FD */
|
||||
#define TCGETS2 _IOR('T',0x2A, struct termios2)
|
||||
#define TCSETS2 _IOW('T',0x2B, struct termios2)
|
||||
#define TCSETSW2 _IOW('T',0x2C, struct termios2)
|
||||
#define TCSETSF2 _IOW('T',0x2D, struct termios2)
|
||||
#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
|
||||
#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
|
||||
|
||||
#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
|
||||
#define FIOCLEX 0x5451
|
||||
#define FIOASYNC 0x5452
|
||||
#define TIOCSERCONFIG 0x5453
|
||||
#define TIOCSERGWILD 0x5454
|
||||
#define TIOCSERSWILD 0x5455
|
||||
#define TIOCGLCKTRMIOS 0x5456
|
||||
#define TIOCSLCKTRMIOS 0x5457
|
||||
#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
|
||||
#define TIOCSERGETLSR 0x5459 /* Get line status register */
|
||||
#define TIOCSERGETMULTI 0x545A /* Get multiport config */
|
||||
#define TIOCSERSETMULTI 0x545B /* Set multiport config */
|
||||
|
||||
#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
|
||||
#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
|
||||
#define TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */
|
||||
#define TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */
|
||||
#define FIOQSIZE 0x5460
|
||||
|
||||
/* Used for packet mode */
|
||||
#define TIOCPKT_DATA 0
|
||||
#define TIOCPKT_FLUSHREAD 1
|
||||
#define TIOCPKT_FLUSHWRITE 2
|
||||
#define TIOCPKT_STOP 4
|
||||
#define TIOCPKT_START 8
|
||||
#define TIOCPKT_NOSTOP 16
|
||||
#define TIOCPKT_DOSTOP 32
|
||||
|
||||
#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,13 +1,29 @@
|
|||
#ifdef __KERNEL__
|
||||
# ifdef CONFIG_X86_32
|
||||
# include "ipcbuf_32.h"
|
||||
# else
|
||||
# include "ipcbuf_64.h"
|
||||
# endif
|
||||
#else
|
||||
# ifdef __i386__
|
||||
# include "ipcbuf_32.h"
|
||||
# else
|
||||
# include "ipcbuf_64.h"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef _ASM_X86_IPCBUF_H
|
||||
#define _ASM_X86_IPCBUF_H
|
||||
|
||||
/*
|
||||
* The ipc64_perm structure for x86 architecture.
|
||||
* Note extra padding because this structure is passed back and forth
|
||||
* between kernel and user space.
|
||||
*
|
||||
* Pad space is left for:
|
||||
* - 32-bit mode_t and seq
|
||||
* - 2 miscellaneous 32-bit values
|
||||
*/
|
||||
|
||||
struct ipc64_perm
|
||||
{
|
||||
__kernel_key_t key;
|
||||
__kernel_uid32_t uid;
|
||||
__kernel_gid32_t gid;
|
||||
__kernel_uid32_t cuid;
|
||||
__kernel_gid32_t cgid;
|
||||
__kernel_mode_t mode;
|
||||
unsigned short __pad1;
|
||||
unsigned short seq;
|
||||
unsigned short __pad2;
|
||||
unsigned long __unused1;
|
||||
unsigned long __unused2;
|
||||
};
|
||||
|
||||
#endif /* _ASM_X86_IPCBUF_H */
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
#ifndef __i386_IPCBUF_H__
|
||||
#define __i386_IPCBUF_H__
|
||||
|
||||
/*
|
||||
* The ipc64_perm structure for i386 architecture.
|
||||
* Note extra padding because this structure is passed back and forth
|
||||
* between kernel and user space.
|
||||
*
|
||||
* Pad space is left for:
|
||||
* - 32-bit mode_t and seq
|
||||
* - 2 miscellaneous 32-bit values
|
||||
*/
|
||||
|
||||
struct ipc64_perm
|
||||
{
|
||||
__kernel_key_t key;
|
||||
__kernel_uid32_t uid;
|
||||
__kernel_gid32_t gid;
|
||||
__kernel_uid32_t cuid;
|
||||
__kernel_gid32_t cgid;
|
||||
__kernel_mode_t mode;
|
||||
unsigned short __pad1;
|
||||
unsigned short seq;
|
||||
unsigned short __pad2;
|
||||
unsigned long __unused1;
|
||||
unsigned long __unused2;
|
||||
};
|
||||
|
||||
#endif /* __i386_IPCBUF_H__ */
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
#ifndef __x86_64_IPCBUF_H__
|
||||
#define __x86_64_IPCBUF_H__
|
||||
|
||||
/*
|
||||
* The ipc64_perm structure for x86_64 architecture.
|
||||
* Note extra padding because this structure is passed back and forth
|
||||
* between kernel and user space.
|
||||
*
|
||||
* Pad space is left for:
|
||||
* - 32-bit mode_t and seq
|
||||
* - 2 miscellaneous 32-bit values
|
||||
*/
|
||||
|
||||
struct ipc64_perm
|
||||
{
|
||||
__kernel_key_t key;
|
||||
__kernel_uid32_t uid;
|
||||
__kernel_gid32_t gid;
|
||||
__kernel_uid32_t cuid;
|
||||
__kernel_gid32_t cgid;
|
||||
__kernel_mode_t mode;
|
||||
unsigned short __pad1;
|
||||
unsigned short seq;
|
||||
unsigned short __pad2;
|
||||
unsigned long __unused1;
|
||||
unsigned long __unused2;
|
||||
};
|
||||
|
||||
#endif /* __x86_64_IPCBUF_H__ */
|
||||
|
|
@ -1,5 +1,33 @@
|
|||
#ifdef CONFIG_X86_32
|
||||
# include "kdebug_32.h"
|
||||
#else
|
||||
# include "kdebug_64.h"
|
||||
#ifndef _ASM_X86_KDEBUG_H
|
||||
#define _ASM_X86_KDEBUG_H
|
||||
|
||||
#include <linux/notifier.h>
|
||||
|
||||
struct pt_regs;
|
||||
|
||||
/* Grossly misnamed. */
|
||||
enum die_val {
|
||||
DIE_OOPS = 1,
|
||||
DIE_INT3,
|
||||
DIE_DEBUG,
|
||||
DIE_PANIC,
|
||||
DIE_NMI,
|
||||
DIE_DIE,
|
||||
DIE_NMIWATCHDOG,
|
||||
DIE_KERNELDEBUG,
|
||||
DIE_TRAP,
|
||||
DIE_GPF,
|
||||
DIE_CALL,
|
||||
DIE_NMI_IPI,
|
||||
DIE_PAGE_FAULT,
|
||||
};
|
||||
|
||||
extern void printk_address(unsigned long address);
|
||||
extern void die(const char *,struct pt_regs *,long);
|
||||
extern void __die(const char *,struct pt_regs *,long);
|
||||
extern void show_registers(struct pt_regs *regs);
|
||||
extern void dump_pagetable(unsigned long);
|
||||
extern unsigned long oops_begin(void);
|
||||
extern void oops_end(unsigned long);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
#ifndef _I386_KDEBUG_H
|
||||
#define _I386_KDEBUG_H 1
|
||||
|
||||
/*
|
||||
* Aug-05 2004 Ported by Prasanna S Panchamukhi <prasanna@in.ibm.com>
|
||||
* from x86_64 architecture.
|
||||
*/
|
||||
|
||||
struct pt_regs;
|
||||
|
||||
/* Grossly misnamed. */
|
||||
enum die_val {
|
||||
DIE_OOPS = 1,
|
||||
DIE_INT3,
|
||||
DIE_DEBUG,
|
||||
DIE_PANIC,
|
||||
DIE_NMI,
|
||||
DIE_DIE,
|
||||
DIE_NMIWATCHDOG,
|
||||
DIE_KERNELDEBUG,
|
||||
DIE_TRAP,
|
||||
DIE_GPF,
|
||||
DIE_CALL,
|
||||
DIE_NMI_IPI,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
#ifndef _X86_64_KDEBUG_H
|
||||
#define _X86_64_KDEBUG_H 1
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
struct pt_regs;
|
||||
|
||||
/* Grossly misnamed. */
|
||||
enum die_val {
|
||||
DIE_OOPS = 1,
|
||||
DIE_INT3,
|
||||
DIE_DEBUG,
|
||||
DIE_PANIC,
|
||||
DIE_NMI,
|
||||
DIE_DIE,
|
||||
DIE_NMIWATCHDOG,
|
||||
DIE_KERNELDEBUG,
|
||||
DIE_TRAP,
|
||||
DIE_GPF,
|
||||
DIE_CALL,
|
||||
DIE_NMI_IPI,
|
||||
};
|
||||
|
||||
extern void printk_address(unsigned long address);
|
||||
extern void die(const char *,struct pt_regs *,long);
|
||||
extern void __die(const char *,struct pt_regs *,long);
|
||||
extern void show_registers(struct pt_regs *regs);
|
||||
extern void dump_pagetable(unsigned long);
|
||||
extern unsigned long oops_begin(void);
|
||||
extern void oops_end(unsigned long);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,29 @@
|
|||
#ifdef CONFIG_X86_32
|
||||
# include "kmap_types_32.h"
|
||||
#ifndef _ASM_X86_KMAP_TYPES_H
|
||||
#define _ASM_X86_KMAP_TYPES_H
|
||||
|
||||
#if defined(CONFIG_X86_32) && defined(CONFIG_DEBUG_HIGHMEM)
|
||||
# define D(n) __KM_FENCE_##n ,
|
||||
#else
|
||||
# include "kmap_types_64.h"
|
||||
# define D(n)
|
||||
#endif
|
||||
|
||||
enum km_type {
|
||||
D(0) KM_BOUNCE_READ,
|
||||
D(1) KM_SKB_SUNRPC_DATA,
|
||||
D(2) KM_SKB_DATA_SOFTIRQ,
|
||||
D(3) KM_USER0,
|
||||
D(4) KM_USER1,
|
||||
D(5) KM_BIO_SRC_IRQ,
|
||||
D(6) KM_BIO_DST_IRQ,
|
||||
D(7) KM_PTE0,
|
||||
D(8) KM_PTE1,
|
||||
D(9) KM_IRQ0,
|
||||
D(10) KM_IRQ1,
|
||||
D(11) KM_SOFTIRQ0,
|
||||
D(12) KM_SOFTIRQ1,
|
||||
D(13) KM_TYPE_NR
|
||||
};
|
||||
|
||||
#undef D
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
#ifndef _ASM_KMAP_TYPES_H
|
||||
#define _ASM_KMAP_TYPES_H
|
||||
|
||||
|
||||
#ifdef CONFIG_DEBUG_HIGHMEM
|
||||
# define D(n) __KM_FENCE_##n ,
|
||||
#else
|
||||
# define D(n)
|
||||
#endif
|
||||
|
||||
enum km_type {
|
||||
D(0) KM_BOUNCE_READ,
|
||||
D(1) KM_SKB_SUNRPC_DATA,
|
||||
D(2) KM_SKB_DATA_SOFTIRQ,
|
||||
D(3) KM_USER0,
|
||||
D(4) KM_USER1,
|
||||
D(5) KM_BIO_SRC_IRQ,
|
||||
D(6) KM_BIO_DST_IRQ,
|
||||
D(7) KM_PTE0,
|
||||
D(8) KM_PTE1,
|
||||
D(9) KM_IRQ0,
|
||||
D(10) KM_IRQ1,
|
||||
D(11) KM_SOFTIRQ0,
|
||||
D(12) KM_SOFTIRQ1,
|
||||
D(13) KM_TYPE_NR
|
||||
};
|
||||
|
||||
#undef D
|
||||
|
||||
#endif
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
#ifndef _ASM_KMAP_TYPES_H
|
||||
#define _ASM_KMAP_TYPES_H
|
||||
|
||||
enum km_type {
|
||||
KM_BOUNCE_READ,
|
||||
KM_SKB_SUNRPC_DATA,
|
||||
KM_SKB_DATA_SOFTIRQ,
|
||||
KM_USER0,
|
||||
KM_USER1,
|
||||
KM_BIO_SRC_IRQ,
|
||||
KM_BIO_DST_IRQ,
|
||||
KM_IRQ0,
|
||||
KM_IRQ1,
|
||||
KM_SOFTIRQ0,
|
||||
KM_SOFTIRQ1,
|
||||
KM_TYPE_NR
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,13 +1,40 @@
|
|||
#ifdef __KERNEL__
|
||||
# ifdef CONFIG_X86_32
|
||||
# include "ldt_32.h"
|
||||
# else
|
||||
# include "ldt_64.h"
|
||||
# endif
|
||||
#else
|
||||
# ifdef __i386__
|
||||
# include "ldt_32.h"
|
||||
# else
|
||||
# include "ldt_64.h"
|
||||
# endif
|
||||
/*
|
||||
* ldt.h
|
||||
*
|
||||
* Definitions of structures used with the modify_ldt system call.
|
||||
*/
|
||||
#ifndef _ASM_X86_LDT_H
|
||||
#define _ASM_X86_LDT_H
|
||||
|
||||
/* Maximum number of LDT entries supported. */
|
||||
#define LDT_ENTRIES 8192
|
||||
/* The size of each LDT entry. */
|
||||
#define LDT_ENTRY_SIZE 8
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
/*
|
||||
* Note on 64bit base and limit is ignored and you cannot set DS/ES/CS
|
||||
* not to the default values if you still want to do syscalls. This
|
||||
* call is more for 32bit mode therefore.
|
||||
*/
|
||||
struct user_desc {
|
||||
unsigned int entry_number;
|
||||
unsigned int base_addr;
|
||||
unsigned int limit;
|
||||
unsigned int seg_32bit:1;
|
||||
unsigned int contents:2;
|
||||
unsigned int read_exec_only:1;
|
||||
unsigned int limit_in_pages:1;
|
||||
unsigned int seg_not_present:1;
|
||||
unsigned int useable:1;
|
||||
#ifdef __x86_64__
|
||||
unsigned int lm:1;
|
||||
#endif
|
||||
};
|
||||
|
||||
#define MODIFY_LDT_CONTENTS_DATA 0
|
||||
#define MODIFY_LDT_CONTENTS_STACK 1
|
||||
#define MODIFY_LDT_CONTENTS_CODE 2
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* ldt.h
|
||||
*
|
||||
* Definitions of structures used with the modify_ldt system call.
|
||||
*/
|
||||
#ifndef _LINUX_LDT_H
|
||||
#define _LINUX_LDT_H
|
||||
|
||||
/* Maximum number of LDT entries supported. */
|
||||
#define LDT_ENTRIES 8192
|
||||
/* The size of each LDT entry. */
|
||||
#define LDT_ENTRY_SIZE 8
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
struct user_desc {
|
||||
unsigned int entry_number;
|
||||
unsigned long base_addr;
|
||||
unsigned int limit;
|
||||
unsigned int seg_32bit:1;
|
||||
unsigned int contents:2;
|
||||
unsigned int read_exec_only:1;
|
||||
unsigned int limit_in_pages:1;
|
||||
unsigned int seg_not_present:1;
|
||||
unsigned int useable:1;
|
||||
};
|
||||
|
||||
#define MODIFY_LDT_CONTENTS_DATA 0
|
||||
#define MODIFY_LDT_CONTENTS_STACK 1
|
||||
#define MODIFY_LDT_CONTENTS_CODE 2
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
#endif
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
/*
|
||||
* ldt.h
|
||||
*
|
||||
* Definitions of structures used with the modify_ldt system call.
|
||||
*/
|
||||
#ifndef _LINUX_LDT_H
|
||||
#define _LINUX_LDT_H
|
||||
|
||||
/* Maximum number of LDT entries supported. */
|
||||
#define LDT_ENTRIES 8192
|
||||
/* The size of each LDT entry. */
|
||||
#define LDT_ENTRY_SIZE 8
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
/* Note on 64bit base and limit is ignored and you cannot set
|
||||
DS/ES/CS not to the default values if you still want to do syscalls. This
|
||||
call is more for 32bit mode therefore. */
|
||||
struct user_desc {
|
||||
unsigned int entry_number;
|
||||
unsigned int base_addr;
|
||||
unsigned int limit;
|
||||
unsigned int seg_32bit:1;
|
||||
unsigned int contents:2;
|
||||
unsigned int read_exec_only:1;
|
||||
unsigned int limit_in_pages:1;
|
||||
unsigned int seg_not_present:1;
|
||||
unsigned int useable:1;
|
||||
unsigned int lm:1;
|
||||
};
|
||||
|
||||
#define MODIFY_LDT_CONTENTS_DATA 0
|
||||
#define MODIFY_LDT_CONTENTS_STACK 1
|
||||
#define MODIFY_LDT_CONTENTS_CODE 2
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
#endif
|
||||
|
|
@ -1,11 +1,17 @@
|
|||
#ifndef __ASM_MACH_APICDEF_H
|
||||
#define __ASM_MACH_APICDEF_H
|
||||
|
||||
#include <asm/apic.h>
|
||||
|
||||
#define APIC_ID_MASK (0xF<<24)
|
||||
|
||||
static inline unsigned get_apic_id(unsigned long x)
|
||||
{
|
||||
return (((x)>>24)&0xF);
|
||||
unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
|
||||
if (APIC_XAPIC(ver))
|
||||
return (((x)>>24)&0xFF);
|
||||
else
|
||||
return (((x)>>24)&0xF);
|
||||
}
|
||||
|
||||
#define GET_APIC_ID(x) get_apic_id(x)
|
||||
|
|
|
|||
|
|
@ -94,22 +94,22 @@
|
|||
#define CO_IRQ_8259 CO_IRQ(CO_APIC_8259)
|
||||
|
||||
#ifdef CONFIG_X86_VISWS_APIC
|
||||
extern __inline void co_cpu_write(unsigned long reg, unsigned long v)
|
||||
static inline void co_cpu_write(unsigned long reg, unsigned long v)
|
||||
{
|
||||
*((volatile unsigned long *)(CO_CPU_VADDR+reg))=v;
|
||||
}
|
||||
|
||||
extern __inline unsigned long co_cpu_read(unsigned long reg)
|
||||
static inline unsigned long co_cpu_read(unsigned long reg)
|
||||
{
|
||||
return *((volatile unsigned long *)(CO_CPU_VADDR+reg));
|
||||
}
|
||||
|
||||
extern __inline void co_apic_write(unsigned long reg, unsigned long v)
|
||||
static inline void co_apic_write(unsigned long reg, unsigned long v)
|
||||
{
|
||||
*((volatile unsigned long *)(CO_APIC_VADDR+reg))=v;
|
||||
}
|
||||
|
||||
extern __inline unsigned long co_apic_read(unsigned long reg)
|
||||
static inline unsigned long co_apic_read(unsigned long reg)
|
||||
{
|
||||
return *((volatile unsigned long *)(CO_APIC_VADDR+reg));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,22 +29,22 @@
|
|||
#define LI_INTD 0x0080
|
||||
|
||||
/* More special purpose macros... */
|
||||
extern __inline void li_pcia_write16(unsigned long reg, unsigned short v)
|
||||
static inline void li_pcia_write16(unsigned long reg, unsigned short v)
|
||||
{
|
||||
*((volatile unsigned short *)(LI_PCIA_VADDR+reg))=v;
|
||||
}
|
||||
|
||||
extern __inline unsigned short li_pcia_read16(unsigned long reg)
|
||||
static inline unsigned short li_pcia_read16(unsigned long reg)
|
||||
{
|
||||
return *((volatile unsigned short *)(LI_PCIA_VADDR+reg));
|
||||
}
|
||||
|
||||
extern __inline void li_pcib_write16(unsigned long reg, unsigned short v)
|
||||
static inline void li_pcib_write16(unsigned long reg, unsigned short v)
|
||||
{
|
||||
*((volatile unsigned short *)(LI_PCIB_VADDR+reg))=v;
|
||||
}
|
||||
|
||||
extern __inline unsigned short li_pcib_read16(unsigned long reg)
|
||||
static inline unsigned short li_pcib_read16(unsigned long reg)
|
||||
{
|
||||
return *((volatile unsigned short *)(LI_PCIB_VADDR+reg));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,129 @@
|
|||
#ifndef _ASM_X86_MCE_H
|
||||
#define _ASM_X86_MCE_H
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
||||
#include <asm/ioctls.h>
|
||||
#include <asm/types.h>
|
||||
|
||||
/*
|
||||
* Machine Check support for x86
|
||||
*/
|
||||
|
||||
#define MCG_CTL_P (1UL<<8) /* MCG_CAP register available */
|
||||
|
||||
#define MCG_STATUS_RIPV (1UL<<0) /* restart ip valid */
|
||||
#define MCG_STATUS_EIPV (1UL<<1) /* eip points to correct instruction */
|
||||
#define MCG_STATUS_MCIP (1UL<<2) /* machine check in progress */
|
||||
|
||||
#define MCI_STATUS_VAL (1UL<<63) /* valid error */
|
||||
#define MCI_STATUS_OVER (1UL<<62) /* previous errors lost */
|
||||
#define MCI_STATUS_UC (1UL<<61) /* uncorrected error */
|
||||
#define MCI_STATUS_EN (1UL<<60) /* error enabled */
|
||||
#define MCI_STATUS_MISCV (1UL<<59) /* misc error reg. valid */
|
||||
#define MCI_STATUS_ADDRV (1UL<<58) /* addr reg. valid */
|
||||
#define MCI_STATUS_PCC (1UL<<57) /* processor context corrupt */
|
||||
|
||||
/* Fields are zero when not available */
|
||||
struct mce {
|
||||
__u64 status;
|
||||
__u64 misc;
|
||||
__u64 addr;
|
||||
__u64 mcgstatus;
|
||||
__u64 rip;
|
||||
__u64 tsc; /* cpu time stamp counter */
|
||||
__u64 res1; /* for future extension */
|
||||
__u64 res2; /* dito. */
|
||||
__u8 cs; /* code segment */
|
||||
__u8 bank; /* machine check bank */
|
||||
__u8 cpu; /* cpu that raised the error */
|
||||
__u8 finished; /* entry is valid */
|
||||
__u32 pad;
|
||||
};
|
||||
|
||||
/*
|
||||
* This structure contains all data related to the MCE log. Also
|
||||
* carries a signature to make it easier to find from external
|
||||
* debugging tools. Each entry is only valid when its finished flag
|
||||
* is set.
|
||||
*/
|
||||
|
||||
#define MCE_LOG_LEN 32
|
||||
|
||||
struct mce_log {
|
||||
char signature[12]; /* "MACHINECHECK" */
|
||||
unsigned len; /* = MCE_LOG_LEN */
|
||||
unsigned next;
|
||||
unsigned flags;
|
||||
unsigned pad0;
|
||||
struct mce entry[MCE_LOG_LEN];
|
||||
};
|
||||
|
||||
#define MCE_OVERFLOW 0 /* bit 0 in flags means overflow */
|
||||
|
||||
#define MCE_LOG_SIGNATURE "MACHINECHECK"
|
||||
|
||||
#define MCE_GET_RECORD_LEN _IOR('M', 1, int)
|
||||
#define MCE_GET_LOG_LEN _IOR('M', 2, int)
|
||||
#define MCE_GETCLEAR_FLAGS _IOR('M', 3, int)
|
||||
|
||||
/* Software defined banks */
|
||||
#define MCE_EXTENDED_BANK 128
|
||||
#define MCE_THERMAL_BANK MCE_EXTENDED_BANK + 0
|
||||
|
||||
#define K8_MCE_THRESHOLD_BASE (MCE_EXTENDED_BANK + 1) /* MCE_AMD */
|
||||
#define K8_MCE_THRESHOLD_BANK_0 (MCE_THRESHOLD_BASE + 0 * 9)
|
||||
#define K8_MCE_THRESHOLD_BANK_1 (MCE_THRESHOLD_BASE + 1 * 9)
|
||||
#define K8_MCE_THRESHOLD_BANK_2 (MCE_THRESHOLD_BASE + 2 * 9)
|
||||
#define K8_MCE_THRESHOLD_BANK_3 (MCE_THRESHOLD_BASE + 3 * 9)
|
||||
#define K8_MCE_THRESHOLD_BANK_4 (MCE_THRESHOLD_BASE + 4 * 9)
|
||||
#define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9)
|
||||
#define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0)
|
||||
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#ifdef CONFIG_X86_32
|
||||
# include "mce_32.h"
|
||||
#ifdef CONFIG_X86_MCE
|
||||
extern void mcheck_init(struct cpuinfo_x86 *c);
|
||||
#else
|
||||
# include "mce_64.h"
|
||||
#define mcheck_init(c) do {} while(0)
|
||||
#endif
|
||||
|
||||
extern int mce_disabled;
|
||||
|
||||
#else /* CONFIG_X86_32 */
|
||||
|
||||
#include <asm/atomic.h>
|
||||
|
||||
void mce_log(struct mce *m);
|
||||
DECLARE_PER_CPU(struct sys_device, device_mce);
|
||||
|
||||
#ifdef CONFIG_X86_MCE_INTEL
|
||||
void mce_intel_feature_init(struct cpuinfo_x86 *c);
|
||||
#else
|
||||
static inline void mce_intel_feature_init(struct cpuinfo_x86 *c) { }
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86_MCE_AMD
|
||||
void mce_amd_feature_init(struct cpuinfo_x86 *c);
|
||||
#else
|
||||
static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { }
|
||||
#endif
|
||||
|
||||
void mce_log_therm_throt_event(unsigned int cpu, __u64 status);
|
||||
|
||||
extern atomic_t mce_entry;
|
||||
|
||||
extern void do_machine_check(struct pt_regs *, long);
|
||||
extern int mce_notify_user(void);
|
||||
|
||||
#endif /* !CONFIG_X86_32 */
|
||||
|
||||
extern void stop_mce(void);
|
||||
extern void restart_mce(void);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
#ifdef CONFIG_X86_MCE
|
||||
extern void mcheck_init(struct cpuinfo_x86 *c);
|
||||
#else
|
||||
#define mcheck_init(c) do {} while(0)
|
||||
#endif
|
||||
|
||||
extern int mce_disabled;
|
||||
|
||||
extern void stop_mce(void);
|
||||
extern void restart_mce(void);
|
||||
|
||||
|
|
@ -1,115 +0,0 @@
|
|||
#ifndef _ASM_MCE_H
|
||||
#define _ASM_MCE_H 1
|
||||
|
||||
#include <asm/ioctls.h>
|
||||
#include <asm/types.h>
|
||||
|
||||
/*
|
||||
* Machine Check support for x86
|
||||
*/
|
||||
|
||||
#define MCG_CTL_P (1UL<<8) /* MCG_CAP register available */
|
||||
|
||||
#define MCG_STATUS_RIPV (1UL<<0) /* restart ip valid */
|
||||
#define MCG_STATUS_EIPV (1UL<<1) /* eip points to correct instruction */
|
||||
#define MCG_STATUS_MCIP (1UL<<2) /* machine check in progress */
|
||||
|
||||
#define MCI_STATUS_VAL (1UL<<63) /* valid error */
|
||||
#define MCI_STATUS_OVER (1UL<<62) /* previous errors lost */
|
||||
#define MCI_STATUS_UC (1UL<<61) /* uncorrected error */
|
||||
#define MCI_STATUS_EN (1UL<<60) /* error enabled */
|
||||
#define MCI_STATUS_MISCV (1UL<<59) /* misc error reg. valid */
|
||||
#define MCI_STATUS_ADDRV (1UL<<58) /* addr reg. valid */
|
||||
#define MCI_STATUS_PCC (1UL<<57) /* processor context corrupt */
|
||||
|
||||
/* Fields are zero when not available */
|
||||
struct mce {
|
||||
__u64 status;
|
||||
__u64 misc;
|
||||
__u64 addr;
|
||||
__u64 mcgstatus;
|
||||
__u64 rip;
|
||||
__u64 tsc; /* cpu time stamp counter */
|
||||
__u64 res1; /* for future extension */
|
||||
__u64 res2; /* dito. */
|
||||
__u8 cs; /* code segment */
|
||||
__u8 bank; /* machine check bank */
|
||||
__u8 cpu; /* cpu that raised the error */
|
||||
__u8 finished; /* entry is valid */
|
||||
__u32 pad;
|
||||
};
|
||||
|
||||
/*
|
||||
* This structure contains all data related to the MCE log.
|
||||
* Also carries a signature to make it easier to find from external debugging tools.
|
||||
* Each entry is only valid when its finished flag is set.
|
||||
*/
|
||||
|
||||
#define MCE_LOG_LEN 32
|
||||
|
||||
struct mce_log {
|
||||
char signature[12]; /* "MACHINECHECK" */
|
||||
unsigned len; /* = MCE_LOG_LEN */
|
||||
unsigned next;
|
||||
unsigned flags;
|
||||
unsigned pad0;
|
||||
struct mce entry[MCE_LOG_LEN];
|
||||
};
|
||||
|
||||
#define MCE_OVERFLOW 0 /* bit 0 in flags means overflow */
|
||||
|
||||
#define MCE_LOG_SIGNATURE "MACHINECHECK"
|
||||
|
||||
#define MCE_GET_RECORD_LEN _IOR('M', 1, int)
|
||||
#define MCE_GET_LOG_LEN _IOR('M', 2, int)
|
||||
#define MCE_GETCLEAR_FLAGS _IOR('M', 3, int)
|
||||
|
||||
/* Software defined banks */
|
||||
#define MCE_EXTENDED_BANK 128
|
||||
#define MCE_THERMAL_BANK MCE_EXTENDED_BANK + 0
|
||||
|
||||
#define K8_MCE_THRESHOLD_BASE (MCE_EXTENDED_BANK + 1) /* MCE_AMD */
|
||||
#define K8_MCE_THRESHOLD_BANK_0 (MCE_THRESHOLD_BASE + 0 * 9)
|
||||
#define K8_MCE_THRESHOLD_BANK_1 (MCE_THRESHOLD_BASE + 1 * 9)
|
||||
#define K8_MCE_THRESHOLD_BANK_2 (MCE_THRESHOLD_BASE + 2 * 9)
|
||||
#define K8_MCE_THRESHOLD_BANK_3 (MCE_THRESHOLD_BASE + 3 * 9)
|
||||
#define K8_MCE_THRESHOLD_BANK_4 (MCE_THRESHOLD_BASE + 4 * 9)
|
||||
#define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9)
|
||||
#define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <asm/atomic.h>
|
||||
|
||||
void mce_log(struct mce *m);
|
||||
DECLARE_PER_CPU(struct sys_device, device_mce);
|
||||
|
||||
#ifdef CONFIG_X86_MCE_INTEL
|
||||
void mce_intel_feature_init(struct cpuinfo_x86 *c);
|
||||
#else
|
||||
static inline void mce_intel_feature_init(struct cpuinfo_x86 *c)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86_MCE_AMD
|
||||
void mce_amd_feature_init(struct cpuinfo_x86 *c);
|
||||
#else
|
||||
static inline void mce_amd_feature_init(struct cpuinfo_x86 *c)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
void mce_log_therm_throt_event(unsigned int cpu, __u64 status);
|
||||
|
||||
extern atomic_t mce_entry;
|
||||
|
||||
extern void do_machine_check(struct pt_regs *, long);
|
||||
|
||||
extern int mce_notify_user(void);
|
||||
|
||||
extern void stop_mce(void);
|
||||
extern void restart_mce(void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,13 +1,19 @@
|
|||
#ifdef __KERNEL__
|
||||
# ifdef CONFIG_X86_32
|
||||
# include "mman_32.h"
|
||||
# else
|
||||
# include "mman_64.h"
|
||||
# endif
|
||||
#else
|
||||
# ifdef __i386__
|
||||
# include "mman_32.h"
|
||||
# else
|
||||
# include "mman_64.h"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef _ASM_X86_MMAN_H
|
||||
#define _ASM_X86_MMAN_H
|
||||
|
||||
#include <asm-generic/mman.h>
|
||||
|
||||
#define MAP_32BIT 0x40 /* only give out 32bit addresses */
|
||||
|
||||
#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
|
||||
#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
|
||||
#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
|
||||
#define MAP_LOCKED 0x2000 /* pages are locked */
|
||||
#define MAP_NORESERVE 0x4000 /* don't check for reservations */
|
||||
#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
|
||||
#define MAP_NONBLOCK 0x10000 /* do not block on IO */
|
||||
|
||||
#define MCL_CURRENT 1 /* lock all current mappings */
|
||||
#define MCL_FUTURE 2 /* lock all future mappings */
|
||||
|
||||
#endif /* _ASM_X86_MMAN_H */
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
#ifndef __I386_MMAN_H__
|
||||
#define __I386_MMAN_H__
|
||||
|
||||
#include <asm-generic/mman.h>
|
||||
|
||||
#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
|
||||
#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
|
||||
#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
|
||||
#define MAP_LOCKED 0x2000 /* pages are locked */
|
||||
#define MAP_NORESERVE 0x4000 /* don't check for reservations */
|
||||
#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
|
||||
#define MAP_NONBLOCK 0x10000 /* do not block on IO */
|
||||
|
||||
#define MCL_CURRENT 1 /* lock all current mappings */
|
||||
#define MCL_FUTURE 2 /* lock all future mappings */
|
||||
|
||||
#endif /* __I386_MMAN_H__ */
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
#ifndef __X8664_MMAN_H__
|
||||
#define __X8664_MMAN_H__
|
||||
|
||||
#include <asm-generic/mman.h>
|
||||
|
||||
#define MAP_32BIT 0x40 /* only give out 32bit addresses */
|
||||
|
||||
#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
|
||||
#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
|
||||
#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
|
||||
#define MAP_LOCKED 0x2000 /* pages are locked */
|
||||
#define MAP_NORESERVE 0x4000 /* don't check for reservations */
|
||||
#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
|
||||
#define MAP_NONBLOCK 0x10000 /* do not block on IO */
|
||||
|
||||
#define MCL_CURRENT 1 /* lock all current mappings */
|
||||
#define MCL_FUTURE 2 /* lock all future mappings */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef __i386_MMU_H
|
||||
#define __i386_MMU_H
|
||||
|
||||
#include <asm/semaphore.h>
|
||||
#include <linux/mutex.h>
|
||||
/*
|
||||
* The i386 doesn't have a mmu context, but
|
||||
* we put the segment information here.
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
*/
|
||||
typedef struct {
|
||||
int size;
|
||||
struct semaphore sem;
|
||||
struct mutex lock;
|
||||
void *ldt;
|
||||
void *vdso;
|
||||
} mm_context_t;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#define __x86_64_MMU_H
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
#include <asm/semaphore.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
/*
|
||||
* The x86_64 doesn't have a mmu context, but
|
||||
|
|
@ -14,7 +14,7 @@ typedef struct {
|
|||
void *ldt;
|
||||
rwlock_t ldtlock;
|
||||
int size;
|
||||
struct semaphore sem;
|
||||
struct mutex lock;
|
||||
void *vdso;
|
||||
} mm_context_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
#ifdef CONFIG_X86_32
|
||||
# include "namei_32.h"
|
||||
#else
|
||||
# include "namei_64.h"
|
||||
#endif
|
||||
#ifndef _ASM_X86_NAMEI_H
|
||||
#define _ASM_X86_NAMEI_H
|
||||
|
||||
/* This dummy routine maybe changed to something useful
|
||||
* for /usr/gnemul/ emulation stuff.
|
||||
* Look at asm-sparc/namei.h for details.
|
||||
*/
|
||||
|
||||
#define __emul_prefix() NULL
|
||||
|
||||
#endif /* _ASM_X86_NAMEI_H */
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
/* $Id: namei.h,v 1.1 1996/12/13 14:48:21 jj Exp $
|
||||
* linux/include/asm-i386/namei.h
|
||||
*
|
||||
* Included from linux/fs/namei.c
|
||||
*/
|
||||
|
||||
#ifndef __I386_NAMEI_H
|
||||
#define __I386_NAMEI_H
|
||||
|
||||
/* This dummy routine maybe changed to something useful
|
||||
* for /usr/gnemul/ emulation stuff.
|
||||
* Look at asm-sparc/namei.h for details.
|
||||
*/
|
||||
|
||||
#define __emul_prefix() NULL
|
||||
|
||||
#endif /* __I386_NAMEI_H */
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
#ifndef __X8664_NAMEI_H
|
||||
#define __X8664_NAMEI_H
|
||||
|
||||
/* This dummy routine maybe changed to something useful
|
||||
* for /usr/gnemul/ emulation stuff.
|
||||
* Look at asm-sparc/namei.h for details.
|
||||
*/
|
||||
|
||||
#define __emul_prefix() NULL
|
||||
|
||||
#endif
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
#define _ASM_X8664_NUMA_H 1
|
||||
|
||||
#include <linux/nodemask.h>
|
||||
#include <asm/apicdef.h>
|
||||
|
||||
struct bootnode {
|
||||
u64 start,end;
|
||||
|
|
@ -19,7 +20,7 @@ extern void numa_set_node(int cpu, int node);
|
|||
extern void srat_reserve_add_area(int nodeid);
|
||||
extern int hotadd_percent;
|
||||
|
||||
extern unsigned char apicid_to_node[256];
|
||||
extern unsigned char apicid_to_node[MAX_LOCAL_APIC];
|
||||
#ifdef CONFIG_NUMA
|
||||
extern void __init init_cpu_to_node(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,22 @@
|
|||
#ifndef _ASM_X86_PARAM_H
|
||||
#define _ASM_X86_PARAM_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
# ifdef CONFIG_X86_32
|
||||
# include "param_32.h"
|
||||
# else
|
||||
# include "param_64.h"
|
||||
# endif
|
||||
#else
|
||||
# ifdef __i386__
|
||||
# include "param_32.h"
|
||||
# else
|
||||
# include "param_64.h"
|
||||
# endif
|
||||
# define HZ CONFIG_HZ /* Internal kernel timer frequency */
|
||||
# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
|
||||
# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
|
||||
#endif
|
||||
|
||||
#ifndef HZ
|
||||
#define HZ 100
|
||||
#endif
|
||||
|
||||
#define EXEC_PAGESIZE 4096
|
||||
|
||||
#ifndef NOGROUP
|
||||
#define NOGROUP (-1)
|
||||
#endif
|
||||
|
||||
#define MAXHOSTNAMELEN 64 /* max length of hostname */
|
||||
|
||||
#endif /* _ASM_X86_PARAM_H */
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
#ifndef _ASMi386_PARAM_H
|
||||
#define _ASMi386_PARAM_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
# define HZ CONFIG_HZ /* Internal kernel timer frequency */
|
||||
# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
|
||||
# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
|
||||
#endif
|
||||
|
||||
#ifndef HZ
|
||||
#define HZ 100
|
||||
#endif
|
||||
|
||||
#define EXEC_PAGESIZE 4096
|
||||
|
||||
#ifndef NOGROUP
|
||||
#define NOGROUP (-1)
|
||||
#endif
|
||||
|
||||
#define MAXHOSTNAMELEN 64 /* max length of hostname */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
#ifndef _ASMx86_64_PARAM_H
|
||||
#define _ASMx86_64_PARAM_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
# define HZ CONFIG_HZ /* Internal kernel timer frequency */
|
||||
# define USER_HZ 100 /* .. some user interfaces are in "ticks */
|
||||
#define CLOCKS_PER_SEC (USER_HZ) /* like times() */
|
||||
#endif
|
||||
|
||||
#ifndef HZ
|
||||
#define HZ 100
|
||||
#endif
|
||||
|
||||
#define EXEC_PAGESIZE 4096
|
||||
|
||||
#ifndef NOGROUP
|
||||
#define NOGROUP (-1)
|
||||
#endif
|
||||
|
||||
#define MAXHOSTNAMELEN 64 /* max length of hostname */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,10 @@
|
|||
#ifdef CONFIG_X86_32
|
||||
# include "parport_32.h"
|
||||
#else
|
||||
# include "parport_64.h"
|
||||
#endif
|
||||
#ifndef _ASM_X86_PARPORT_H
|
||||
#define _ASM_X86_PARPORT_H
|
||||
|
||||
static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
|
||||
static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
|
||||
{
|
||||
return parport_pc_find_isa_ports (autoirq, autodma);
|
||||
}
|
||||
|
||||
#endif /* _ASM_X86_PARPORT_H */
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
* parport.h: ia32-specific parport initialisation
|
||||
*
|
||||
* Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk>
|
||||
*
|
||||
* This file should only be included by drivers/parport/parport_pc.c.
|
||||
*/
|
||||
|
||||
#ifndef _ASM_I386_PARPORT_H
|
||||
#define _ASM_I386_PARPORT_H 1
|
||||
|
||||
static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
|
||||
static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
|
||||
{
|
||||
return parport_pc_find_isa_ports (autoirq, autodma);
|
||||
}
|
||||
|
||||
#endif /* !(_ASM_I386_PARPORT_H) */
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
* parport.h: ia32-specific parport initialisation
|
||||
*
|
||||
* Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk>
|
||||
*
|
||||
* This file should only be included by drivers/parport/parport_pc.c.
|
||||
*/
|
||||
|
||||
#ifndef _ASM_X8664_PARPORT_H
|
||||
#define _ASM_X8664_PARPORT_H 1
|
||||
|
||||
static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
|
||||
static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
|
||||
{
|
||||
return parport_pc_find_isa_ports (autoirq, autodma);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -30,6 +30,12 @@ struct x8664_pda {
|
|||
struct mm_struct *active_mm;
|
||||
unsigned apic_timer_irqs;
|
||||
unsigned irq0_irqs;
|
||||
unsigned irq_resched_count;
|
||||
unsigned irq_call_count;
|
||||
unsigned irq_tlb_count;
|
||||
unsigned irq_thermal_count;
|
||||
unsigned irq_threshold_count;
|
||||
unsigned irq_spurious_count;
|
||||
} ____cacheline_aligned_in_smp;
|
||||
|
||||
extern struct x8664_pda *_cpu_pda[];
|
||||
|
|
|
|||
|
|
@ -595,7 +595,9 @@ static inline void load_esp0(struct tss_struct *tss, struct thread_struct *threa
|
|||
* clear %ecx since some cpus (Cyrix MII) do not set or clear %ecx
|
||||
* resulting in stale register contents being returned.
|
||||
*/
|
||||
static inline void cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx)
|
||||
static inline void cpuid(unsigned int op,
|
||||
unsigned int *eax, unsigned int *ebx,
|
||||
unsigned int *ecx, unsigned int *edx)
|
||||
{
|
||||
*eax = op;
|
||||
*ecx = 0;
|
||||
|
|
@ -603,8 +605,9 @@ static inline void cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx,
|
|||
}
|
||||
|
||||
/* Some CPUID calls want 'count' to be placed in ecx */
|
||||
static inline void cpuid_count(int op, int count, int *eax, int *ebx, int *ecx,
|
||||
int *edx)
|
||||
static inline void cpuid_count(unsigned int op, int count,
|
||||
unsigned int *eax, unsigned int *ebx,
|
||||
unsigned int *ecx, unsigned int *edx)
|
||||
{
|
||||
*eax = op;
|
||||
*ecx = count;
|
||||
|
|
@ -674,6 +677,17 @@ static inline unsigned int cpuid_edx(unsigned int op)
|
|||
#define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n"
|
||||
#define K7_NOP8 K7_NOP7 ASM_NOP1
|
||||
|
||||
/* P6 nops */
|
||||
/* uses eax dependencies (Intel-recommended choice) */
|
||||
#define P6_NOP1 GENERIC_NOP1
|
||||
#define P6_NOP2 ".byte 0x66,0x90\n"
|
||||
#define P6_NOP3 ".byte 0x0f,0x1f,0x00\n"
|
||||
#define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n"
|
||||
#define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n"
|
||||
#define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n"
|
||||
#define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n"
|
||||
#define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n"
|
||||
|
||||
#ifdef CONFIG_MK8
|
||||
#define ASM_NOP1 K8_NOP1
|
||||
#define ASM_NOP2 K8_NOP2
|
||||
|
|
@ -692,6 +706,17 @@ static inline unsigned int cpuid_edx(unsigned int op)
|
|||
#define ASM_NOP6 K7_NOP6
|
||||
#define ASM_NOP7 K7_NOP7
|
||||
#define ASM_NOP8 K7_NOP8
|
||||
#elif defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \
|
||||
defined(CONFIG_MPENTIUMIII) || defined(CONFIG_MPENTIUMM) || \
|
||||
defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4)
|
||||
#define ASM_NOP1 P6_NOP1
|
||||
#define ASM_NOP2 P6_NOP2
|
||||
#define ASM_NOP3 P6_NOP3
|
||||
#define ASM_NOP4 P6_NOP4
|
||||
#define ASM_NOP5 P6_NOP5
|
||||
#define ASM_NOP6 P6_NOP6
|
||||
#define ASM_NOP7 P6_NOP7
|
||||
#define ASM_NOP8 P6_NOP8
|
||||
#else
|
||||
#define ASM_NOP1 GENERIC_NOP1
|
||||
#define ASM_NOP2 GENERIC_NOP2
|
||||
|
|
|
|||
|
|
@ -334,6 +334,16 @@ struct extended_sigtable {
|
|||
};
|
||||
|
||||
|
||||
#if defined(CONFIG_MPSC) || defined(CONFIG_MCORE2)
|
||||
#define ASM_NOP1 P6_NOP1
|
||||
#define ASM_NOP2 P6_NOP2
|
||||
#define ASM_NOP3 P6_NOP3
|
||||
#define ASM_NOP4 P6_NOP4
|
||||
#define ASM_NOP5 P6_NOP5
|
||||
#define ASM_NOP6 P6_NOP6
|
||||
#define ASM_NOP7 P6_NOP7
|
||||
#define ASM_NOP8 P6_NOP8
|
||||
#else
|
||||
#define ASM_NOP1 K8_NOP1
|
||||
#define ASM_NOP2 K8_NOP2
|
||||
#define ASM_NOP3 K8_NOP3
|
||||
|
|
@ -342,6 +352,7 @@ struct extended_sigtable {
|
|||
#define ASM_NOP6 K8_NOP6
|
||||
#define ASM_NOP7 K8_NOP7
|
||||
#define ASM_NOP8 K8_NOP8
|
||||
#endif
|
||||
|
||||
/* Opteron nops */
|
||||
#define K8_NOP1 ".byte 0x90\n"
|
||||
|
|
@ -353,6 +364,17 @@ struct extended_sigtable {
|
|||
#define K8_NOP7 K8_NOP4 K8_NOP3
|
||||
#define K8_NOP8 K8_NOP4 K8_NOP4
|
||||
|
||||
/* P6 nops */
|
||||
/* uses eax dependencies (Intel-recommended choice) */
|
||||
#define P6_NOP1 ".byte 0x90\n"
|
||||
#define P6_NOP2 ".byte 0x66,0x90\n"
|
||||
#define P6_NOP3 ".byte 0x0f,0x1f,0x00\n"
|
||||
#define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n"
|
||||
#define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n"
|
||||
#define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n"
|
||||
#define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n"
|
||||
#define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n"
|
||||
|
||||
#define ASM_NOP_MAX 8
|
||||
|
||||
/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
|
||||
|
|
@ -389,11 +411,6 @@ static inline void prefetchw(void *x)
|
|||
|
||||
#define cpu_relax() rep_nop()
|
||||
|
||||
static inline void serialize_cpu(void)
|
||||
{
|
||||
__asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx");
|
||||
}
|
||||
|
||||
static inline void __monitor(const void *eax, unsigned long ecx,
|
||||
unsigned long edx)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,13 +1,81 @@
|
|||
#ifdef __KERNEL__
|
||||
# ifdef CONFIG_X86_32
|
||||
# include "ptrace-abi_32.h"
|
||||
# else
|
||||
# include "ptrace-abi_64.h"
|
||||
# endif
|
||||
#ifndef _ASM_X86_PTRACE_ABI_H
|
||||
#define _ASM_X86_PTRACE_ABI_H
|
||||
|
||||
#ifdef __i386__
|
||||
|
||||
#define EBX 0
|
||||
#define ECX 1
|
||||
#define EDX 2
|
||||
#define ESI 3
|
||||
#define EDI 4
|
||||
#define EBP 5
|
||||
#define EAX 6
|
||||
#define DS 7
|
||||
#define ES 8
|
||||
#define FS 9
|
||||
#define GS 10
|
||||
#define ORIG_EAX 11
|
||||
#define EIP 12
|
||||
#define CS 13
|
||||
#define EFL 14
|
||||
#define UESP 15
|
||||
#define SS 16
|
||||
#define FRAME_SIZE 17
|
||||
|
||||
#else /* __i386__ */
|
||||
|
||||
#if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS)
|
||||
#define R15 0
|
||||
#define R14 8
|
||||
#define R13 16
|
||||
#define R12 24
|
||||
#define RBP 32
|
||||
#define RBX 40
|
||||
/* arguments: interrupts/non tracing syscalls only save upto here*/
|
||||
#define R11 48
|
||||
#define R10 56
|
||||
#define R9 64
|
||||
#define R8 72
|
||||
#define RAX 80
|
||||
#define RCX 88
|
||||
#define RDX 96
|
||||
#define RSI 104
|
||||
#define RDI 112
|
||||
#define ORIG_RAX 120 /* = ERROR */
|
||||
/* end of arguments */
|
||||
/* cpu exception frame or undefined in case of fast syscall. */
|
||||
#define RIP 128
|
||||
#define CS 136
|
||||
#define EFLAGS 144
|
||||
#define RSP 152
|
||||
#define SS 160
|
||||
#define ARGOFFSET R11
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
/* top of stack page */
|
||||
#define FRAME_SIZE 168
|
||||
|
||||
#endif /* !__i386__ */
|
||||
|
||||
/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
|
||||
#define PTRACE_GETREGS 12
|
||||
#define PTRACE_SETREGS 13
|
||||
#define PTRACE_GETFPREGS 14
|
||||
#define PTRACE_SETFPREGS 15
|
||||
#define PTRACE_GETFPXREGS 18
|
||||
#define PTRACE_SETFPXREGS 19
|
||||
|
||||
#define PTRACE_OLDSETOPTIONS 21
|
||||
|
||||
/* only useful for access 32bit programs / kernels */
|
||||
#define PTRACE_GET_THREAD_AREA 25
|
||||
#define PTRACE_SET_THREAD_AREA 26
|
||||
|
||||
#ifdef __x86_64__
|
||||
# define PTRACE_ARCH_PRCTL 30
|
||||
#else
|
||||
# ifdef __i386__
|
||||
# include "ptrace-abi_32.h"
|
||||
# else
|
||||
# include "ptrace-abi_64.h"
|
||||
# endif
|
||||
# define PTRACE_SYSEMU 31
|
||||
# define PTRACE_SYSEMU_SINGLESTEP 32
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue