Auto-update from upstream
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
#define SO_ERROR 0x1007
|
||||
#define SO_SNDBUF 0x1001
|
||||
#define SO_RCVBUF 0x1002
|
||||
#define SO_SNDBUFFORCE 0x100a
|
||||
#define SO_RCVBUFFORCE 0x100b
|
||||
#define SO_RCVLOWAT 0x1010
|
||||
#define SO_SNDLOWAT 0x1011
|
||||
#define SO_RCVTIMEO 0x1012
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* linux/include/asm-arm/arch-sa1100/mcp.h
|
||||
*
|
||||
* Copyright (C) 2005 Russell King.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef __ASM_ARM_ARCH_MCP_H
|
||||
#define __ASM_ARM_ARCH_MCP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct mcp_plat_data {
|
||||
u32 mccr0;
|
||||
u32 mccr1;
|
||||
unsigned int sclk_rate;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* linux/include/asm-arm/hardware/gic.h
|
||||
*
|
||||
* Copyright (C) 2002 ARM Limited, All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef __ASM_ARM_HARDWARE_GIC_H
|
||||
#define __ASM_ARM_HARDWARE_GIC_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#define GIC_CPU_CTRL 0x00
|
||||
#define GIC_CPU_PRIMASK 0x04
|
||||
#define GIC_CPU_BINPOINT 0x08
|
||||
#define GIC_CPU_INTACK 0x0c
|
||||
#define GIC_CPU_EOI 0x10
|
||||
#define GIC_CPU_RUNNINGPRI 0x14
|
||||
#define GIC_CPU_HIGHPRI 0x18
|
||||
|
||||
#define GIC_DIST_CTRL 0x000
|
||||
#define GIC_DIST_CTR 0x004
|
||||
#define GIC_DIST_ENABLE_SET 0x100
|
||||
#define GIC_DIST_ENABLE_CLEAR 0x180
|
||||
#define GIC_DIST_PENDING_SET 0x200
|
||||
#define GIC_DIST_PENDING_CLEAR 0x280
|
||||
#define GIC_DIST_ACTIVE_BIT 0x300
|
||||
#define GIC_DIST_PRI 0x400
|
||||
#define GIC_DIST_TARGET 0x800
|
||||
#define GIC_DIST_CONFIG 0xc00
|
||||
#define GIC_DIST_SOFTINT 0xf00
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
void gic_dist_init(void __iomem *base);
|
||||
void gic_cpu_init(void __iomem *base);
|
||||
void gic_raise_softirq(cpumask_t cpumask, unsigned int irq);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -14,6 +14,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -83,7 +83,7 @@ static inline unsigned short ip_fast_csum(unsigned char * iph,
|
||||
"adcl $0, %0 ;\n"
|
||||
"notl %0 ;\n"
|
||||
"2: ;\n"
|
||||
/* Since the input registers which are loaded with iph and ipl
|
||||
/* Since the input registers which are loaded with iph and ihl
|
||||
are modified, we must also specify them as outputs, or gcc
|
||||
will assume they contain their original values. */
|
||||
: "=r" (sum), "=r" (iph), "=r" (ihl)
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -105,7 +105,7 @@ static inline unsigned short ip_fast_csum(unsigned char * iph,
|
||||
" addx %0, %3 \n"
|
||||
" .fillinsn\n"
|
||||
"2: \n"
|
||||
/* Since the input registers which are loaded with iph and ipl
|
||||
/* Since the input registers which are loaded with iph and ihl
|
||||
are modified, we must also specify them as outputs, or gcc
|
||||
will assume they contain their original values. */
|
||||
: "=&r" (sum), "=r" (iph), "=r" (ihl), "=&r" (tmpreg0), "=&r" (tmpreg1)
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -37,6 +37,8 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
|
||||
#define SO_ERROR 0x1007 /* get error status and clear */
|
||||
#define SO_SNDBUF 0x1001 /* Send buffer size. */
|
||||
#define SO_RCVBUF 0x1002 /* Receive buffer. */
|
||||
#define SO_SNDBUFFORCE 0x100a
|
||||
#define SO_RCVBUFFORCE 0x100b
|
||||
#define SO_SNDLOWAT 0x1003 /* send low-water mark */
|
||||
#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
|
||||
#define SO_SNDTIMEO 0x1005 /* send timeout */
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
/* To add :#define SO_REUSEPORT 0x0200 */
|
||||
#define SO_SNDBUF 0x1001
|
||||
#define SO_RCVBUF 0x1002
|
||||
#define SO_SNDBUFFORCE 0x100a
|
||||
#define SO_RCVBUFFORCE 0x100b
|
||||
#define SO_SNDLOWAT 0x1003
|
||||
#define SO_RCVLOWAT 0x1004
|
||||
#define SO_SNDTIMEO 0x1005
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
#ifndef _8253PIT_H
|
||||
#define _8253PIT_H
|
||||
|
||||
#define PIT_TICK_RATE 1193182UL
|
||||
#define PIT_TICK_RATE 1193182UL
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1 @@
|
||||
#include <asm-generic/cputime.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <asm-generic/emergency-restart.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <asm-generic/percpu.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <asm-generic/resource.h>
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef __PPC_CPUTIME_H
|
||||
#define __PPC_CPUTIME_H
|
||||
|
||||
#include <asm-generic/cputime.h>
|
||||
|
||||
#endif /* __PPC_CPUTIME_H */
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef _ASM_EMERGENCY_RESTART_H
|
||||
#define _ASM_EMERGENCY_RESTART_H
|
||||
|
||||
#include <asm-generic/emergency-restart.h>
|
||||
|
||||
#endif /* _ASM_EMERGENCY_RESTART_H */
|
||||
@@ -1 +0,0 @@
|
||||
#include <asm-generic/hdreg.h>
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef __PPC_LOCAL_H
|
||||
#define __PPC_LOCAL_H
|
||||
|
||||
#include <asm-generic/local.h>
|
||||
|
||||
#endif /* __PPC_LOCAL_H */
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef __ARCH_PPC_PERCPU__
|
||||
#define __ARCH_PPC_PERCPU__
|
||||
|
||||
#include <asm-generic/percpu.h>
|
||||
|
||||
#endif /* __ARCH_PPC_PERCPU__ */
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef _PPC_RESOURCE_H
|
||||
#define _PPC_RESOURCE_H
|
||||
|
||||
#include <asm-generic/resource.h>
|
||||
|
||||
#endif
|
||||
@@ -20,6 +20,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
/*
|
||||
* 8253/8254 Programmable Interval Timer
|
||||
*/
|
||||
|
||||
#ifndef _8253PIT_H
|
||||
#define _8253PIT_H
|
||||
|
||||
#define PIT_TICK_RATE 1193182UL
|
||||
|
||||
#endif
|
||||
@@ -16,93 +16,51 @@
|
||||
#include <asm/page.h>
|
||||
#include <asm/prom.h>
|
||||
#include <asm/lmb.h>
|
||||
#include <asm/firmware.h>
|
||||
|
||||
typedef u32 msChunks_entry;
|
||||
struct msChunks {
|
||||
struct mschunks_map {
|
||||
unsigned long num_chunks;
|
||||
unsigned long chunk_size;
|
||||
unsigned long chunk_shift;
|
||||
unsigned long chunk_mask;
|
||||
msChunks_entry *abs;
|
||||
u32 *mapping;
|
||||
};
|
||||
|
||||
extern struct msChunks msChunks;
|
||||
extern struct mschunks_map mschunks_map;
|
||||
|
||||
extern unsigned long msChunks_alloc(unsigned long, unsigned long, unsigned long);
|
||||
extern unsigned long reloc_offset(void);
|
||||
/* Chunks are 256 KB */
|
||||
#define MSCHUNKS_CHUNK_SHIFT (18)
|
||||
#define MSCHUNKS_CHUNK_SIZE (1UL << MSCHUNKS_CHUNK_SHIFT)
|
||||
#define MSCHUNKS_OFFSET_MASK (MSCHUNKS_CHUNK_SIZE - 1)
|
||||
|
||||
#ifdef CONFIG_MSCHUNKS
|
||||
|
||||
static inline unsigned long
|
||||
chunk_to_addr(unsigned long chunk)
|
||||
static inline unsigned long chunk_to_addr(unsigned long chunk)
|
||||
{
|
||||
unsigned long offset = reloc_offset();
|
||||
struct msChunks *_msChunks = PTRRELOC(&msChunks);
|
||||
|
||||
return chunk << _msChunks->chunk_shift;
|
||||
return chunk << MSCHUNKS_CHUNK_SHIFT;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
addr_to_chunk(unsigned long addr)
|
||||
static inline unsigned long addr_to_chunk(unsigned long addr)
|
||||
{
|
||||
unsigned long offset = reloc_offset();
|
||||
struct msChunks *_msChunks = PTRRELOC(&msChunks);
|
||||
|
||||
return addr >> _msChunks->chunk_shift;
|
||||
return addr >> MSCHUNKS_CHUNK_SHIFT;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
chunk_offset(unsigned long addr)
|
||||
static inline unsigned long phys_to_abs(unsigned long pa)
|
||||
{
|
||||
unsigned long offset = reloc_offset();
|
||||
struct msChunks *_msChunks = PTRRELOC(&msChunks);
|
||||
unsigned long chunk;
|
||||
|
||||
return addr & _msChunks->chunk_mask;
|
||||
/* This is a no-op on non-iSeries */
|
||||
if (!firmware_has_feature(FW_FEATURE_ISERIES))
|
||||
return pa;
|
||||
|
||||
chunk = addr_to_chunk(pa);
|
||||
|
||||
if (chunk < mschunks_map.num_chunks)
|
||||
chunk = mschunks_map.mapping[chunk];
|
||||
|
||||
return chunk_to_addr(chunk) + (pa & MSCHUNKS_OFFSET_MASK);
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
abs_chunk(unsigned long pchunk)
|
||||
{
|
||||
unsigned long offset = reloc_offset();
|
||||
struct msChunks *_msChunks = PTRRELOC(&msChunks);
|
||||
if ( pchunk >= _msChunks->num_chunks ) {
|
||||
return pchunk;
|
||||
}
|
||||
return PTRRELOC(_msChunks->abs)[pchunk];
|
||||
}
|
||||
|
||||
/* A macro so it can take pointers or unsigned long. */
|
||||
#define phys_to_abs(pa) \
|
||||
({ unsigned long _pa = (unsigned long)(pa); \
|
||||
chunk_to_addr(abs_chunk(addr_to_chunk(_pa))) + chunk_offset(_pa); \
|
||||
})
|
||||
|
||||
static inline unsigned long
|
||||
physRpn_to_absRpn(unsigned long rpn)
|
||||
{
|
||||
unsigned long pa = rpn << PAGE_SHIFT;
|
||||
unsigned long aa = phys_to_abs(pa);
|
||||
return (aa >> PAGE_SHIFT);
|
||||
}
|
||||
|
||||
/* A macro so it can take pointers or unsigned long. */
|
||||
#define abs_to_phys(aa) lmb_abs_to_phys((unsigned long)(aa))
|
||||
|
||||
#else /* !CONFIG_MSCHUNKS */
|
||||
|
||||
#define chunk_to_addr(chunk) ((unsigned long)(chunk))
|
||||
#define addr_to_chunk(addr) (addr)
|
||||
#define chunk_offset(addr) (0)
|
||||
#define abs_chunk(pchunk) (pchunk)
|
||||
|
||||
#define phys_to_abs(pa) (pa)
|
||||
#define physRpn_to_absRpn(rpn) (rpn)
|
||||
#define abs_to_phys(aa) (aa)
|
||||
|
||||
#endif /* !CONFIG_MSCHUNKS */
|
||||
|
||||
/* Convenience macros */
|
||||
#define virt_to_abs(va) phys_to_abs(__pa(va))
|
||||
#define abs_to_virt(aa) __va(abs_to_phys(aa))
|
||||
#define abs_to_virt(aa) __va(aa)
|
||||
|
||||
#endif /* _ABS_ADDR_H */
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#ifndef AGP_H
|
||||
#define AGP_H 1
|
||||
|
||||
#include <asm/io.h>
|
||||
|
||||
/* nothing much needed here */
|
||||
|
||||
#define map_page_into_agp(page)
|
||||
#define unmap_page_from_agp(page)
|
||||
#define flush_agp_mappings()
|
||||
#define flush_agp_cache() mb()
|
||||
|
||||
/* 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
|
||||
@@ -56,11 +56,6 @@ struct cpu_spec {
|
||||
* BHT, SPD, etc... from head.S before branching to identify_machine
|
||||
*/
|
||||
cpu_setup_t cpu_setup;
|
||||
|
||||
/* This is used to identify firmware features which are available
|
||||
* to the kernel.
|
||||
*/
|
||||
unsigned long firmware_features;
|
||||
};
|
||||
|
||||
extern struct cpu_spec cpu_specs[];
|
||||
@@ -71,39 +66,6 @@ static inline unsigned long cpu_has_feature(unsigned long feature)
|
||||
return cur_cpu_spec->cpu_features & feature;
|
||||
}
|
||||
|
||||
|
||||
/* firmware feature bitmask values */
|
||||
#define FIRMWARE_MAX_FEATURES 63
|
||||
|
||||
#define FW_FEATURE_PFT (1UL<<0)
|
||||
#define FW_FEATURE_TCE (1UL<<1)
|
||||
#define FW_FEATURE_SPRG0 (1UL<<2)
|
||||
#define FW_FEATURE_DABR (1UL<<3)
|
||||
#define FW_FEATURE_COPY (1UL<<4)
|
||||
#define FW_FEATURE_ASR (1UL<<5)
|
||||
#define FW_FEATURE_DEBUG (1UL<<6)
|
||||
#define FW_FEATURE_TERM (1UL<<7)
|
||||
#define FW_FEATURE_PERF (1UL<<8)
|
||||
#define FW_FEATURE_DUMP (1UL<<9)
|
||||
#define FW_FEATURE_INTERRUPT (1UL<<10)
|
||||
#define FW_FEATURE_MIGRATE (1UL<<11)
|
||||
#define FW_FEATURE_PERFMON (1UL<<12)
|
||||
#define FW_FEATURE_CRQ (1UL<<13)
|
||||
#define FW_FEATURE_VIO (1UL<<14)
|
||||
#define FW_FEATURE_RDMA (1UL<<15)
|
||||
#define FW_FEATURE_LLAN (1UL<<16)
|
||||
#define FW_FEATURE_BULK (1UL<<17)
|
||||
#define FW_FEATURE_XDABR (1UL<<18)
|
||||
#define FW_FEATURE_MULTITCE (1UL<<19)
|
||||
#define FW_FEATURE_SPLPAR (1UL<<20)
|
||||
|
||||
typedef struct {
|
||||
unsigned long val;
|
||||
char * name;
|
||||
} firmware_feature_t;
|
||||
|
||||
extern firmware_feature_t firmware_features_table[];
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
/* CPU kernel features */
|
||||
@@ -140,10 +102,8 @@ extern firmware_feature_t firmware_features_table[];
|
||||
#define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000)
|
||||
#define CPU_FTR_CTRL ASM_CONST(0x0000100000000000)
|
||||
|
||||
/* Platform firmware features */
|
||||
#define FW_FTR_ ASM_CONST(0x0000000000000001)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#define COMMON_USER_PPC64 (PPC_FEATURE_32 | PPC_FEATURE_64 | \
|
||||
PPC_FEATURE_HAS_FPU | PPC_FEATURE_HAS_MMU)
|
||||
|
||||
@@ -156,10 +116,9 @@ extern firmware_feature_t firmware_features_table[];
|
||||
#define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_PPCAS_ARCH_V2_BASE)
|
||||
#else
|
||||
#define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_PPCAS_ARCH_V2_BASE | CPU_FTR_16M_PAGE)
|
||||
#endif
|
||||
#endif /* CONFIG_PPC_ISERIES */
|
||||
|
||||
#define COMMON_PPC64_FW (0)
|
||||
#endif
|
||||
#endif /* __ASSEMBLY */
|
||||
|
||||
#ifdef __ASSEMBLY__
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef __PPC_CPUTIME_H
|
||||
#define __PPC_CPUTIME_H
|
||||
|
||||
#include <asm-generic/cputime.h>
|
||||
|
||||
#endif /* __PPC_CPUTIME_H */
|
||||
@@ -1 +0,0 @@
|
||||
#include <asm-generic/div64.h>
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef _ASM_EMERGENCY_RESTART_H
|
||||
#define _ASM_EMERGENCY_RESTART_H
|
||||
|
||||
#include <asm-generic/emergency-restart.h>
|
||||
|
||||
#endif /* _ASM_EMERGENCY_RESTART_H */
|
||||
@@ -1,18 +0,0 @@
|
||||
#ifndef _PPC64_ERRNO_H
|
||||
#define _PPC64_ERRNO_H
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include <asm-generic/errno.h>
|
||||
|
||||
#undef EDEADLOCK
|
||||
#define EDEADLOCK 58 /* File locking deadlock error */
|
||||
|
||||
#define _LAST_ERRNO 516
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* include/asm-ppc64/firmware.h
|
||||
*
|
||||
* Extracted from include/asm-ppc64/cputable.h
|
||||
*
|
||||
* Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
|
||||
*
|
||||
* Modifications for ppc64:
|
||||
* Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
#ifndef __ASM_PPC_FIRMWARE_H
|
||||
#define __ASM_PPC_FIRMWARE_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* firmware feature bitmask values */
|
||||
#define FIRMWARE_MAX_FEATURES 63
|
||||
|
||||
#define FW_FEATURE_PFT (1UL<<0)
|
||||
#define FW_FEATURE_TCE (1UL<<1)
|
||||
#define FW_FEATURE_SPRG0 (1UL<<2)
|
||||
#define FW_FEATURE_DABR (1UL<<3)
|
||||
#define FW_FEATURE_COPY (1UL<<4)
|
||||
#define FW_FEATURE_ASR (1UL<<5)
|
||||
#define FW_FEATURE_DEBUG (1UL<<6)
|
||||
#define FW_FEATURE_TERM (1UL<<7)
|
||||
#define FW_FEATURE_PERF (1UL<<8)
|
||||
#define FW_FEATURE_DUMP (1UL<<9)
|
||||
#define FW_FEATURE_INTERRUPT (1UL<<10)
|
||||
#define FW_FEATURE_MIGRATE (1UL<<11)
|
||||
#define FW_FEATURE_PERFMON (1UL<<12)
|
||||
#define FW_FEATURE_CRQ (1UL<<13)
|
||||
#define FW_FEATURE_VIO (1UL<<14)
|
||||
#define FW_FEATURE_RDMA (1UL<<15)
|
||||
#define FW_FEATURE_LLAN (1UL<<16)
|
||||
#define FW_FEATURE_BULK (1UL<<17)
|
||||
#define FW_FEATURE_XDABR (1UL<<18)
|
||||
#define FW_FEATURE_MULTITCE (1UL<<19)
|
||||
#define FW_FEATURE_SPLPAR (1UL<<20)
|
||||
#define FW_FEATURE_ISERIES (1UL<<21)
|
||||
|
||||
enum {
|
||||
FW_FEATURE_PSERIES_POSSIBLE = FW_FEATURE_PFT | FW_FEATURE_TCE |
|
||||
FW_FEATURE_SPRG0 | FW_FEATURE_DABR | FW_FEATURE_COPY |
|
||||
FW_FEATURE_ASR | FW_FEATURE_DEBUG | FW_FEATURE_TERM |
|
||||
FW_FEATURE_PERF | FW_FEATURE_DUMP | FW_FEATURE_INTERRUPT |
|
||||
FW_FEATURE_MIGRATE | FW_FEATURE_PERFMON | FW_FEATURE_CRQ |
|
||||
FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN |
|
||||
FW_FEATURE_BULK | FW_FEATURE_XDABR | FW_FEATURE_MULTITCE |
|
||||
FW_FEATURE_SPLPAR,
|
||||
FW_FEATURE_PSERIES_ALWAYS = 0,
|
||||
FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES,
|
||||
FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES,
|
||||
FW_FEATURE_POSSIBLE =
|
||||
#ifdef CONFIG_PPC_PSERIES
|
||||
FW_FEATURE_PSERIES_POSSIBLE |
|
||||
#endif
|
||||
#ifdef CONFIG_PPC_ISERIES
|
||||
FW_FEATURE_ISERIES_POSSIBLE |
|
||||
#endif
|
||||
0,
|
||||
FW_FEATURE_ALWAYS =
|
||||
#ifdef CONFIG_PPC_PSERIES
|
||||
FW_FEATURE_PSERIES_ALWAYS &
|
||||
#endif
|
||||
#ifdef CONFIG_PPC_ISERIES
|
||||
FW_FEATURE_ISERIES_ALWAYS &
|
||||
#endif
|
||||
FW_FEATURE_POSSIBLE,
|
||||
};
|
||||
|
||||
/* This is used to identify firmware features which are available
|
||||
* to the kernel.
|
||||
*/
|
||||
extern unsigned long ppc64_firmware_features;
|
||||
|
||||
static inline unsigned long firmware_has_feature(unsigned long feature)
|
||||
{
|
||||
return (FW_FEATURE_ALWAYS & feature) ||
|
||||
(FW_FEATURE_POSSIBLE & ppc64_firmware_features & feature);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PPC_PSERIES
|
||||
typedef struct {
|
||||
unsigned long val;
|
||||
char * name;
|
||||
} firmware_feature_t;
|
||||
|
||||
extern firmware_feature_t firmware_features_table[];
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __ASM_PPC_FIRMWARE_H */
|
||||
@@ -1 +0,0 @@
|
||||
#include <asm-generic/hdreg.h>
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
#define PHBS_IO_BASE VMALLOC_END
|
||||
#define IMALLOC_BASE (PHBS_IO_BASE + 0x80000000ul) /* Reserve 2 gigs for PHBs */
|
||||
#define IMALLOC_END (VMALLOC_START + EADDR_MASK)
|
||||
#define IMALLOC_END (VMALLOC_START + PGTABLE_RANGE)
|
||||
|
||||
|
||||
/* imalloc region types */
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
#ifndef _PPC64_IOCTL_H
|
||||
#define _PPC64_IOCTL_H
|
||||
|
||||
|
||||
/*
|
||||
* This was copied from the alpha as it's a bit cleaner there.
|
||||
* -- Cort
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#define _IOC_NRBITS 8
|
||||
#define _IOC_TYPEBITS 8
|
||||
#define _IOC_SIZEBITS 13
|
||||
#define _IOC_DIRBITS 3
|
||||
|
||||
#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
|
||||
#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
|
||||
#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
|
||||
#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
|
||||
|
||||
#define _IOC_NRSHIFT 0
|
||||
#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
|
||||
#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
|
||||
#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
|
||||
|
||||
/*
|
||||
* Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit.
|
||||
* And this turns out useful to catch old ioctl numbers in header
|
||||
* files for us.
|
||||
*/
|
||||
#define _IOC_NONE 1U
|
||||
#define _IOC_READ 2U
|
||||
#define _IOC_WRITE 4U
|
||||
|
||||
#define _IOC(dir,type,nr,size) \
|
||||
(((dir) << _IOC_DIRSHIFT) | \
|
||||
((type) << _IOC_TYPESHIFT) | \
|
||||
((nr) << _IOC_NRSHIFT) | \
|
||||
((size) << _IOC_SIZESHIFT))
|
||||
|
||||
/* provoke compile error for invalid uses of size argument */
|
||||
extern unsigned int __invalid_size_argument_for_IOC;
|
||||
#define _IOC_TYPECHECK(t) \
|
||||
((sizeof(t) == sizeof(t[1]) && \
|
||||
sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
|
||||
sizeof(t) : __invalid_size_argument_for_IOC)
|
||||
|
||||
/* used to create numbers */
|
||||
#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
|
||||
#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
|
||||
#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
|
||||
#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
|
||||
#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
|
||||
#define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
|
||||
#define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
|
||||
|
||||
/* used to decode them.. */
|
||||
#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
|
||||
#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
|
||||
#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
|
||||
#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
|
||||
|
||||
/* various drivers, such as the pcmcia stuff, need these... */
|
||||
#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
|
||||
#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
|
||||
#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
|
||||
#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
|
||||
#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
|
||||
|
||||
#endif /* _PPC64_IOCTL_H */
|
||||
@@ -1,114 +0,0 @@
|
||||
#ifndef _ASM_PPC64_IOCTLS_H
|
||||
#define _ASM_PPC64_IOCTLS_H
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include <asm/ioctl.h>
|
||||
|
||||
#define FIOCLEX _IO('f', 1)
|
||||
#define FIONCLEX _IO('f', 2)
|
||||
#define FIOASYNC _IOW('f', 125, int)
|
||||
#define FIONBIO _IOW('f', 126, int)
|
||||
#define FIONREAD _IOR('f', 127, int)
|
||||
#define TIOCINQ FIONREAD
|
||||
#define FIOQSIZE _IOR('f', 128, loff_t)
|
||||
|
||||
#define TIOCGETP _IOR('t', 8, struct sgttyb)
|
||||
#define TIOCSETP _IOW('t', 9, struct sgttyb)
|
||||
#define TIOCSETN _IOW('t', 10, struct sgttyb) /* TIOCSETP wo flush */
|
||||
|
||||
#define TIOCSETC _IOW('t', 17, struct tchars)
|
||||
#define TIOCGETC _IOR('t', 18, struct tchars)
|
||||
#define TCGETS _IOR('t', 19, struct termios)
|
||||
#define TCSETS _IOW('t', 20, struct termios)
|
||||
#define TCSETSW _IOW('t', 21, struct termios)
|
||||
#define TCSETSF _IOW('t', 22, struct termios)
|
||||
|
||||
#define TCGETA _IOR('t', 23, struct termio)
|
||||
#define TCSETA _IOW('t', 24, struct termio)
|
||||
#define TCSETAW _IOW('t', 25, struct termio)
|
||||
#define TCSETAF _IOW('t', 28, struct termio)
|
||||
|
||||
#define TCSBRK _IO('t', 29)
|
||||
#define TCXONC _IO('t', 30)
|
||||
#define TCFLSH _IO('t', 31)
|
||||
|
||||
#define TIOCSWINSZ _IOW('t', 103, struct winsize)
|
||||
#define TIOCGWINSZ _IOR('t', 104, struct winsize)
|
||||
#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
|
||||
#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
|
||||
#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
|
||||
|
||||
#define TIOCGLTC _IOR('t', 116, struct ltchars)
|
||||
#define TIOCSLTC _IOW('t', 117, struct ltchars)
|
||||
#define TIOCSPGRP _IOW('t', 118, int)
|
||||
#define TIOCGPGRP _IOR('t', 119, int)
|
||||
|
||||
#define TIOCEXCL 0x540C
|
||||
#define TIOCNXCL 0x540D
|
||||
#define TIOCSCTTY 0x540E
|
||||
|
||||
#define TIOCSTI 0x5412
|
||||
#define TIOCMGET 0x5415
|
||||
#define TIOCMBIS 0x5416
|
||||
#define TIOCMBIC 0x5417
|
||||
#define TIOCMSET 0x5418
|
||||
# define TIOCM_LE 0x001
|
||||
# define TIOCM_DTR 0x002
|
||||
# define TIOCM_RTS 0x004
|
||||
# define TIOCM_ST 0x008
|
||||
# define TIOCM_SR 0x010
|
||||
# define TIOCM_CTS 0x020
|
||||
# define TIOCM_CAR 0x040
|
||||
# define TIOCM_RNG 0x080
|
||||
# define TIOCM_DSR 0x100
|
||||
# define TIOCM_CD TIOCM_CAR
|
||||
# define TIOCM_RI TIOCM_RNG
|
||||
|
||||
#define TIOCGSOFTCAR 0x5419
|
||||
#define TIOCSSOFTCAR 0x541A
|
||||
#define TIOCLINUX 0x541C
|
||||
#define TIOCCONS 0x541D
|
||||
#define TIOCGSERIAL 0x541E
|
||||
#define TIOCSSERIAL 0x541F
|
||||
#define TIOCPKT 0x5420
|
||||
# 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 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 TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
|
||||
#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
|
||||
|
||||
#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 */
|
||||
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
|
||||
# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
|
||||
#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 */
|
||||
|
||||
#endif /* _ASM_PPC64_IOCTLS_H */
|
||||
@@ -104,9 +104,6 @@ extern void iommu_devnode_init_pSeries(struct device_node *dn);
|
||||
|
||||
#ifdef CONFIG_PPC_ISERIES
|
||||
|
||||
/* Initializes tables for bio buses */
|
||||
extern void __init iommu_vio_init(void);
|
||||
|
||||
struct iSeries_Device_Node;
|
||||
/* Creates table for an individual device node */
|
||||
extern void iommu_devnode_init_iSeries(struct iSeries_Device_Node *dn);
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#include <asm-generic/ipc.h>
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef __ASM_LINKAGE_H
|
||||
#define __ASM_LINKAGE_H
|
||||
|
||||
/* Nothing to see here... */
|
||||
|
||||
#endif
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
struct lmb_property {
|
||||
unsigned long base;
|
||||
unsigned long physbase;
|
||||
unsigned long size;
|
||||
};
|
||||
|
||||
|
||||
@@ -140,6 +140,9 @@ struct machdep_calls {
|
||||
|
||||
/* Idle loop for this platform, leave empty for default idle loop */
|
||||
int (*idle_loop)(void);
|
||||
|
||||
/* Function to enable pmcs for this platform, called once per cpu. */
|
||||
void (*enable_pmcs)(void);
|
||||
};
|
||||
|
||||
extern int default_idle(void);
|
||||
|
||||
+10
-6
@@ -28,9 +28,12 @@
|
||||
#define STE_VSID_SHIFT 12
|
||||
|
||||
/* Location of cpu0's segment table */
|
||||
#define STAB0_PAGE 0x9
|
||||
#define STAB0_PAGE 0x6
|
||||
#define STAB0_PHYS_ADDR (STAB0_PAGE<<PAGE_SHIFT)
|
||||
#define STAB0_VIRT_ADDR (KERNELBASE+STAB0_PHYS_ADDR)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
extern char initial_stab[];
|
||||
#endif /* ! __ASSEMBLY */
|
||||
|
||||
/*
|
||||
* SLB
|
||||
@@ -259,8 +262,10 @@ extern void stabs_alloc(void);
|
||||
#define VSID_BITS 36
|
||||
#define VSID_MODULUS ((1UL<<VSID_BITS)-1)
|
||||
|
||||
#define CONTEXT_BITS 20
|
||||
#define USER_ESID_BITS 15
|
||||
#define CONTEXT_BITS 19
|
||||
#define USER_ESID_BITS 16
|
||||
|
||||
#define USER_VSID_RANGE (1UL << (USER_ESID_BITS + SID_SHIFT))
|
||||
|
||||
/*
|
||||
* This macro generates asm code to compute the VSID scramble
|
||||
@@ -302,8 +307,7 @@ typedef unsigned long mm_context_id_t;
|
||||
typedef struct {
|
||||
mm_context_id_t id;
|
||||
#ifdef CONFIG_HUGETLB_PAGE
|
||||
pgd_t *huge_pgdir;
|
||||
u16 htlb_segs; /* bitmask */
|
||||
u16 low_htlb_areas, high_htlb_areas;
|
||||
#endif
|
||||
} mm_context_t;
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
|
||||
#include <asm/types.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
struct naca_struct {
|
||||
/* Kernel only data - undefined for user space */
|
||||
void *xItVpdAreas; /* VPD Data 0x00 */
|
||||
@@ -23,9 +21,4 @@ struct naca_struct {
|
||||
|
||||
extern struct naca_struct naca;
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#define NACA_PAGE 0x4
|
||||
#define NACA_PHYS_ADDR (NACA_PAGE<<PAGE_SHIFT)
|
||||
|
||||
#endif /* _NACA_H */
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* linux/include/asm-ppc/namei.h
|
||||
* Adapted from linux/include/asm-alpha/namei.h
|
||||
*
|
||||
* Included from linux/fs/namei.c
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef __PPC64_NAMEI_H
|
||||
#define __PPC64_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 /* __PPC64_NAMEI_H */
|
||||
+32
-23
@@ -37,39 +37,45 @@
|
||||
|
||||
#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
|
||||
|
||||
/* For 64-bit processes the hugepage range is 1T-1.5T */
|
||||
#define TASK_HPAGE_BASE ASM_CONST(0x0000010000000000)
|
||||
#define TASK_HPAGE_END ASM_CONST(0x0000018000000000)
|
||||
#define HTLB_AREA_SHIFT 40
|
||||
#define HTLB_AREA_SIZE (1UL << HTLB_AREA_SHIFT)
|
||||
#define GET_HTLB_AREA(x) ((x) >> HTLB_AREA_SHIFT)
|
||||
|
||||
#define LOW_ESID_MASK(addr, len) (((1U << (GET_ESID(addr+len-1)+1)) \
|
||||
- (1U << GET_ESID(addr))) & 0xffff)
|
||||
#define HTLB_AREA_MASK(addr, len) (((1U << (GET_HTLB_AREA(addr+len-1)+1)) \
|
||||
- (1U << GET_HTLB_AREA(addr))) & 0xffff)
|
||||
|
||||
#define ARCH_HAS_HUGEPAGE_ONLY_RANGE
|
||||
#define ARCH_HAS_PREPARE_HUGEPAGE_RANGE
|
||||
#define ARCH_HAS_SETCLEAR_HUGE_PTE
|
||||
|
||||
#define touches_hugepage_low_range(mm, addr, len) \
|
||||
(LOW_ESID_MASK((addr), (len)) & mm->context.htlb_segs)
|
||||
#define touches_hugepage_high_range(addr, len) \
|
||||
(((addr) > (TASK_HPAGE_BASE-(len))) && ((addr) < TASK_HPAGE_END))
|
||||
(LOW_ESID_MASK((addr), (len)) & (mm)->context.low_htlb_areas)
|
||||
#define touches_hugepage_high_range(mm, addr, len) \
|
||||
(HTLB_AREA_MASK((addr), (len)) & (mm)->context.high_htlb_areas)
|
||||
|
||||
#define __within_hugepage_low_range(addr, len, segmask) \
|
||||
((LOW_ESID_MASK((addr), (len)) | (segmask)) == (segmask))
|
||||
#define within_hugepage_low_range(addr, len) \
|
||||
__within_hugepage_low_range((addr), (len), \
|
||||
current->mm->context.htlb_segs)
|
||||
#define within_hugepage_high_range(addr, len) (((addr) >= TASK_HPAGE_BASE) \
|
||||
&& ((addr)+(len) <= TASK_HPAGE_END) && ((addr)+(len) >= (addr)))
|
||||
current->mm->context.low_htlb_areas)
|
||||
#define __within_hugepage_high_range(addr, len, zonemask) \
|
||||
((HTLB_AREA_MASK((addr), (len)) | (zonemask)) == (zonemask))
|
||||
#define within_hugepage_high_range(addr, len) \
|
||||
__within_hugepage_high_range((addr), (len), \
|
||||
current->mm->context.high_htlb_areas)
|
||||
|
||||
#define is_hugepage_only_range(mm, addr, len) \
|
||||
(touches_hugepage_high_range((addr), (len)) || \
|
||||
(touches_hugepage_high_range((mm), (addr), (len)) || \
|
||||
touches_hugepage_low_range((mm), (addr), (len)))
|
||||
#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
|
||||
|
||||
#define in_hugepage_area(context, addr) \
|
||||
(cpu_has_feature(CPU_FTR_16M_PAGE) && \
|
||||
( (((addr) >= TASK_HPAGE_BASE) && ((addr) < TASK_HPAGE_END)) || \
|
||||
( ((1 << GET_HTLB_AREA(addr)) & (context).high_htlb_areas) || \
|
||||
( ((addr) < 0x100000000L) && \
|
||||
((1 << GET_ESID(addr)) & (context).htlb_segs) ) ) )
|
||||
((1 << GET_ESID(addr)) & (context).low_htlb_areas) ) ) )
|
||||
|
||||
#else /* !CONFIG_HUGETLB_PAGE */
|
||||
|
||||
@@ -125,36 +131,42 @@ extern void copy_user_page(void *to, void *from, unsigned long vaddr, struct pag
|
||||
* Entries in the pte table are 64b, while entries in the pgd & pmd are 32b.
|
||||
*/
|
||||
typedef struct { unsigned long pte; } pte_t;
|
||||
typedef struct { unsigned int pmd; } pmd_t;
|
||||
typedef struct { unsigned int pgd; } pgd_t;
|
||||
typedef struct { unsigned long pmd; } pmd_t;
|
||||
typedef struct { unsigned long pud; } pud_t;
|
||||
typedef struct { unsigned long pgd; } pgd_t;
|
||||
typedef struct { unsigned long pgprot; } pgprot_t;
|
||||
|
||||
#define pte_val(x) ((x).pte)
|
||||
#define pmd_val(x) ((x).pmd)
|
||||
#define pud_val(x) ((x).pud)
|
||||
#define pgd_val(x) ((x).pgd)
|
||||
#define pgprot_val(x) ((x).pgprot)
|
||||
|
||||
#define __pte(x) ((pte_t) { (x) } )
|
||||
#define __pmd(x) ((pmd_t) { (x) } )
|
||||
#define __pgd(x) ((pgd_t) { (x) } )
|
||||
#define __pgprot(x) ((pgprot_t) { (x) } )
|
||||
#define __pte(x) ((pte_t) { (x) })
|
||||
#define __pmd(x) ((pmd_t) { (x) })
|
||||
#define __pud(x) ((pud_t) { (x) })
|
||||
#define __pgd(x) ((pgd_t) { (x) })
|
||||
#define __pgprot(x) ((pgprot_t) { (x) })
|
||||
|
||||
#else
|
||||
/*
|
||||
* .. while these make it easier on the compiler
|
||||
*/
|
||||
typedef unsigned long pte_t;
|
||||
typedef unsigned int pmd_t;
|
||||
typedef unsigned int pgd_t;
|
||||
typedef unsigned long pmd_t;
|
||||
typedef unsigned long pud_t;
|
||||
typedef unsigned long pgd_t;
|
||||
typedef unsigned long pgprot_t;
|
||||
|
||||
#define pte_val(x) (x)
|
||||
#define pmd_val(x) (x)
|
||||
#define pud_val(x) (x)
|
||||
#define pgd_val(x) (x)
|
||||
#define pgprot_val(x) (x)
|
||||
|
||||
#define __pte(x) (x)
|
||||
#define __pmd(x) (x)
|
||||
#define __pud(x) (x)
|
||||
#define __pgd(x) (x)
|
||||
#define __pgprot(x) (x)
|
||||
|
||||
@@ -208,9 +220,6 @@ extern u64 ppc64_pft_size; /* Log 2 of page table size */
|
||||
#define USER_REGION_ID (0UL)
|
||||
#define REGION_ID(ea) (((unsigned long)(ea)) >> REGION_SHIFT)
|
||||
|
||||
#define __bpn_to_ba(x) ((((unsigned long)(x)) << PAGE_SHIFT) + KERNELBASE)
|
||||
#define __ba_to_bpn(x) ((((unsigned long)(x)) & ~REGION_MASK) >> PAGE_SHIFT)
|
||||
|
||||
#define __va(x) ((void *)((unsigned long)(x) + KERNELBASE))
|
||||
|
||||
#ifdef CONFIG_DISCONTIGMEM
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef _ASM_PPC64_PARAM_H
|
||||
#define _ASM_PPC64_PARAM_H
|
||||
|
||||
#include <linux/config.h>
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -9,7 +11,7 @@
|
||||
*/
|
||||
|
||||
#ifdef __KERNEL__
|
||||
# define HZ 1000 /* Internal kernel timer frequency */
|
||||
# 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
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef __ARCH_PPC64_PERCPU__
|
||||
#define __ARCH_PPC64_PERCPU__
|
||||
|
||||
#include <asm-generic/percpu.h>
|
||||
|
||||
#endif /* __ARCH_PPC64_PERCPU__ */
|
||||
+61
-32
@@ -6,7 +6,12 @@
|
||||
#include <linux/cpumask.h>
|
||||
#include <linux/percpu.h>
|
||||
|
||||
extern kmem_cache_t *zero_cache;
|
||||
extern kmem_cache_t *pgtable_cache[];
|
||||
|
||||
#define PTE_CACHE_NUM 0
|
||||
#define PMD_CACHE_NUM 1
|
||||
#define PUD_CACHE_NUM 1
|
||||
#define PGD_CACHE_NUM 0
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -15,30 +20,40 @@ extern kmem_cache_t *zero_cache;
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
static inline pgd_t *
|
||||
pgd_alloc(struct mm_struct *mm)
|
||||
static inline pgd_t *pgd_alloc(struct mm_struct *mm)
|
||||
{
|
||||
return kmem_cache_alloc(zero_cache, GFP_KERNEL);
|
||||
return kmem_cache_alloc(pgtable_cache[PGD_CACHE_NUM], GFP_KERNEL);
|
||||
}
|
||||
|
||||
static inline void
|
||||
pgd_free(pgd_t *pgd)
|
||||
static inline void pgd_free(pgd_t *pgd)
|
||||
{
|
||||
kmem_cache_free(zero_cache, pgd);
|
||||
kmem_cache_free(pgtable_cache[PGD_CACHE_NUM], pgd);
|
||||
}
|
||||
|
||||
#define pgd_populate(MM, PGD, PUD) pgd_set(PGD, PUD)
|
||||
|
||||
static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
|
||||
{
|
||||
return kmem_cache_alloc(pgtable_cache[PUD_CACHE_NUM],
|
||||
GFP_KERNEL|__GFP_REPEAT);
|
||||
}
|
||||
|
||||
static inline void pud_free(pud_t *pud)
|
||||
{
|
||||
kmem_cache_free(pgtable_cache[PUD_CACHE_NUM], pud);
|
||||
}
|
||||
|
||||
#define pud_populate(MM, PUD, PMD) pud_set(PUD, PMD)
|
||||
|
||||
static inline pmd_t *
|
||||
pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
|
||||
static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
|
||||
{
|
||||
return kmem_cache_alloc(zero_cache, GFP_KERNEL|__GFP_REPEAT);
|
||||
return kmem_cache_alloc(pgtable_cache[PMD_CACHE_NUM],
|
||||
GFP_KERNEL|__GFP_REPEAT);
|
||||
}
|
||||
|
||||
static inline void
|
||||
pmd_free(pmd_t *pmd)
|
||||
static inline void pmd_free(pmd_t *pmd)
|
||||
{
|
||||
kmem_cache_free(zero_cache, pmd);
|
||||
kmem_cache_free(pgtable_cache[PMD_CACHE_NUM], pmd);
|
||||
}
|
||||
|
||||
#define pmd_populate_kernel(mm, pmd, pte) pmd_set(pmd, pte)
|
||||
@@ -47,44 +62,58 @@ pmd_free(pmd_t *pmd)
|
||||
|
||||
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
|
||||
{
|
||||
return kmem_cache_alloc(zero_cache, GFP_KERNEL|__GFP_REPEAT);
|
||||
return kmem_cache_alloc(pgtable_cache[PTE_CACHE_NUM],
|
||||
GFP_KERNEL|__GFP_REPEAT);
|
||||
}
|
||||
|
||||
static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
|
||||
{
|
||||
pte_t *pte = kmem_cache_alloc(zero_cache, GFP_KERNEL|__GFP_REPEAT);
|
||||
if (pte)
|
||||
return virt_to_page(pte);
|
||||
return NULL;
|
||||
return virt_to_page(pte_alloc_one_kernel(mm, address));
|
||||
}
|
||||
|
||||
static inline void pte_free_kernel(pte_t *pte)
|
||||
{
|
||||
kmem_cache_free(zero_cache, pte);
|
||||
kmem_cache_free(pgtable_cache[PTE_CACHE_NUM], pte);
|
||||
}
|
||||
|
||||
static inline void pte_free(struct page *ptepage)
|
||||
{
|
||||
kmem_cache_free(zero_cache, page_address(ptepage));
|
||||
pte_free_kernel(page_address(ptepage));
|
||||
}
|
||||
|
||||
struct pte_freelist_batch
|
||||
#define PGF_CACHENUM_MASK 0xf
|
||||
|
||||
typedef struct pgtable_free {
|
||||
unsigned long val;
|
||||
} pgtable_free_t;
|
||||
|
||||
static inline pgtable_free_t pgtable_free_cache(void *p, int cachenum,
|
||||
unsigned long mask)
|
||||
{
|
||||
struct rcu_head rcu;
|
||||
unsigned int index;
|
||||
struct page * pages[0];
|
||||
};
|
||||
BUG_ON(cachenum > PGF_CACHENUM_MASK);
|
||||
|
||||
#define PTE_FREELIST_SIZE ((PAGE_SIZE - sizeof(struct pte_freelist_batch)) / \
|
||||
sizeof(struct page *))
|
||||
return (pgtable_free_t){.val = ((unsigned long) p & ~mask) | cachenum};
|
||||
}
|
||||
|
||||
extern void pte_free_now(struct page *ptepage);
|
||||
extern void pte_free_submit(struct pte_freelist_batch *batch);
|
||||
static inline void pgtable_free(pgtable_free_t pgf)
|
||||
{
|
||||
void *p = (void *)(pgf.val & ~PGF_CACHENUM_MASK);
|
||||
int cachenum = pgf.val & PGF_CACHENUM_MASK;
|
||||
|
||||
DECLARE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur);
|
||||
kmem_cache_free(pgtable_cache[cachenum], p);
|
||||
}
|
||||
|
||||
void __pte_free_tlb(struct mmu_gather *tlb, struct page *ptepage);
|
||||
#define __pmd_free_tlb(tlb, pmd) __pte_free_tlb(tlb, virt_to_page(pmd))
|
||||
void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf);
|
||||
|
||||
#define __pte_free_tlb(tlb, ptepage) \
|
||||
pgtable_free_tlb(tlb, pgtable_free_cache(page_address(ptepage), \
|
||||
PTE_CACHE_NUM, PTE_TABLE_SIZE-1))
|
||||
#define __pmd_free_tlb(tlb, pmd) \
|
||||
pgtable_free_tlb(tlb, pgtable_free_cache(pmd, \
|
||||
PMD_CACHE_NUM, PMD_TABLE_SIZE-1))
|
||||
#define __pud_free_tlb(tlb, pmd) \
|
||||
pgtable_free_tlb(tlb, pgtable_free_cache(pud, \
|
||||
PUD_CACHE_NUM, PUD_TABLE_SIZE-1))
|
||||
|
||||
#define check_pgt_cache() do { } while (0)
|
||||
|
||||
|
||||
+56
-38
@@ -15,19 +15,24 @@
|
||||
#include <asm/tlbflush.h>
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#include <asm-generic/pgtable-nopud.h>
|
||||
|
||||
/*
|
||||
* Entries per page directory level. The PTE level must use a 64b record
|
||||
* for each page table entry. The PMD and PGD level use a 32b record for
|
||||
* each entry by assuming that each entry is page aligned.
|
||||
*/
|
||||
#define PTE_INDEX_SIZE 9
|
||||
#define PMD_INDEX_SIZE 10
|
||||
#define PGD_INDEX_SIZE 10
|
||||
#define PMD_INDEX_SIZE 7
|
||||
#define PUD_INDEX_SIZE 7
|
||||
#define PGD_INDEX_SIZE 9
|
||||
|
||||
#define PTE_TABLE_SIZE (sizeof(pte_t) << PTE_INDEX_SIZE)
|
||||
#define PMD_TABLE_SIZE (sizeof(pmd_t) << PMD_INDEX_SIZE)
|
||||
#define PUD_TABLE_SIZE (sizeof(pud_t) << PUD_INDEX_SIZE)
|
||||
#define PGD_TABLE_SIZE (sizeof(pgd_t) << PGD_INDEX_SIZE)
|
||||
|
||||
#define PTRS_PER_PTE (1 << PTE_INDEX_SIZE)
|
||||
#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE)
|
||||
#define PTRS_PER_PUD (1 << PMD_INDEX_SIZE)
|
||||
#define PTRS_PER_PGD (1 << PGD_INDEX_SIZE)
|
||||
|
||||
/* PMD_SHIFT determines what a second-level page table entry can map */
|
||||
@@ -35,8 +40,13 @@
|
||||
#define PMD_SIZE (1UL << PMD_SHIFT)
|
||||
#define PMD_MASK (~(PMD_SIZE-1))
|
||||
|
||||
/* PGDIR_SHIFT determines what a third-level page table entry can map */
|
||||
#define PGDIR_SHIFT (PMD_SHIFT + PMD_INDEX_SIZE)
|
||||
/* PUD_SHIFT determines what a third-level page table entry can map */
|
||||
#define PUD_SHIFT (PMD_SHIFT + PMD_INDEX_SIZE)
|
||||
#define PUD_SIZE (1UL << PUD_SHIFT)
|
||||
#define PUD_MASK (~(PUD_SIZE-1))
|
||||
|
||||
/* PGDIR_SHIFT determines what a fourth-level page table entry can map */
|
||||
#define PGDIR_SHIFT (PUD_SHIFT + PUD_INDEX_SIZE)
|
||||
#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
|
||||
#define PGDIR_MASK (~(PGDIR_SIZE-1))
|
||||
|
||||
@@ -45,15 +55,23 @@
|
||||
/*
|
||||
* Size of EA range mapped by our pagetables.
|
||||
*/
|
||||
#define EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \
|
||||
PGD_INDEX_SIZE + PAGE_SHIFT)
|
||||
#define EADDR_MASK ((1UL << EADDR_SIZE) - 1)
|
||||
#define PGTABLE_EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \
|
||||
PUD_INDEX_SIZE + PGD_INDEX_SIZE + PAGE_SHIFT)
|
||||
#define PGTABLE_RANGE (1UL << PGTABLE_EADDR_SIZE)
|
||||
|
||||
#if TASK_SIZE_USER64 > PGTABLE_RANGE
|
||||
#error TASK_SIZE_USER64 exceeds pagetable range
|
||||
#endif
|
||||
|
||||
#if TASK_SIZE_USER64 > (1UL << (USER_ESID_BITS + SID_SHIFT))
|
||||
#error TASK_SIZE_USER64 exceeds user VSID range
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define the address range of the vmalloc VM area.
|
||||
*/
|
||||
#define VMALLOC_START (0xD000000000000000ul)
|
||||
#define VMALLOC_SIZE (0x10000000000UL)
|
||||
#define VMALLOC_SIZE (0x80000000000UL)
|
||||
#define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE)
|
||||
|
||||
/*
|
||||
@@ -154,8 +172,6 @@ extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
|
||||
#ifndef __ASSEMBLY__
|
||||
int hash_huge_page(struct mm_struct *mm, unsigned long access,
|
||||
unsigned long ea, unsigned long vsid, int local);
|
||||
|
||||
void hugetlb_mm_free_pgd(struct mm_struct *mm);
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#define HAVE_ARCH_UNMAPPED_AREA
|
||||
@@ -163,7 +179,6 @@ void hugetlb_mm_free_pgd(struct mm_struct *mm);
|
||||
#else
|
||||
|
||||
#define hash_huge_page(mm,a,ea,vsid,local) -1
|
||||
#define hugetlb_mm_free_pgd(mm) do {} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -197,39 +212,45 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
|
||||
#define pte_pfn(x) ((unsigned long)((pte_val(x) >> PTE_SHIFT)))
|
||||
#define pte_page(x) pfn_to_page(pte_pfn(x))
|
||||
|
||||
#define pmd_set(pmdp, ptep) \
|
||||
(pmd_val(*(pmdp)) = __ba_to_bpn(ptep))
|
||||
#define pmd_set(pmdp, ptep) ({BUG_ON((u64)ptep < KERNELBASE); pmd_val(*(pmdp)) = (unsigned long)(ptep);})
|
||||
#define pmd_none(pmd) (!pmd_val(pmd))
|
||||
#define pmd_bad(pmd) (pmd_val(pmd) == 0)
|
||||
#define pmd_present(pmd) (pmd_val(pmd) != 0)
|
||||
#define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0)
|
||||
#define pmd_page_kernel(pmd) (__bpn_to_ba(pmd_val(pmd)))
|
||||
#define pmd_page_kernel(pmd) (pmd_val(pmd))
|
||||
#define pmd_page(pmd) virt_to_page(pmd_page_kernel(pmd))
|
||||
|
||||
#define pud_set(pudp, pmdp) (pud_val(*(pudp)) = (__ba_to_bpn(pmdp)))
|
||||
#define pud_set(pudp, pmdp) (pud_val(*(pudp)) = (unsigned long)(pmdp))
|
||||
#define pud_none(pud) (!pud_val(pud))
|
||||
#define pud_bad(pud) ((pud_val(pud)) == 0UL)
|
||||
#define pud_present(pud) (pud_val(pud) != 0UL)
|
||||
#define pud_clear(pudp) (pud_val(*(pudp)) = 0UL)
|
||||
#define pud_page(pud) (__bpn_to_ba(pud_val(pud)))
|
||||
#define pud_bad(pud) ((pud_val(pud)) == 0)
|
||||
#define pud_present(pud) (pud_val(pud) != 0)
|
||||
#define pud_clear(pudp) (pud_val(*(pudp)) = 0)
|
||||
#define pud_page(pud) (pud_val(pud))
|
||||
|
||||
#define pgd_set(pgdp, pudp) ({pgd_val(*(pgdp)) = (unsigned long)(pudp);})
|
||||
#define pgd_none(pgd) (!pgd_val(pgd))
|
||||
#define pgd_bad(pgd) (pgd_val(pgd) == 0)
|
||||
#define pgd_present(pgd) (pgd_val(pgd) != 0)
|
||||
#define pgd_clear(pgdp) (pgd_val(*(pgdp)) = 0)
|
||||
#define pgd_page(pgd) (pgd_val(pgd))
|
||||
|
||||
/*
|
||||
* Find an entry in a page-table-directory. We combine the address region
|
||||
* (the high order N bits) and the pgd portion of the address.
|
||||
*/
|
||||
/* to avoid overflow in free_pgtables we don't use PTRS_PER_PGD here */
|
||||
#define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & 0x7ff)
|
||||
#define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & 0x1ff)
|
||||
|
||||
#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
|
||||
|
||||
/* Find an entry in the second-level page table.. */
|
||||
#define pmd_offset(pudp,addr) \
|
||||
((pmd_t *) pud_page(*(pudp)) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
|
||||
#define pud_offset(pgdp, addr) \
|
||||
(((pud_t *) pgd_page(*(pgdp))) + (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1)))
|
||||
|
||||
#define pmd_offset(pudp,addr) \
|
||||
(((pmd_t *) pud_page(*(pudp))) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
|
||||
|
||||
/* Find an entry in the third-level page table.. */
|
||||
#define pte_offset_kernel(dir,addr) \
|
||||
((pte_t *) pmd_page_kernel(*(dir)) \
|
||||
+ (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
|
||||
(((pte_t *) pmd_page_kernel(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
|
||||
|
||||
#define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr))
|
||||
#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir), (addr))
|
||||
@@ -458,23 +479,20 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long addr,
|
||||
#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0)
|
||||
|
||||
#define pmd_ERROR(e) \
|
||||
printk("%s:%d: bad pmd %08x.\n", __FILE__, __LINE__, pmd_val(e))
|
||||
printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
|
||||
#define pud_ERROR(e) \
|
||||
printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pud_val(e))
|
||||
#define pgd_ERROR(e) \
|
||||
printk("%s:%d: bad pgd %08x.\n", __FILE__, __LINE__, pgd_val(e))
|
||||
printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
|
||||
|
||||
extern pgd_t swapper_pg_dir[];
|
||||
|
||||
extern void paging_init(void);
|
||||
|
||||
/*
|
||||
* Because the huge pgtables are only 2 level, they can take
|
||||
* at most around 4M, much less than one hugepage which the
|
||||
* process is presumably entitled to use. So we don't bother
|
||||
* freeing up the pagetables on unmap, and wait until
|
||||
* destroy_context() to clean up the lot.
|
||||
*/
|
||||
#ifdef CONFIG_HUGETLB_PAGE
|
||||
#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \
|
||||
do { } while (0)
|
||||
free_pgd_range(tlb, addr, end, floor, ceiling)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This gets called at the end of handling a page fault, when
|
||||
|
||||
@@ -26,4 +26,6 @@ typedef void (*perf_irq_t)(struct pt_regs *);
|
||||
int reserve_pmc_hardware(perf_irq_t new_perf_irq);
|
||||
void release_pmc_hardware(void);
|
||||
|
||||
void power4_enable_pmcs(void);
|
||||
|
||||
#endif /* _PPC64_PMC_H */
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#ifndef __PPC64_POLL_H
|
||||
#define __PPC64_POLL_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001 PPC64 Team, IBM Corp
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#define POLLIN 0x0001
|
||||
#define POLLPRI 0x0002
|
||||
#define POLLOUT 0x0004
|
||||
#define POLLERR 0x0008
|
||||
#define POLLHUP 0x0010
|
||||
#define POLLNVAL 0x0020
|
||||
#define POLLRDNORM 0x0040
|
||||
#define POLLRDBAND 0x0080
|
||||
#define POLLWRNORM 0x0100
|
||||
#define POLLWRBAND 0x0200
|
||||
#define POLLMSG 0x0400
|
||||
#define POLLREMOVE 0x1000
|
||||
|
||||
struct pollfd {
|
||||
int fd;
|
||||
short events;
|
||||
short revents;
|
||||
};
|
||||
|
||||
#endif /* __PPC64_POLL_H */
|
||||
@@ -268,6 +268,7 @@
|
||||
#define PV_970FX 0x003C
|
||||
#define PV_630 0x0040
|
||||
#define PV_630p 0x0041
|
||||
#define PV_970MP 0x0044
|
||||
#define PV_BE 0x0070
|
||||
|
||||
/* Platforms supported by PPC64 */
|
||||
@@ -382,8 +383,8 @@ extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
|
||||
extern struct task_struct *last_task_used_math;
|
||||
extern struct task_struct *last_task_used_altivec;
|
||||
|
||||
/* 64-bit user address space is 41-bits (2TBs user VM) */
|
||||
#define TASK_SIZE_USER64 (0x0000020000000000UL)
|
||||
/* 64-bit user address space is 44-bits (16TB user VM) */
|
||||
#define TASK_SIZE_USER64 (0x0000100000000000UL)
|
||||
|
||||
/*
|
||||
* 32-bit user address space is 4GB - 1 page
|
||||
|
||||
@@ -22,13 +22,15 @@
|
||||
#define RELOC(x) (*PTRRELOC(&(x)))
|
||||
|
||||
/* Definitions used by the flattened device tree */
|
||||
#define OF_DT_HEADER 0xd00dfeed /* 4: version, 4: total size */
|
||||
#define OF_DT_BEGIN_NODE 0x1 /* Start node: full name */
|
||||
#define OF_DT_HEADER 0xd00dfeed /* marker */
|
||||
#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
|
||||
#define OF_DT_END_NODE 0x2 /* End node */
|
||||
#define OF_DT_PROP 0x3 /* Property: name off, size, content */
|
||||
#define OF_DT_PROP 0x3 /* Property: name off, size,
|
||||
* content */
|
||||
#define OF_DT_NOP 0x4 /* nop */
|
||||
#define OF_DT_END 0x9
|
||||
|
||||
#define OF_DT_VERSION 1
|
||||
#define OF_DT_VERSION 0x10
|
||||
|
||||
/*
|
||||
* This is what gets passed to the kernel by prom_init or kexec
|
||||
@@ -54,7 +56,9 @@ struct boot_param_header
|
||||
u32 version; /* format version */
|
||||
u32 last_comp_version; /* last compatible version */
|
||||
/* version 2 fields below */
|
||||
u32 boot_cpuid_phys; /* Which physical CPU id we're booting on */
|
||||
u32 boot_cpuid_phys; /* Physical CPU id we're booting on */
|
||||
/* version 3 fields below */
|
||||
u32 dt_strings_size; /* size of the DT strings block */
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef _PPC64_RESOURCE_H
|
||||
#define _PPC64_RESOURCE_H
|
||||
|
||||
#include <asm-generic/resource.h>
|
||||
|
||||
#endif /* _PPC64_RESOURCE_H */
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifndef _PPC64_SHMPARAM_H
|
||||
#define _PPC64_SHMPARAM_H
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
|
||||
|
||||
#endif /* _PPC64_SHMPARAM_H */
|
||||
@@ -21,6 +21,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
#ifndef _PPC64_STRING_H_
|
||||
#define _PPC64_STRING_H_
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#define __HAVE_ARCH_STRCPY
|
||||
#define __HAVE_ARCH_STRNCPY
|
||||
#define __HAVE_ARCH_STRLEN
|
||||
#define __HAVE_ARCH_STRCMP
|
||||
#define __HAVE_ARCH_STRCAT
|
||||
#define __HAVE_ARCH_MEMSET
|
||||
#define __HAVE_ARCH_MEMCPY
|
||||
#define __HAVE_ARCH_MEMMOVE
|
||||
#define __HAVE_ARCH_MEMCMP
|
||||
#define __HAVE_ARCH_MEMCHR
|
||||
|
||||
extern int strcasecmp(const char *, const char *);
|
||||
extern int strncasecmp(const char *, const char *, int);
|
||||
extern char * strcpy(char *,const char *);
|
||||
extern char * strncpy(char *,const char *, __kernel_size_t);
|
||||
extern __kernel_size_t strlen(const char *);
|
||||
extern int strcmp(const char *,const char *);
|
||||
extern char * strcat(char *, const char *);
|
||||
extern void * memset(void *,int,__kernel_size_t);
|
||||
extern void * memcpy(void *,const void *,__kernel_size_t);
|
||||
extern void * memmove(void *,const void *,__kernel_size_t);
|
||||
extern int memcmp(const void *,const void *,__kernel_size_t);
|
||||
extern void * memchr(const void *,int,__kernel_size_t);
|
||||
|
||||
#endif /* _PPC64_STRING_H_ */
|
||||
@@ -88,7 +88,7 @@ DEBUGGER_BOILERPLATE(debugger_dabr_match)
|
||||
DEBUGGER_BOILERPLATE(debugger_fault_handler)
|
||||
|
||||
#ifdef CONFIG_XMON
|
||||
extern void xmon_init(void);
|
||||
extern void xmon_init(int enable);
|
||||
#endif
|
||||
|
||||
#else
|
||||
@@ -302,5 +302,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
|
||||
|
||||
#define arch_align_stack(x) (x)
|
||||
|
||||
extern unsigned long reloc_offset(void);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#ifndef __PPC64_UNALIGNED_H
|
||||
#define __PPC64_UNALIGNED_H
|
||||
|
||||
/*
|
||||
* The PowerPC can do unaligned accesses itself in big endian mode.
|
||||
*
|
||||
* The strange macros are there to make sure these can't
|
||||
* be misused in a way that makes them not work on other
|
||||
* architectures where unaligned accesses aren't as simple.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#define get_unaligned(ptr) (*(ptr))
|
||||
|
||||
#define put_unaligned(val, ptr) ((void)( *(ptr) = (val) ))
|
||||
|
||||
#endif /* __PPC64_UNALIGNED_H */
|
||||
+51
-48
@@ -19,13 +19,15 @@
|
||||
#include <linux/errno.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
|
||||
#include <asm/hvcall.h>
|
||||
#include <asm/prom.h>
|
||||
#include <asm/scatterlist.h>
|
||||
/*
|
||||
|
||||
/*
|
||||
* Architecture-specific constants for drivers to
|
||||
* extract attributes of the device using vio_get_attribute()
|
||||
*/
|
||||
*/
|
||||
#define VETH_MAC_ADDR "local-mac-address"
|
||||
#define VETH_MCAST_FILTER_SIZE "ibm,mac-address-filters"
|
||||
|
||||
@@ -37,51 +39,8 @@
|
||||
#define VIO_IRQ_DISABLE 0UL
|
||||
#define VIO_IRQ_ENABLE 1UL
|
||||
|
||||
struct vio_dev;
|
||||
struct vio_driver;
|
||||
struct vio_device_id;
|
||||
struct iommu_table;
|
||||
|
||||
int vio_register_driver(struct vio_driver *drv);
|
||||
void vio_unregister_driver(struct vio_driver *drv);
|
||||
|
||||
#ifdef CONFIG_PPC_PSERIES
|
||||
struct vio_dev * __devinit vio_register_device_node(
|
||||
struct device_node *node_vdev);
|
||||
#endif
|
||||
void __devinit vio_unregister_device(struct vio_dev *dev);
|
||||
struct vio_dev *vio_find_node(struct device_node *vnode);
|
||||
|
||||
const void * vio_get_attribute(struct vio_dev *vdev, void* which, int* length);
|
||||
int vio_get_irq(struct vio_dev *dev);
|
||||
int vio_enable_interrupts(struct vio_dev *dev);
|
||||
int vio_disable_interrupts(struct vio_dev *dev);
|
||||
|
||||
extern struct dma_mapping_ops vio_dma_ops;
|
||||
|
||||
extern struct bus_type vio_bus_type;
|
||||
|
||||
struct vio_device_id {
|
||||
char *type;
|
||||
char *compat;
|
||||
};
|
||||
|
||||
struct vio_driver {
|
||||
struct list_head node;
|
||||
char *name;
|
||||
const struct vio_device_id *id_table; /* NULL if wants all devices */
|
||||
int (*probe) (struct vio_dev *dev, const struct vio_device_id *id); /* New device inserted */
|
||||
int (*remove) (struct vio_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
|
||||
unsigned long driver_data;
|
||||
|
||||
struct device_driver driver;
|
||||
};
|
||||
|
||||
static inline struct vio_driver *to_vio_driver(struct device_driver *drv)
|
||||
{
|
||||
return container_of(drv, struct vio_driver, driver);
|
||||
}
|
||||
|
||||
/*
|
||||
* The vio_dev structure is used to describe virtual I/O devices.
|
||||
*/
|
||||
@@ -89,12 +48,56 @@ struct vio_dev {
|
||||
struct iommu_table *iommu_table; /* vio_map_* uses this */
|
||||
char *name;
|
||||
char *type;
|
||||
uint32_t unit_address;
|
||||
uint32_t unit_address;
|
||||
unsigned int irq;
|
||||
|
||||
struct device dev;
|
||||
};
|
||||
|
||||
struct vio_driver {
|
||||
struct list_head node;
|
||||
char *name;
|
||||
const struct vio_device_id *id_table;
|
||||
int (*probe)(struct vio_dev *dev, const struct vio_device_id *id);
|
||||
int (*remove)(struct vio_dev *dev);
|
||||
unsigned long driver_data;
|
||||
struct device_driver driver;
|
||||
};
|
||||
|
||||
struct vio_bus_ops {
|
||||
int (*match)(const struct vio_device_id *id, const struct vio_dev *dev);
|
||||
void (*unregister_device)(struct vio_dev *);
|
||||
void (*release_device)(struct device *);
|
||||
};
|
||||
|
||||
extern struct dma_mapping_ops vio_dma_ops;
|
||||
extern struct bus_type vio_bus_type;
|
||||
extern struct vio_dev vio_bus_device;
|
||||
|
||||
extern int vio_register_driver(struct vio_driver *drv);
|
||||
extern void vio_unregister_driver(struct vio_driver *drv);
|
||||
|
||||
extern struct vio_dev * __devinit vio_register_device(struct vio_dev *viodev);
|
||||
extern void __devinit vio_unregister_device(struct vio_dev *dev);
|
||||
|
||||
extern int vio_bus_init(struct vio_bus_ops *);
|
||||
|
||||
#ifdef CONFIG_PPC_PSERIES
|
||||
struct device_node;
|
||||
|
||||
extern struct vio_dev * __devinit vio_register_device_node(
|
||||
struct device_node *node_vdev);
|
||||
extern struct vio_dev *vio_find_node(struct device_node *vnode);
|
||||
extern const void *vio_get_attribute(struct vio_dev *vdev, void *which,
|
||||
int *length);
|
||||
extern int vio_enable_interrupts(struct vio_dev *dev);
|
||||
extern int vio_disable_interrupts(struct vio_dev *dev);
|
||||
#endif
|
||||
|
||||
static inline struct vio_driver *to_vio_driver(struct device_driver *drv)
|
||||
{
|
||||
return container_of(drv, struct vio_driver, driver);
|
||||
}
|
||||
|
||||
static inline struct vio_dev *to_vio_dev(struct device *dev)
|
||||
{
|
||||
return container_of(dev, struct vio_dev, dev);
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#include <asm-generic/xor.h>
|
||||
@@ -22,6 +22,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_RCVBUFFORCE 32
|
||||
#define SO_SNDBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/head.h>
|
||||
#include <asm/signal.h>
|
||||
#include <asm/segment.h>
|
||||
#include <asm/btfixup.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef __SPARC_SEGMENT_H
|
||||
#define __SPARC_SEGMENT_H
|
||||
|
||||
/* Only here because we have some old header files that expect it.. */
|
||||
|
||||
#endif
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
#define SO_SNDBUF 0x1001
|
||||
#define SO_RCVBUF 0x1002
|
||||
#define SO_SNDBUFFORCE 0x100a
|
||||
#define SO_RCVBUFFORCE 0x100b
|
||||
#define SO_ERROR 0x1007
|
||||
#define SO_TYPE 0x1008
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <linux/threads.h> /* NR_CPUS */
|
||||
#include <linux/thread_info.h>
|
||||
|
||||
#include <asm/segment.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/psr.h>
|
||||
#include <asm/ptrace.h>
|
||||
|
||||
@@ -72,10 +72,10 @@ extern int atomic64_sub_ret(int, atomic64_t *);
|
||||
|
||||
/* Atomic operations are already serializing */
|
||||
#ifdef CONFIG_SMP
|
||||
#define smp_mb__before_atomic_dec() membar("#StoreLoad | #LoadLoad")
|
||||
#define smp_mb__after_atomic_dec() membar("#StoreLoad | #StoreStore")
|
||||
#define smp_mb__before_atomic_inc() membar("#StoreLoad | #LoadLoad")
|
||||
#define smp_mb__after_atomic_inc() membar("#StoreLoad | #StoreStore")
|
||||
#define smp_mb__before_atomic_dec() membar_storeload_loadload();
|
||||
#define smp_mb__after_atomic_dec() membar_storeload_storestore();
|
||||
#define smp_mb__before_atomic_inc() membar_storeload_loadload();
|
||||
#define smp_mb__after_atomic_inc() membar_storeload_storestore();
|
||||
#else
|
||||
#define smp_mb__before_atomic_dec() barrier()
|
||||
#define smp_mb__after_atomic_dec() barrier()
|
||||
|
||||
@@ -72,8 +72,8 @@ static inline int __test_and_change_bit(int nr, volatile unsigned long *addr)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#define smp_mb__before_clear_bit() membar("#StoreLoad | #LoadLoad")
|
||||
#define smp_mb__after_clear_bit() membar("#StoreLoad | #StoreStore")
|
||||
#define smp_mb__before_clear_bit() membar_storeload_loadload()
|
||||
#define smp_mb__after_clear_bit() membar_storeload_storestore()
|
||||
#else
|
||||
#define smp_mb__before_clear_bit() barrier()
|
||||
#define smp_mb__after_clear_bit() barrier()
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include <asm/a.out.h>
|
||||
#include <asm/pstate.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/segment.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
/* The sparc has no problems with write protection */
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef __SPARC64_SEGMENT_H
|
||||
#define __SPARC64_SEGMENT_H
|
||||
|
||||
/* Only here because we have some old header files that expect it.. */
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,82 @@
|
||||
#ifndef _SPARC64_SFAFSR_H
|
||||
#define _SPARC64_SFAFSR_H
|
||||
|
||||
#include <asm/const.h>
|
||||
|
||||
/* Spitfire Asynchronous Fault Status register, ASI=0x4C VA<63:0>=0x0 */
|
||||
|
||||
#define SFAFSR_ME (_AC(1,UL) << SFAFSR_ME_SHIFT)
|
||||
#define SFAFSR_ME_SHIFT 32
|
||||
#define SFAFSR_PRIV (_AC(1,UL) << SFAFSR_PRIV_SHIFT)
|
||||
#define SFAFSR_PRIV_SHIFT 31
|
||||
#define SFAFSR_ISAP (_AC(1,UL) << SFAFSR_ISAP_SHIFT)
|
||||
#define SFAFSR_ISAP_SHIFT 30
|
||||
#define SFAFSR_ETP (_AC(1,UL) << SFAFSR_ETP_SHIFT)
|
||||
#define SFAFSR_ETP_SHIFT 29
|
||||
#define SFAFSR_IVUE (_AC(1,UL) << SFAFSR_IVUE_SHIFT)
|
||||
#define SFAFSR_IVUE_SHIFT 28
|
||||
#define SFAFSR_TO (_AC(1,UL) << SFAFSR_TO_SHIFT)
|
||||
#define SFAFSR_TO_SHIFT 27
|
||||
#define SFAFSR_BERR (_AC(1,UL) << SFAFSR_BERR_SHIFT)
|
||||
#define SFAFSR_BERR_SHIFT 26
|
||||
#define SFAFSR_LDP (_AC(1,UL) << SFAFSR_LDP_SHIFT)
|
||||
#define SFAFSR_LDP_SHIFT 25
|
||||
#define SFAFSR_CP (_AC(1,UL) << SFAFSR_CP_SHIFT)
|
||||
#define SFAFSR_CP_SHIFT 24
|
||||
#define SFAFSR_WP (_AC(1,UL) << SFAFSR_WP_SHIFT)
|
||||
#define SFAFSR_WP_SHIFT 23
|
||||
#define SFAFSR_EDP (_AC(1,UL) << SFAFSR_EDP_SHIFT)
|
||||
#define SFAFSR_EDP_SHIFT 22
|
||||
#define SFAFSR_UE (_AC(1,UL) << SFAFSR_UE_SHIFT)
|
||||
#define SFAFSR_UE_SHIFT 21
|
||||
#define SFAFSR_CE (_AC(1,UL) << SFAFSR_CE_SHIFT)
|
||||
#define SFAFSR_CE_SHIFT 20
|
||||
#define SFAFSR_ETS (_AC(0xf,UL) << SFAFSR_ETS_SHIFT)
|
||||
#define SFAFSR_ETS_SHIFT 16
|
||||
#define SFAFSR_PSYND (_AC(0xffff,UL) << SFAFSR_PSYND_SHIFT)
|
||||
#define SFAFSR_PSYND_SHIFT 0
|
||||
|
||||
/* UDB Error Register, ASI=0x7f VA<63:0>=0x0(High),0x18(Low) for read
|
||||
* ASI=0x77 VA<63:0>=0x0(High),0x18(Low) for write
|
||||
*/
|
||||
|
||||
#define UDBE_UE (_AC(1,UL) << 9)
|
||||
#define UDBE_CE (_AC(1,UL) << 8)
|
||||
#define UDBE_E_SYNDR (_AC(0xff,UL) << 0)
|
||||
|
||||
/* The trap handlers for asynchronous errors encode the AFSR and
|
||||
* other pieces of information into a 64-bit argument for C code
|
||||
* encoded as follows:
|
||||
*
|
||||
* -----------------------------------------------
|
||||
* | UDB_H | UDB_L | TL>1 | TT | AFSR |
|
||||
* -----------------------------------------------
|
||||
* 63 54 53 44 42 41 33 32 0
|
||||
*
|
||||
* The AFAR is passed in unchanged.
|
||||
*/
|
||||
#define SFSTAT_UDBH_MASK (_AC(0x3ff,UL) << SFSTAT_UDBH_SHIFT)
|
||||
#define SFSTAT_UDBH_SHIFT 54
|
||||
#define SFSTAT_UDBL_MASK (_AC(0x3ff,UL) << SFSTAT_UDBH_SHIFT)
|
||||
#define SFSTAT_UDBL_SHIFT 44
|
||||
#define SFSTAT_TL_GT_ONE (_AC(1,UL) << SFSTAT_TL_GT_ONE_SHIFT)
|
||||
#define SFSTAT_TL_GT_ONE_SHIFT 42
|
||||
#define SFSTAT_TRAP_TYPE (_AC(0x1FF,UL) << SFSTAT_TRAP_TYPE_SHIFT)
|
||||
#define SFSTAT_TRAP_TYPE_SHIFT 33
|
||||
#define SFSTAT_AFSR_MASK (_AC(0x1ffffffff,UL) << SFSTAT_AFSR_SHIFT)
|
||||
#define SFSTAT_AFSR_SHIFT 0
|
||||
|
||||
/* ESTATE Error Enable Register, ASI=0x4b VA<63:0>=0x0 */
|
||||
#define ESTATE_ERR_CE 0x1 /* Correctable errors */
|
||||
#define ESTATE_ERR_NCE 0x2 /* TO, BERR, LDP, ETP, EDP, WP, UE, IVUE */
|
||||
#define ESTATE_ERR_ISAP 0x4 /* System address parity error */
|
||||
#define ESTATE_ERR_ALL (ESTATE_ERR_CE | \
|
||||
ESTATE_ERR_NCE | \
|
||||
ESTATE_ERR_ISAP)
|
||||
|
||||
/* The various trap types that report using the above state. */
|
||||
#define TRAP_TYPE_IAE 0x09 /* Instruction Access Error */
|
||||
#define TRAP_TYPE_DAE 0x32 /* Data Access Error */
|
||||
#define TRAP_TYPE_CEE 0x63 /* Correctable ECC Error */
|
||||
|
||||
#endif /* _SPARC64_SFAFSR_H */
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
#define SO_SNDBUF 0x1001
|
||||
#define SO_RCVBUF 0x1002
|
||||
#define SO_SNDBUFFORCE 0x100a
|
||||
#define SO_RCVBUFFORCE 0x100b
|
||||
#define SO_ERROR 0x1007
|
||||
#define SO_TYPE 0x1008
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ typedef struct {
|
||||
#define spin_is_locked(lp) ((lp)->lock != 0)
|
||||
|
||||
#define spin_unlock_wait(lp) \
|
||||
do { membar("#LoadLoad"); \
|
||||
do { rmb(); \
|
||||
} while((lp)->lock)
|
||||
|
||||
static inline void _raw_spin_lock(spinlock_t *lock)
|
||||
@@ -129,15 +129,18 @@ typedef struct {
|
||||
#define spin_is_locked(__lock) ((__lock)->lock != 0)
|
||||
#define spin_unlock_wait(__lock) \
|
||||
do { \
|
||||
membar("#LoadLoad"); \
|
||||
rmb(); \
|
||||
} while((__lock)->lock)
|
||||
|
||||
extern void _do_spin_lock (spinlock_t *lock, char *str);
|
||||
extern void _do_spin_unlock (spinlock_t *lock);
|
||||
extern int _do_spin_trylock (spinlock_t *lock);
|
||||
extern void _do_spin_lock(spinlock_t *lock, char *str, unsigned long caller);
|
||||
extern void _do_spin_unlock(spinlock_t *lock);
|
||||
extern int _do_spin_trylock(spinlock_t *lock, unsigned long caller);
|
||||
|
||||
#define _raw_spin_trylock(lp) _do_spin_trylock(lp)
|
||||
#define _raw_spin_lock(lock) _do_spin_lock(lock, "spin_lock")
|
||||
#define _raw_spin_trylock(lp) \
|
||||
_do_spin_trylock(lp, (unsigned long) __builtin_return_address(0))
|
||||
#define _raw_spin_lock(lock) \
|
||||
_do_spin_lock(lock, "spin_lock", \
|
||||
(unsigned long) __builtin_return_address(0))
|
||||
#define _raw_spin_unlock(lock) _do_spin_unlock(lock)
|
||||
#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
|
||||
|
||||
@@ -279,37 +282,41 @@ typedef struct {
|
||||
#define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0, 0xff, { } }
|
||||
#define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0)
|
||||
|
||||
extern void _do_read_lock(rwlock_t *rw, char *str);
|
||||
extern void _do_read_unlock(rwlock_t *rw, char *str);
|
||||
extern void _do_write_lock(rwlock_t *rw, char *str);
|
||||
extern void _do_write_unlock(rwlock_t *rw);
|
||||
extern int _do_write_trylock(rwlock_t *rw, char *str);
|
||||
extern void _do_read_lock(rwlock_t *rw, char *str, unsigned long caller);
|
||||
extern void _do_read_unlock(rwlock_t *rw, char *str, unsigned long caller);
|
||||
extern void _do_write_lock(rwlock_t *rw, char *str, unsigned long caller);
|
||||
extern void _do_write_unlock(rwlock_t *rw, unsigned long caller);
|
||||
extern int _do_write_trylock(rwlock_t *rw, char *str, unsigned long caller);
|
||||
|
||||
#define _raw_read_lock(lock) \
|
||||
do { unsigned long flags; \
|
||||
local_irq_save(flags); \
|
||||
_do_read_lock(lock, "read_lock"); \
|
||||
_do_read_lock(lock, "read_lock", \
|
||||
(unsigned long) __builtin_return_address(0)); \
|
||||
local_irq_restore(flags); \
|
||||
} while(0)
|
||||
|
||||
#define _raw_read_unlock(lock) \
|
||||
do { unsigned long flags; \
|
||||
local_irq_save(flags); \
|
||||
_do_read_unlock(lock, "read_unlock"); \
|
||||
_do_read_unlock(lock, "read_unlock", \
|
||||
(unsigned long) __builtin_return_address(0)); \
|
||||
local_irq_restore(flags); \
|
||||
} while(0)
|
||||
|
||||
#define _raw_write_lock(lock) \
|
||||
do { unsigned long flags; \
|
||||
local_irq_save(flags); \
|
||||
_do_write_lock(lock, "write_lock"); \
|
||||
_do_write_lock(lock, "write_lock", \
|
||||
(unsigned long) __builtin_return_address(0)); \
|
||||
local_irq_restore(flags); \
|
||||
} while(0)
|
||||
|
||||
#define _raw_write_unlock(lock) \
|
||||
do { unsigned long flags; \
|
||||
local_irq_save(flags); \
|
||||
_do_write_unlock(lock); \
|
||||
_do_write_unlock(lock, \
|
||||
(unsigned long) __builtin_return_address(0)); \
|
||||
local_irq_restore(flags); \
|
||||
} while(0)
|
||||
|
||||
@@ -317,7 +324,8 @@ do { unsigned long flags; \
|
||||
({ unsigned long flags; \
|
||||
int val; \
|
||||
local_irq_save(flags); \
|
||||
val = _do_write_trylock(lock, "write_trylock"); \
|
||||
val = _do_write_trylock(lock, "write_trylock", \
|
||||
(unsigned long) __builtin_return_address(0)); \
|
||||
local_irq_restore(flags); \
|
||||
val; \
|
||||
})
|
||||
|
||||
@@ -28,6 +28,14 @@ enum sparc_cpu {
|
||||
#define ARCH_SUN4C_SUN4 0
|
||||
#define ARCH_SUN4 0
|
||||
|
||||
extern void mb(void);
|
||||
extern void rmb(void);
|
||||
extern void wmb(void);
|
||||
extern void membar_storeload(void);
|
||||
extern void membar_storeload_storestore(void);
|
||||
extern void membar_storeload_loadload(void);
|
||||
extern void membar_storestore_loadstore(void);
|
||||
|
||||
#endif
|
||||
|
||||
#define setipl(__new_ipl) \
|
||||
@@ -78,16 +86,11 @@ enum sparc_cpu {
|
||||
|
||||
#define nop() __asm__ __volatile__ ("nop")
|
||||
|
||||
#define membar(type) __asm__ __volatile__ ("membar " type : : : "memory")
|
||||
#define mb() \
|
||||
membar("#LoadLoad | #LoadStore | #StoreStore | #StoreLoad")
|
||||
#define rmb() membar("#LoadLoad")
|
||||
#define wmb() membar("#StoreStore")
|
||||
#define read_barrier_depends() do { } while(0)
|
||||
#define set_mb(__var, __value) \
|
||||
do { __var = __value; membar("#StoreLoad | #StoreStore"); } while(0)
|
||||
do { __var = __value; membar_storeload_storestore(); } while(0)
|
||||
#define set_wmb(__var, __value) \
|
||||
do { __var = __value; membar("#StoreStore"); } while(0)
|
||||
do { __var = __value; wmb(); } while(0)
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#define smp_mb() mb()
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -64,7 +64,7 @@ static inline unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl)
|
||||
" adcl $0, %0\n"
|
||||
" notl %0\n"
|
||||
"2:"
|
||||
/* Since the input registers which are loaded with iph and ipl
|
||||
/* Since the input registers which are loaded with iph and ihl
|
||||
are modified, we must also specify them as outputs, or gcc
|
||||
will assume they contain their original values. */
|
||||
: "=r" (sum), "=r" (iph), "=r" (ihl)
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
|
||||
@@ -1,2 +1,37 @@
|
||||
int pci_siig10x_fn(struct pci_dev *dev, int enable);
|
||||
int pci_siig20x_fn(struct pci_dev *dev, int enable);
|
||||
/*
|
||||
* Definitions for PCI support.
|
||||
*/
|
||||
#define FL_BASE_MASK 0x0007
|
||||
#define FL_BASE0 0x0000
|
||||
#define FL_BASE1 0x0001
|
||||
#define FL_BASE2 0x0002
|
||||
#define FL_BASE3 0x0003
|
||||
#define FL_BASE4 0x0004
|
||||
#define FL_GET_BASE(x) (x & FL_BASE_MASK)
|
||||
|
||||
/* Use successive BARs (PCI base address registers),
|
||||
else use offset into some specified BAR */
|
||||
#define FL_BASE_BARS 0x0008
|
||||
|
||||
/* do not assign an irq */
|
||||
#define FL_NOIRQ 0x0080
|
||||
|
||||
/* Use the Base address register size to cap number of ports */
|
||||
#define FL_REGION_SZ_CAP 0x0100
|
||||
|
||||
struct pciserial_board {
|
||||
unsigned int flags;
|
||||
unsigned int num_ports;
|
||||
unsigned int base_baud;
|
||||
unsigned int uart_offset;
|
||||
unsigned int reg_shift;
|
||||
unsigned int first_offset;
|
||||
};
|
||||
|
||||
struct serial_private;
|
||||
|
||||
struct serial_private *
|
||||
pciserial_init_ports(struct pci_dev *dev, struct pciserial_board *board);
|
||||
void pciserial_remove_ports(struct serial_private *priv);
|
||||
void pciserial_suspend_ports(struct serial_private *priv);
|
||||
void pciserial_resume_ports(struct serial_private *priv);
|
||||
|
||||
+26
-19
@@ -1,24 +1,29 @@
|
||||
|
||||
/*
|
||||
Copyright 2003-2004 Red Hat, Inc. All rights reserved.
|
||||
Copyright 2003-2004 Jeff Garzik
|
||||
|
||||
The contents of this file are subject to the Open
|
||||
Software License version 1.1 that can be found at
|
||||
http://www.opensource.org/licenses/osl-1.1.txt and is included herein
|
||||
by reference.
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License version 2 (the "GPL") as distributed
|
||||
in the kernel source COPYING file, in which case the provisions of
|
||||
the GPL are applicable instead of the above. If you wish to allow
|
||||
the use of your version of this file only under the terms of the
|
||||
GPL and not to allow others to use your version of this file under
|
||||
the OSL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the GPL.
|
||||
If you do not delete the provisions above, a recipient may use your
|
||||
version of this file under either the OSL or the GPL.
|
||||
|
||||
* Copyright 2003-2004 Red Hat, Inc. All rights reserved.
|
||||
* Copyright 2003-2004 Jeff Garzik
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
* libata documentation is available via 'make {ps|pdf}docs',
|
||||
* as Documentation/DocBook/libata.*
|
||||
*
|
||||
* Hardware documentation available from http://www.t13.org/
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_ATA_H__
|
||||
@@ -108,6 +113,8 @@ enum {
|
||||
|
||||
/* ATA device commands */
|
||||
ATA_CMD_CHK_POWER = 0xE5, /* check power mode */
|
||||
ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */
|
||||
ATA_CMD_IDLE = 0xE3, /* place in idle power mode */
|
||||
ATA_CMD_EDD = 0x90, /* execute device diagnostic */
|
||||
ATA_CMD_FLUSH = 0xE7,
|
||||
ATA_CMD_FLUSH_EXT = 0xEA,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user