Commit dfd9a41e authored by Vojtech Pavlik's avatar Vojtech Pavlik

Merge suse.cz:/data/bk/linus into suse.cz:/data/bk/input

parents 38f67b57 3dc527ec
......@@ -215,6 +215,8 @@ AES algorithm contributors:
Herbert Valerio Riedel
Kyle McMartin
Adam J. Richter
Fruhwirth Clemens (i586)
Linus Torvalds (i586)
CAST5 algorithm contributors:
Kartikey Mahendra Bhatt (original developers unknown, FSF copyright).
......
......@@ -19,23 +19,18 @@ fmask=### -- The permission mask for files.
codepage=### -- Sets the codepage number for converting to shortname
characters on FAT filesystem.
NOTE: If this option was not specified, the file name
may not be read/written rightly, also filesystem is
mounted as read-only.
By default, FAT_DEFAULT_CODEPAGE setting is used.
iocharset=name -- Character set to use for converting between the
encoding is used for user visible filename and 16 bit
Unicode characters. Long filenames are stored on disk
in Unicode format, but Unix for the most part doesn't
know how to deal with Unicode.
By default, FAT_DEFAULT_IOCHARSET setting is used.
There is also an option of doing UTF8 translations
with the utf8 option.
NOTE: If this option was not specified, the file name
may not be read/written rightly, also filesystem is
mounted as read-only.
NOTE: "iocharset=utf8" is not recommended. If unsure,
you should consider the following option instead.
......
......@@ -5182,7 +5182,7 @@ struct _snd_pcm_runtime {
The callback is much more complicated than the text-file
version. You need to use a low-level i/o functions such as
<function>copy_from/to_user()</function> to transfer the
data. Also, you have to keep tracking the file position, too.
data.
<informalexample>
<programlisting>
......@@ -5190,14 +5190,15 @@ struct _snd_pcm_runtime {
static long my_file_io_read(snd_info_entry_t *entry,
void *file_private_data,
struct file *file,
char *buf, long count)
char *buf,
unsigned long count,
unsigned long pos)
{
long size = count;
if (file->f_pos + size > local_max_size)
size = local_max_size - file->f_pos;
if (copy_to_user(buf, local_data + file->f_pos, size))
if (pos + size > local_max_size)
size = local_max_size - pos;
if (copy_to_user(buf, local_data + pos, size))
return -EFAULT;
file->f_pos += size;
return size;
}
]]>
......
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 8
EXTRAVERSION =-rc3
EXTRAVERSION =-rc4
NAME=Zonked Quokka
# *DOCUMENTATION*
......@@ -619,12 +619,7 @@ $(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(vmlinux-dirs) ;
.PHONY: $(vmlinux-dirs)
$(vmlinux-dirs): prepare-all scripts
$(Q)if [ ! -z $$LC_ALL ]; then \
export LANG=$$LC_ALL; \
export LC_ALL= ; \
fi; \
export LC_COLLATE=C; export LC_CTYPE=C; \
$(MAKE) $(build)=$@
$(Q)$(MAKE) $(build)=$@
# Things we need to do before we recursively start building the kernel
# or the modules are listed in "prepare-all".
......
......@@ -7,10 +7,10 @@ LDFLAGS_bootp :=-p --no-undefined -X \
--defsym params_phys=$(PARAMS_PHYS) -T
AFLAGS_initrd.o :=-DINITRD=\"$(INITRD)\"
targets := bootp bootp.lds init.o kernel.o initrd.o
targets := bootp init.o kernel.o initrd.o
# Note that bootp.lds picks up kernel.o and initrd.o
$(obj)/bootp: $(addprefix $(obj)/,bootp.lds init.o kernel.o initrd.o) FORCE
$(obj)/bootp: $(src)/bootp.lds $(addprefix $(obj)/,init.o kernel.o initrd.o) FORCE
$(call if_changed,ld)
@:
......
......@@ -20,8 +20,10 @@
.type _start, #function
.globl _start
_start: adr r13, data
_start: add lr, pc, #-0x8 @ lr = current load addr
adr r13, data
ldmia r13!, {r4-r6} @ r5 = dest, r6 = length
add r4, r4, lr @ r4 = initrd_start + load addr
bl move @ move the initrd
/*
......
......@@ -101,7 +101,7 @@ $(obj)/piggy.o: $(obj)/piggy.gz FORCE
CFLAGS_font.o := -Dstatic=
$(obj)/font.o: $(FONTC)
$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in Makefile arch/arm/boot/Makefile .config
$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config
@sed "$(SEDFLAGS)" < $< > $@
$(obj)/misc.o: $(obj)/misc.c include/asm/arch/uncompress.h lib/inflate.c
......
This diff is collapsed.
......@@ -7,12 +7,13 @@
* Copy data from IO memory space to "real" memory space.
* This needs to be optimized.
*/
void _memcpy_fromio(void * to, unsigned long from, size_t count)
void _memcpy_fromio(void *to, unsigned long from, size_t count)
{
unsigned char *t = to;
while (count) {
count--;
*(char *) to = readb(from);
((char *) to)++;
*t = readb(from);
t++;
from++;
}
}
......@@ -21,12 +22,13 @@ void _memcpy_fromio(void * to, unsigned long from, size_t count)
* Copy data from "real" memory space to IO memory space.
* This needs to be optimized.
*/
void _memcpy_toio(unsigned long to, const void * from, size_t count)
void _memcpy_toio(unsigned long to, const void *from, size_t count)
{
const unsigned char *f = from;
while (count) {
count--;
writeb(*(char *) from, to);
((char *) from)++;
writeb(*f, to);
f++;
to++;
}
}
......
......@@ -23,9 +23,12 @@ config ARCH_SMDK2410
<http://www.fsforth.de>
config MACH_VR1000
bool "Simtec VR1000"
bool "Thorcom VR1000"
help
Say Y here if you are using the Simtec VR1000 board.
Say Y here if you are using the Thorcom VR1000 board.
This linux port is currently being maintained by Simtec, on behalf
of Thorcom. Any queries, please contact Thorcom first.
endmenu
......
......@@ -101,7 +101,7 @@ void __init smdk2410_init_irq(void)
void __init smdk2410_init_time(void)
{
s3c2401_init_time();
s3c2410_init_time();
}
MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch
......
......@@ -11,6 +11,7 @@
* published by the Free Software Foundation.
*
* Modifications:
* 06-Aug-2004 BJD Fixed call to time initialisation
* 12-Jul-2004 BJD Renamed machine
* 16-May-2003 BJD Created initial version
* 16-Aug-2003 BJD Fixed header files and copyright, added URL
......@@ -159,7 +160,7 @@ void __init vr1000_init_irq(void)
void __init vr1000_init_time(void)
{
s3c2401_init_time();
s3c2410_init_time();
}
MACHINE_START(VR1000, "Thorcom-VR1000")
......
......@@ -66,9 +66,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
/* We must not map this if we have highmem enabled */
pte = pte_offset_map(pmd, addr);
printk(", *pte=%08lx", pte_val(*pte));
#ifdef CONFIG_CPU_32
printk(", *ppte=%08lx", pte_val(pte[-PTRS_PER_PTE]));
#endif
pte_unmap(pte);
#endif
} while(0);
......
......@@ -24,13 +24,7 @@
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#ifdef CONFIG_CPU_32
#define TABLE_OFFSET (PTRS_PER_PTE)
#else
#define TABLE_OFFSET 0
#endif
#define TABLE_SIZE ((TABLE_OFFSET + PTRS_PER_PTE) * sizeof(pte_t))
#define TABLE_SIZE (2 * PTRS_PER_PTE * sizeof(pte_t))
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
......@@ -289,14 +283,13 @@ static __init void reserve_node_zero(unsigned int bootmap_pfn, unsigned int boot
*/
reserve_bootmem_node(pgdat, __pa(&_stext), &_end - &_stext);
#ifdef CONFIG_CPU_32
/*
* Reserve the page tables. These are already in use,
* and can only be in node 0.
*/
reserve_bootmem_node(pgdat, __pa(swapper_pg_dir),
PTRS_PER_PGD * sizeof(pgd_t));
#endif
/*
* And don't forget to reserve the allocator bitmap,
* which will be freed later.
......
......@@ -29,7 +29,7 @@
* stack+task struct. Use the same method as 'current' uses to
* reach them.
*/
register unsigned int *user_registers asm("sl");
register unsigned long *user_registers asm("sl");
#define GET_USERREG() (user_registers)
......
......@@ -29,14 +29,14 @@
#include <asm/uaccess.h>
static inline void loadSingle(const unsigned int Fn, const unsigned int *pMem)
static inline void loadSingle(const unsigned int Fn, const unsigned int __user *pMem)
{
FPA11 *fpa11 = GET_FPA11();
fpa11->fType[Fn] = typeSingle;
get_user(fpa11->fpreg[Fn].fSingle, pMem);
}
static inline void loadDouble(const unsigned int Fn, const unsigned int *pMem)
static inline void loadDouble(const unsigned int Fn, const unsigned int __user *pMem)
{
FPA11 *fpa11 = GET_FPA11();
unsigned int *p;
......@@ -47,7 +47,7 @@ static inline void loadDouble(const unsigned int Fn, const unsigned int *pMem)
}
#ifdef CONFIG_FPE_NWFPE_XP
static inline void loadExtended(const unsigned int Fn, const unsigned int *pMem)
static inline void loadExtended(const unsigned int Fn, const unsigned int __user *pMem)
{
FPA11 *fpa11 = GET_FPA11();
unsigned int *p;
......@@ -59,7 +59,7 @@ static inline void loadExtended(const unsigned int Fn, const unsigned int *pMem)
}
#endif
static inline void loadMultiple(const unsigned int Fn, const unsigned int *pMem)
static inline void loadMultiple(const unsigned int Fn, const unsigned int __user *pMem)
{
FPA11 *fpa11 = GET_FPA11();
register unsigned int *p;
......@@ -91,7 +91,7 @@ static inline void loadMultiple(const unsigned int Fn, const unsigned int *pMem)
}
}
static inline void storeSingle(const unsigned int Fn, unsigned int *pMem)
static inline void storeSingle(const unsigned int Fn, unsigned int __user *pMem)
{
FPA11 *fpa11 = GET_FPA11();
union {
......@@ -117,7 +117,7 @@ static inline void storeSingle(const unsigned int Fn, unsigned int *pMem)
put_user(val.i[0], pMem);
}
static inline void storeDouble(const unsigned int Fn, unsigned int *pMem)
static inline void storeDouble(const unsigned int Fn, unsigned int __user *pMem)
{
FPA11 *fpa11 = GET_FPA11();
union {
......@@ -145,7 +145,7 @@ static inline void storeDouble(const unsigned int Fn, unsigned int *pMem)
}
#ifdef CONFIG_FPE_NWFPE_XP
static inline void storeExtended(const unsigned int Fn, unsigned int *pMem)
static inline void storeExtended(const unsigned int Fn, unsigned int __user *pMem)
{
FPA11 *fpa11 = GET_FPA11();
union {
......@@ -172,7 +172,7 @@ static inline void storeExtended(const unsigned int Fn, unsigned int *pMem)
}
#endif
static inline void storeMultiple(const unsigned int Fn, unsigned int *pMem)
static inline void storeMultiple(const unsigned int Fn, unsigned int __user *pMem)
{
FPA11 *fpa11 = GET_FPA11();
register unsigned int nType, *p;
......@@ -204,10 +204,10 @@ static inline void storeMultiple(const unsigned int Fn, unsigned int *pMem)
unsigned int PerformLDF(const unsigned int opcode)
{
unsigned int *pBase, *pAddress, *pFinal, nRc = 1,
write_back = WRITE_BACK(opcode);
unsigned int __user *pBase, *pAddress, *pFinal;
unsigned int nRc = 1, write_back = WRITE_BACK(opcode);
pBase = (unsigned int *) readRegister(getRn(opcode));
pBase = (unsigned int __user *) readRegister(getRn(opcode));
if (REG_PC == getRn(opcode)) {
pBase += 2;
write_back = 0;
......@@ -241,18 +241,18 @@ unsigned int PerformLDF(const unsigned int opcode)
}
if (write_back)
writeRegister(getRn(opcode), (unsigned int) pFinal);
writeRegister(getRn(opcode), (unsigned long) pFinal);
return nRc;
}
unsigned int PerformSTF(const unsigned int opcode)
{
unsigned int *pBase, *pAddress, *pFinal, nRc = 1,
write_back = WRITE_BACK(opcode);
unsigned int __user *pBase, *pAddress, *pFinal;
unsigned int nRc = 1, write_back = WRITE_BACK(opcode);
SetRoundingMode(ROUND_TO_NEAREST);
pBase = (unsigned int *) readRegister(getRn(opcode));
pBase = (unsigned int __user *) readRegister(getRn(opcode));
if (REG_PC == getRn(opcode)) {
pBase += 2;
write_back = 0;
......@@ -286,16 +286,16 @@ unsigned int PerformSTF(const unsigned int opcode)
}
if (write_back)
writeRegister(getRn(opcode), (unsigned int) pFinal);
writeRegister(getRn(opcode), (unsigned long) pFinal);
return nRc;
}
unsigned int PerformLFM(const unsigned int opcode)
{
unsigned int i, Fd, *pBase, *pAddress, *pFinal,
write_back = WRITE_BACK(opcode);
unsigned int __user *pBase, *pAddress, *pFinal;
unsigned int i, Fd, write_back = WRITE_BACK(opcode);
pBase = (unsigned int *) readRegister(getRn(opcode));
pBase = (unsigned int __user *) readRegister(getRn(opcode));
if (REG_PC == getRn(opcode)) {
pBase += 2;
write_back = 0;
......@@ -322,16 +322,16 @@ unsigned int PerformLFM(const unsigned int opcode)
}
if (write_back)
writeRegister(getRn(opcode), (unsigned int) pFinal);
writeRegister(getRn(opcode), (unsigned long) pFinal);
return 1;
}
unsigned int PerformSFM(const unsigned int opcode)
{
unsigned int i, Fd, *pBase, *pAddress, *pFinal,
write_back = WRITE_BACK(opcode);
unsigned int __user *pBase, *pAddress, *pFinal;
unsigned int i, Fd, write_back = WRITE_BACK(opcode);
pBase = (unsigned int *) readRegister(getRn(opcode));
pBase = (unsigned int __user *) readRegister(getRn(opcode));
if (REG_PC == getRn(opcode)) {
pBase += 2;
write_back = 0;
......@@ -358,7 +358,7 @@ unsigned int PerformSFM(const unsigned int opcode)
}
if (write_back)
writeRegister(getRn(opcode), (unsigned int) pFinal);
writeRegister(getRn(opcode), (unsigned long) pFinal);
return 1;
}
......
......@@ -131,7 +131,7 @@ void float_raise(signed char flags)
#ifdef CONFIG_DEBUG_USER
printk(KERN_DEBUG
"NWFPE: %s[%d] takes exception %08x at %p from %08x\n",
"NWFPE: %s[%d] takes exception %08x at %p from %08lx\n",
current->comm, current->pid, flags,
__builtin_return_address(0), GET_USERREG()[15]);
#endif
......
......@@ -19,8 +19,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
extern __inline__
unsigned int readRegister(const unsigned int nReg)
static inline unsigned long readRegister(const unsigned int nReg)
{
/* Note: The CPU thinks it has dealt with the current instruction.
As a result the program counter has been advanced to the next
......@@ -29,34 +28,31 @@ unsigned int readRegister(const unsigned int nReg)
for this in this routine. LDF/STF instructions with Rn = PC
depend on the PC being correct, as they use PC+8 in their
address calculations. */
unsigned int *userRegisters = GET_USERREG();
unsigned long *userRegisters = GET_USERREG();
unsigned int val = userRegisters[nReg];
if (REG_PC == nReg)
val -= 4;
return val;
}
extern __inline__
void writeRegister(const unsigned int nReg, const unsigned int val)
static inline void
writeRegister(const unsigned int nReg, const unsigned long val)
{
unsigned int *userRegisters = GET_USERREG();
unsigned long *userRegisters = GET_USERREG();
userRegisters[nReg] = val;
}
extern __inline__
unsigned int readCPSR(void)
static inline unsigned long readCPSR(void)
{
return (readRegister(REG_CPSR));
}
extern __inline__
void writeCPSR(const unsigned int val)
static inline void writeCPSR(const unsigned long val)
{
writeRegister(REG_CPSR, val);
}
extern __inline__
unsigned int readConditionCodes(void)
static inline unsigned long readConditionCodes(void)
{
#ifdef __FPEM_TEST__
return (0);
......@@ -65,11 +61,10 @@ unsigned int readConditionCodes(void)
#endif
}
extern __inline__
void writeConditionCodes(const unsigned int val)
static inline void writeConditionCodes(const unsigned long val)
{
unsigned int *userRegisters = GET_USERREG();
unsigned int rval;
unsigned long *userRegisters = GET_USERREG();
unsigned long rval;
/*
* Operate directly on userRegisters since
* the CPSR may be the PC register itself.
......@@ -77,9 +72,3 @@ void writeConditionCodes(const unsigned int val)
rval = userRegisters[REG_CPSR] & ~CC_MASK;
userRegisters[REG_CPSR] = rval | (val & CC_MASK);
}
extern __inline__
unsigned int readMemoryInt(unsigned int *pMem)
{
return *pMem;
}
......@@ -104,7 +104,8 @@ head-y := arch/i386/kernel/head.o arch/i386/kernel/init_task.o
libs-y += arch/i386/lib/
core-y += arch/i386/kernel/ \
arch/i386/mm/ \
arch/i386/$(mcore-y)/
arch/i386/$(mcore-y)/ \
arch/i386/crypto/
drivers-$(CONFIG_MATH_EMULATION) += arch/i386/math-emu/
drivers-$(CONFIG_PCI) += arch/i386/pci/
# must be linked after kernel/
......
#
# i386/crypto/Makefile
#
# Arch-specific CryptoAPI modules.
#
obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o
aes-i586-y := aes-i586-asm.o aes.o
// -------------------------------------------------------------------------
// Copyright (c) 2001, Dr Brian Gladman < >, Worcester, UK.
// All rights reserved.
//
// LICENSE TERMS
//
// The free distribution and use of this software in both source and binary
// form is allowed (with or without changes) provided that:
//
// 1. distributions of this source code include the above copyright
// notice, this list of conditions and the following disclaimer//
//
// 2. distributions in binary form include the above copyright
// notice, this list of conditions and the following disclaimer
// in the documentation and/or other associated materials//
//
// 3. the copyright holder's name is not used to endorse products
// built using this software without specific written permission.
//
//
// ALTERNATIVELY, provided that this notice is retained in full, this product
// may be distributed under the terms of the GNU General Public License (GPL),
// in which case the provisions of the GPL apply INSTEAD OF those given above.
//
// Copyright (c) 2004 Linus Torvalds <torvalds@osdl.org>
// Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
// DISCLAIMER
//
// This software is provided 'as is' with no explicit or implied warranties
// in respect of its properties including, but not limited to, correctness
// and fitness for purpose.
// -------------------------------------------------------------------------
// Issue Date: 29/07/2002
.file "aes-i586-asm.S"
.text
// aes_rval aes_enc_blk(const unsigned char in_blk[], unsigned char out_blk[], const aes_ctx cx[1])//
// aes_rval aes_dec_blk(const unsigned char in_blk[], unsigned char out_blk[], const aes_ctx cx[1])//
#define tlen 1024 // length of each of 4 'xor' arrays (256 32-bit words)
// offsets to parameters with one register pushed onto stack
#define in_blk 8 // input byte array address parameter
#define out_blk 12 // output byte array address parameter
#define ctx 16 // AES context structure
// offsets in context structure
#define ekey 0 // encryption key schedule base address
#define nrnd 256 // number of rounds
#define dkey 260 // decryption key schedule base address
// register mapping for encrypt and decrypt subroutines
#define r0 eax
#define r1 ebx
#define r2 ecx
#define r3 edx
#define r4 esi
#define r5 edi
#define r6 ebp
#define eaxl al
#define eaxh ah
#define ebxl bl
#define ebxh bh
#define ecxl cl
#define ecxh ch
#define edxl dl
#define edxh dh
#define _h(reg) reg##h
#define h(reg) _h(reg)
#define _l(reg) reg##l
#define l(reg) _l(reg)
// This macro takes a 32-bit word representing a column and uses
// each of its four bytes to index into four tables of 256 32-bit
// words to obtain values that are then xored into the appropriate
// output registers r0, r1, r4 or r5.
// Parameters:
// %1 out_state[0]
// %2 out_state[1]
// %3 out_state[2]
// %4 out_state[3]
// %5 table base address
// %6 input register for the round (destroyed)
// %7 scratch register for the round
#define do_col(a1, a2, a3, a4, a5, a6, a7) \
movzx %l(a6),%a7; \
xor a5(,%a7,4),%a1; \
movzx %h(a6),%a7; \
shr $16,%a6; \
xor a5+tlen(,%a7,4),%a2; \
movzx %l(a6),%a7; \
movzx %h(a6),%a6; \
xor a5+2*tlen(,%a7,4),%a3; \
xor a5+3*tlen(,%a6,4),%a4;
// initialise output registers from the key schedule
#define do_fcol(a1, a2, a3, a4, a5, a6, a7, a8) \
mov 0 a8,%a1; \
movzx %l(a6),%a7; \
mov 12 a8,%a2; \
xor a5(,%a7,4),%a1; \
mov 4 a8,%a4; \
movzx %h(a6),%a7; \
shr $16,%a6; \
xor a5+tlen(,%a7,4),%a2; \
movzx %l(a6),%a7; \
movzx %h(a6),%a6; \
xor a5+3*tlen(,%a6,4),%a4; \
mov %a3,%a6; \
mov 8 a8,%a3; \
xor a5+2*tlen(,%a7,4),%a3;
// initialise output registers from the key schedule
#define do_icol(a1, a2, a3, a4, a5, a6, a7, a8) \
mov 0 a8,%a1; \
movzx %l(a6),%a7; \
mov 4 a8,%a2; \
xor a5(,%a7,4),%a1; \
mov 12 a8,%a4; \
movzx %h(a6),%a7; \
shr $16,%a6; \
xor a5+tlen(,%a7,4),%a2; \
movzx %l(a6),%a7; \
movzx %h(a6),%a6; \
xor a5+3*tlen(,%a6,4),%a4; \
mov %a3,%a6; \
mov 8 a8,%a3; \
xor a5+2*tlen(,%a7,4),%a3;
// original Gladman had conditional saves to MMX regs.
#define save(a1, a2) \
mov %a2,4*a1(%esp)
#define restore(a1, a2) \
mov 4*a2(%esp),%a1
// This macro performs a forward encryption cycle. It is entered with
// the first previous round column values in r0, r1, r4 and r5 and
// exits with the final values in the same registers, using the MMX
// registers mm0-mm1 or the stack for temporary storage
// mov current column values into the MMX registers
#define fwd_rnd(arg, table) \
/* mov current column values into the MMX registers */ \
mov %r0,%r2; \
save (0,r1); \
save (1,r5); \
\
/* compute new column values */ \
do_fcol(r0,r5,r4,r1,table, r2,r3, arg); \
do_col (r4,r1,r0,r5,table, r2,r3); \
restore(r2,0); \
do_col (r1,r0,r5,r4,table, r2,r3); \
restore(r2,1); \
do_col (r5,r4,r1,r0,table, r2,r3);
// This macro performs an inverse encryption cycle. It is entered with
// the first previous round column values in r0, r1, r4 and r5 and
// exits with the final values in the same registers, using the MMX
// registers mm0-mm1 or the stack for temporary storage
#define inv_rnd(arg, table) \
/* mov current column values into the MMX registers */ \
mov %r0,%r2; \
save (0,r1); \
save (1,r5); \
\
/* compute new column values */ \
do_icol(r0,r1,r4,r5, table, r2,r3, arg); \
do_col (r4,r5,r0,r1, table, r2,r3); \
restore(r2,0); \
do_col (r1,r4,r5,r0, table, r2,r3); \
restore(r2,1); \
do_col (r5,r0,r1,r4, table, r2,r3);
// AES (Rijndael) Encryption Subroutine
.global aes_enc_blk
.extern ft_tab
.extern fl_tab
.align 4
aes_enc_blk:
push %ebp
mov ctx(%esp),%ebp // pointer to context
xor %eax,%eax
// CAUTION: the order and the values used in these assigns
// rely on the register mappings
1: push %ebx
mov in_blk+4(%esp),%r2
push %esi
mov nrnd(%ebp),%r3 // number of rounds
push %edi
lea ekey(%ebp),%r6 // key pointer
// input four columns and xor in first round key
mov (%r2),%r0
mov 4(%r2),%r1
mov 8(%r2),%r4
mov 12(%r2),%r5
xor (%r6),%r0
xor 4(%r6),%r1
xor 8(%r6),%r4
xor 12(%r6),%r5
sub $8,%esp // space for register saves on stack
add $16,%r6 // increment to next round key
sub $10,%r3
je 4f // 10 rounds for 128-bit key
add $32,%r6
sub $2,%r3
je 3f // 12 rounds for 128-bit key
add $32,%r6
2: fwd_rnd( -64(%r6) ,ft_tab) // 14 rounds for 128-bit key
fwd_rnd( -48(%r6) ,ft_tab)
3: fwd_rnd( -32(%r6) ,ft_tab) // 12 rounds for 128-bit key
fwd_rnd( -16(%r6) ,ft_tab)
4: fwd_rnd( (%r6) ,ft_tab) // 10 rounds for 128-bit key
fwd_rnd( +16(%r6) ,ft_tab)
fwd_rnd( +32(%r6) ,ft_tab)
fwd_rnd( +48(%r6) ,ft_tab)
fwd_rnd( +64(%r6) ,ft_tab)
fwd_rnd( +80(%r6) ,ft_tab)
fwd_rnd( +96(%r6) ,ft_tab)
fwd_rnd(+112(%r6) ,ft_tab)
fwd_rnd(+128(%r6) ,ft_tab)
fwd_rnd(+144(%r6) ,fl_tab) // last round uses a different table
// move final values to the output array. CAUTION: the
// order of these assigns rely on the register mappings
add $8,%esp
mov out_blk+12(%esp),%r6
mov %r5,12(%r6)
pop %edi
mov %r4,8(%r6)
pop %esi
mov %r1,4(%r6)
pop %ebx
mov %r0,(%r6)
pop %ebp
mov $1,%eax
ret
// AES (Rijndael) Decryption Subroutine
.global aes_dec_blk
.extern it_tab
.extern il_tab
.align 4
aes_dec_blk:
push %ebp
mov ctx(%esp),%ebp // pointer to context
xor %eax,%eax
// CAUTION: the order and the values used in these assigns
// rely on the register mappings
1: push %ebx
mov in_blk+4(%esp),%r2
push %esi
mov nrnd(%ebp),%r3 // number of rounds
push %edi
lea dkey(%ebp),%r6 // key pointer
mov %r3,%r0
shl $4,%r0
add %r0,%r6
// input four columns and xor in first round key
mov (%r2),%r0
mov 4(%r2),%r1
mov 8(%r2),%r4
mov 12(%r2),%r5
xor (%r6),%r0
xor 4(%r6),%r1
xor 8(%r6),%r4
xor 12(%r6),%r5
sub $8,%esp // space for register saves on stack
sub $16,%r6 // increment to next round key
sub $10,%r3
je 4f // 10 rounds for 128-bit key
sub $32,%r6
sub $2,%r3
je 3f // 12 rounds for 128-bit key
sub $32,%r6
2: inv_rnd( +64(%r6), it_tab) // 14 rounds for 128-bit key
inv_rnd( +48(%r6), it_tab)
3: inv_rnd( +32(%r6), it_tab) // 12 rounds for 128-bit key
inv_rnd( +16(%r6), it_tab)
4: inv_rnd( (%r6), it_tab) // 10 rounds for 128-bit key
inv_rnd( -16(%r6), it_tab)
inv_rnd( -32(%r6), it_tab)
inv_rnd( -48(%r6), it_tab)
inv_rnd( -64(%r6), it_tab)
inv_rnd( -80(%r6), it_tab)
inv_rnd( -96(%r6), it_tab)
inv_rnd(-112(%r6), it_tab)
inv_rnd(-128(%r6), it_tab)
inv_rnd(-144(%r6), il_tab) // last round uses a different table
// move final values to the output array. CAUTION: the
// order of these assigns rely on the register mappings
add $8,%esp
mov out_blk+12(%esp),%r6
mov %r5,12(%r6)
pop %edi
mov %r4,8(%r6)
pop %esi
mov %r1,4(%r6)
pop %ebx
mov %r0,(%r6)
pop %ebp
mov $1,%eax
ret
This diff is collapsed.
......@@ -101,9 +101,6 @@ mtrr_write(struct file *file, const char __user *buf, size_t len, loff_t * ppos)
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
/* Can't seek (pwrite) on this device */
if (ppos != &file->f_pos)
return -ESPIPE;
memset(line, 0, LINE_SIZE);
if (len > LINE_SIZE)
len = LINE_SIZE;
......
......@@ -1512,13 +1512,6 @@ exit_pfm_fs(void)
mntput(pfmfs_mnt);
}
static loff_t
pfm_lseek(struct file *file, loff_t offset, int whence)
{
DPRINT(("pfm_lseek called\n"));
return -ESPIPE;
}
static ssize_t
pfm_read(struct file *filp, char *buf, size_t size, loff_t *ppos)
{
......@@ -1545,10 +1538,6 @@ pfm_read(struct file *filp, char *buf, size_t size, loff_t *ppos)
DPRINT(("message is too small ctx=%p (>=%ld)\n", ctx, sizeof(pfm_msg_t)));
return -EINVAL;
}
/*
* seeks are not allowed on message queues
*/
if (ppos != &filp->f_pos) return -ESPIPE;
PROTECT_CTX(ctx, flags);
......@@ -2141,7 +2130,7 @@ pfm_no_open(struct inode *irrelevant, struct file *dontcare)
static struct file_operations pfm_file_ops = {
.llseek = pfm_lseek,
.llseek = no_llseek,
.read = pfm_read,
.write = pfm_write,
.poll = pfm_poll,
......
......@@ -63,6 +63,7 @@ check_pgt_cache (void)
low = pgt_cache_water[0];
high = pgt_cache_water[1];
preempt_disable();
if (pgtable_cache_size > (u64) high) {
do {
if (pgd_quicklist)
......@@ -71,6 +72,7 @@ check_pgt_cache (void)
free_page((unsigned long)pmd_alloc_one_fast(0, 0));
} while (pgtable_cache_size > (u64) low);
}
preempt_enable();
}
void
......
......@@ -477,6 +477,9 @@ asmlinkage ssize_t sys32_pread(unsigned int fd, char * buf,
goto out;
if (pos < 0)
goto out;
ret = -ESPIPE;
if (!(file->f_mode & FMODE_PREAD))
goto out;
ret = read(file, buf, count, &pos);
if (ret > 0)
dnotify_parent(file->f_dentry, DN_ACCESS);
......@@ -511,6 +514,10 @@ asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char * buf,
if (pos < 0)
goto out;
ret = -ESPIPE;
if (!(file->f_mode & FMODE_PWRITE))
goto out;
ret = write(file, buf, count, &pos);
if (ret > 0)
dnotify_parent(file->f_dentry, DN_MODIFY);
......
......@@ -60,11 +60,11 @@ int sysctl_lasatstring(ctl_table *table, int *name, int nlen,
/* And the same for proc */
int proc_dolasatstring(ctl_table *table, int write, struct file *filp,
void *buffer, size_t *lenp)
void *buffer, size_t *lenp, loff_t *ppos)
{
int r;
down(&lasat_info_sem);
r = proc_dostring(table, write, filp, buffer, lenp);
r = proc_dostring(table, write, filp, buffer, lenp, ppos);
if ( (!write) || r) {
up(&lasat_info_sem);
return r;
......@@ -76,11 +76,11 @@ int proc_dolasatstring(ctl_table *table, int write, struct file *filp,
/* proc function to write EEPROM after changing int entry */
int proc_dolasatint(ctl_table *table, int write, struct file *filp,
void *buffer, size_t *lenp)
void *buffer, size_t *lenp, loff_t *ppos)
{
int r;
down(&lasat_info_sem);
r = proc_dointvec(table, write, filp, buffer, lenp);
r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
if ( (!write) || r) {
up(&lasat_info_sem);
return r;
......@@ -95,7 +95,7 @@ static int rtctmp;
#ifdef CONFIG_DS1603
/* proc function to read/write RealTime Clock */
int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
void *buffer, size_t *lenp)
void *buffer, size_t *lenp, loff_t *ppos)
{
int r;
down(&lasat_info_sem);
......@@ -105,7 +105,7 @@ int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
if (rtctmp < 0)
rtctmp = 0;
}
r = proc_dointvec(table, write, filp, buffer, lenp);
r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
if ( (!write) || r) {
up(&lasat_info_sem);
return r;
......@@ -180,14 +180,14 @@ void update_bcastaddr(void)
static char proc_lasat_ipbuf[32];
/* Parsing of IP address */
int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
void *buffer, size_t *lenp)
void *buffer, size_t *lenp, loff_t *ppos)
{
int len;
unsigned int ip;
char *p, c;
if (!table->data || !table->maxlen || !*lenp ||
(filp->f_pos && !write)) {
(*ppos && !write)) {
*lenp = 0;
return 0;
}
......@@ -213,7 +213,7 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
return -EFAULT;
}
proc_lasat_ipbuf[len] = 0;
filp->f_pos += *lenp;
*ppos += *lenp;
/* Now see if we can convert it to a valid IP */
ip = in_aton(proc_lasat_ipbuf);
*(unsigned int *)(table->data) = ip;
......@@ -241,7 +241,7 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
len++;
}
*lenp = len;
filp->f_pos += len;
*ppos += len;
}
update_bcastaddr();
up(&lasat_info_sem);
......@@ -277,11 +277,11 @@ static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen,
}
int proc_lasat_eeprom_value(ctl_table *table, int write, struct file *filp,
void *buffer, size_t *lenp)
void *buffer, size_t *lenp, loff_t *ppos)
{
int r;
down(&lasat_info_sem);
r = proc_dointvec(table, write, filp, buffer, lenp);
r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
if ( (!write) || r) {
up(&lasat_info_sem);
return r;
......
......@@ -1619,7 +1619,7 @@ static ssize_t sound_copy_translate_read(const u_char *userPtr,
static int mixer_open(struct inode *inode, struct file *file)
{
mixer.busy = 1;
return 0;
return nonseekable_open(inode, file);
}
......@@ -2105,7 +2105,7 @@ static int sq_open(struct inode *inode, struct file *file)
sound_set_format(AFMT_MU_LAW);
}
return 0;
return nonseekable_open(inode, file);
err_out_nobusy:
if (file->f_mode & FMODE_WRITE) {
......@@ -2404,7 +2404,7 @@ static int state_open(struct inode *inode, struct file *file)
len += sprintf(buffer+len, "\tsq.active = %d sq.syncing = %d\n",
sq.active, sq.syncing);
state.len = len;
return 0;
return nonseekable_open(inode, file);
}
......
......@@ -825,39 +825,6 @@ config PROC_DEVICETREE
an image of the device tree that the kernel copies from Open
Firmware. If unsure, say Y here.
config PPC_RTAS
bool "Support for RTAS (RunTime Abstraction Services) in /proc"
depends on PPC_OF && PROC_FS
---help---
When you use this option, you will be able to use RTAS from
userspace.
RTAS stands for RunTime Abstraction Services and should
provide a portable way to access and set system information. This is
commonly used on RS/6000 (pSeries) computers.
You can access RTAS via the special proc file system entry rtas.
Don't confuse this rtas entry with the one in /proc/device-tree/rtas
which is readonly.
If you don't know if you can use RTAS look into
/proc/device-tree/rtas. If there are some entries, it is very likely
that you will be able to use RTAS.
You can do cool things with rtas. To print out information about
various sensors in the system, just do a
$ cat /proc/rtas/sensors
or if you power off your machine at night but want it running when
you enter your office at 7:45 am, do a
# date -d 'tomorrow 7:30' +%s > /proc/rtas/poweron
and shutdown.
If unsure, say Y.
config PREP_RESIDUAL
bool "Support for PReP Residual Data"
depends on PPC_PREP
......
......@@ -22,28 +22,25 @@ endif
LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic
CPPFLAGS += -Iarch/$(ARCH)
aflags-y += -Iarch/$(ARCH)
cflags-y += -Iarch/$(ARCH) -msoft-float -pipe \
AFLAGS += -Iarch/$(ARCH)
CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \
-ffixed-r2 -Wno-uninitialized -mmultiple
CPP = $(CC) -E $(CFLAGS)
CHECK := $(CHECK) -D__powerpc__=1
ifndef CONFIG_E500
cflags-y += -mstring
CFLAGS += -mstring
endif
aflags-$(CONFIG_4xx) += -m405
cflags-$(CONFIG_4xx) += -Wa,-m405
aflags-$(CONFIG_6xx) += -maltivec
cflags-$(CONFIG_6xx) += -Wa,-maltivec
aflags-$(CONFIG_E500) += -me500
cflags-$(CONFIG_E500) += -Wa,-me500
aflags-$(CONFIG_PPC64BRIDGE) += -mppc64bridge
cflags-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge
AFLAGS += $(aflags-y)
CFLAGS += $(cflags-y)
cpu-as-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge
cpu-as-$(CONFIG_4xx) += -Wa,-m405
cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec
cpu-as-$(CONFIG_E500) += -Wa,-me500
AFLAGS += $(cpu-as-y)
CFLAGS += $(cpu-as-y)
head-y := arch/ppc/kernel/head.o
head-$(CONFIG_8xx) := arch/ppc/kernel/head_8xx.o
......
......@@ -2,16 +2,6 @@
# Makefile for the linux kernel.
#
ifdef CONFIG_PPC64BRIDGE
EXTRA_AFLAGS := -Wa,-mppc64bridge
endif
ifdef CONFIG_4xx
EXTRA_AFLAGS := -Wa,-m405
endif
ifdef CONFIG_E500
EXTRA_AFLAGS := -Wa,-me500
endif
extra-$(CONFIG_PPC_STD_MMU) := head.o
extra-$(CONFIG_40x) := head_4xx.o
extra-$(CONFIG_44x) := head_44x.o
......
/*
* Copyright (C) 2000 Ani Joshi <ajoshi@unixbox.com>
*
*
* Dynamic DMA mapping support.
*
* swiped from i386
*
*/
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/pci.h>
#include <asm/io.h>
void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
dma_addr_t *dma_handle)
{
void *ret;
int gfp = GFP_ATOMIC;
if (hwdev == NULL || hwdev->dma_mask != 0xffffffff)
gfp |= GFP_DMA;
#ifdef CONFIG_NOT_COHERENT_CACHE
ret = consistent_alloc(gfp, size, dma_handle);
#else
ret = (void *)__get_free_pages(gfp, get_order(size));
#endif
if (ret != NULL) {
memset(ret, 0, size);
#ifndef CONFIG_NOT_COHERENT_CACHE
*dma_handle = virt_to_bus(ret);
#endif
}
return ret;
}
void pci_free_consistent(struct pci_dev *hwdev, size_t size,
void *vaddr, dma_addr_t dma_handle)
{
#ifdef CONFIG_NOT_COHERENT_CACHE
consistent_free(vaddr);
#else
free_pages((unsigned long)vaddr, get_order(size));
#endif
}
......@@ -35,7 +35,7 @@ static int ppc_htab_show(struct seq_file *m, void *v);
static ssize_t ppc_htab_write(struct file * file, const char __user * buffer,
size_t count, loff_t *ppos);
int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
void __user *buffer, size_t *lenp);
void __user *buffer, size_t *lenp, loff_t *ppos);
extern PTE *Hash, *Hash_end;
extern unsigned long Hash_size, Hash_mask;
......@@ -320,7 +320,7 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
}
int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
void __user *buffer_arg, size_t *lenp)
void __user *buffer_arg, size_t *lenp, loff_t *ppos)
{
int vleft, first=1, len, left, val;
char __user *buffer = (char __user *) buffer_arg;
......@@ -344,7 +344,7 @@ int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
if (!(cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR))
return -EFAULT;
if ( /*!table->maxlen ||*/ (filp->f_pos && !write)) {
if ( /*!table->maxlen ||*/ (*ppos && !write)) {
*lenp = 0;
return 0;
}
......@@ -435,6 +435,6 @@ int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
if (write && first)
return -EINVAL;
*lenp -= left;
filp->f_pos += *lenp;
*ppos += *lenp;
return 0;
}
......@@ -93,10 +93,14 @@ ppc44x_pin_tlb(int slot, unsigned int virt, unsigned int phys)
}
/*
* Configure PPC44x TLB for AS0 exception processing.
* MMU_init_hw does the chip-specific initialization of the MMU hardware.
*/
static void __init
ppc44x_tlb_config(void)
void __init MMU_init_hw(void)
{
flush_instruction_cache();
}
unsigned long __init mmu_mapin_ram(void)
{
unsigned int pinned_tlbs = 1;
int i;
......@@ -124,39 +128,6 @@ ppc44x_tlb_config(void)
unsigned int phys_addr = (PPC44x_LOW_SLOT-i) * PPC44x_PIN_SIZE;
ppc44x_pin_tlb(i, phys_addr+PAGE_OFFSET, phys_addr);
}
}
/*
* MMU_init_hw does the chip-specific initialization of the MMU hardware.
*/
void __init MMU_init_hw(void)
{
flush_instruction_cache();
ppc44x_tlb_config();
}
/* TODO: Add large page lowmem mapping support */
unsigned long __init mmu_mapin_ram(void)
{
unsigned long v, s, f = _PAGE_GUARDED;
phys_addr_t p;
v = KERNELBASE;
p = PPC_MEMSTART;
for (s = 0; s < total_lowmem; s += PAGE_SIZE) {
if ((char *) v >= _stext && (char *) v < etext)
f |= _PAGE_RAM_TEXT;
else
f |= _PAGE_RAM;
map_page(v, p, f);
v += PAGE_SIZE;
p += PAGE_SIZE;
}
if (ppc_md.progress)
ppc_md.progress("MMU:mmu_mapin_ram done", 0x401);
return s;
return total_lowmem;
}
......@@ -2,10 +2,6 @@
# Makefile for the linux ppc-specific parts of the memory manager.
#
ifdef CONFIG_PPC64BRIDGE
EXTRA_AFLAGS := -Wa,-mppc64bridge
endif
obj-y := fault.o init.o mem_pieces.o \
mmu_context.o pgtable.o
......
......@@ -175,6 +175,15 @@ config IBM_OPENBIOS
depends on ASH || BUBINGA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
default y
config PPC4xx_DMA
bool "PPC4xx DMA controller support"
depends on 4xx
config PPC4xx_EDMA
bool
depends on !STB03xxx && PPC4xx_DMA
default y
config PM
bool "Power Management support (EXPERIMENTAL)"
depends on 4xx && EXPERIMENTAL
......
......@@ -64,7 +64,8 @@
#define UART0_IO_BASE (u8 *) 0xE0000200
#define UART1_IO_BASE (u8 *) 0xE0000300
#define BASE_BAUD 33000000/3/16
/* external Epson SG-615P */
#define BASE_BAUD 691200
#define STD_UART_OP(num) \
{ 0, BASE_BAUD, 0, UART##num##_INT, \
......
......@@ -2,13 +2,6 @@
# Makefile for the linux kernel.
#
ifdef CONFIG_PPC64BRIDGE
EXTRA_AFLAGS := -Wa,-mppc64bridge
endif
ifdef CONFIG_40x
EXTRA_AFLAGS := -Wa,-m405
endif
# Extra CFLAGS so we don't have to do relative includes
CFLAGS_pmac_setup.o += -Iarch/$(ARCH)/mm
......@@ -26,7 +19,6 @@ obj-$(CONFIG_NVRAM) += pmac_nvram.o
obj-$(CONFIG_CPU_FREQ_PMAC) += pmac_cpufreq.o
endif
obj-$(CONFIG_PMAC_BACKLIGHT) += pmac_backlight.o
obj-$(CONFIG_PPC_RTAS) += error_log.o proc_rtas.o
obj-$(CONFIG_PREP_RESIDUAL) += residual.o
obj-$(CONFIG_ADIR) += adir_setup.o adir_pic.o adir_pci.o
obj-$(CONFIG_EST8260) += est8260_setup.o
......
/*
* arch/ppc/kernel/error_log.c
*
* Copyright (c) 2000 Tilmann Bitterberg
* (tilmann@bitterberg.de)
*
* Error processing of errors found by rtas even-scan routine
* which is done with every heartbeat. (chrp_setup.c)
*/
#include <linux/sched.h>
#include <asm/prom.h>
#include "error_log.h"
/* ****************************************************************** */
/*
* EVENT-SCAN
* The whole stuff below here doesn't take any action when it found
* an error, it just prints as much information as possible and
* then its up to the user to decide what to do.
*
* Returns 0 if no errors were found
* Returns 1 if there may be more errors
*/
int ppc_rtas_errorlog_scan(void)
{
const char *_errlog_severity[] = {
#ifdef VERBOSE_ERRORS
"No Error\n\t\
Should require no further information",
"Event\n\t\
This is not really an error, it is an event. I use events\n\t\
to communicate with RTAS back and forth.",
"Warning\n\t\
Indicates a non-state-losing error, either fully recovered\n\t\
by RTAS or not needing recovery. Ignore it.",
"Error sync\n\t\
May only be fatal to a certain program or thread. Recovery\n\t\
and continuation is possible, if I only had a handler for\n\t\
this. Less serious",
"Error\n\t\
Less serious, but still causing a loss of data and state.\n\t\
I can't tell you exactly what to do, You have to decide\n\t\
with help from the target and initiator field, what kind\n\t\
of further actions may take place.",
"Fatal\n\t\
Represent a permanent hardware failure and I believe this\n\t\
affects my overall performance and behaviour. I would not\n\t\
attempt to continue normal operation."
#else
"No Error",
"Event",
"Warning",
"Error sync",
"Error",
"Fatal"
#endif /* VERBOSE_ERRORS */
};
#if 0 /* unused?? */
const char *_errlog_disposition[] = {
#ifdef VERBOSE_ERRORS
"Fully recovered\n\t\
There was an error, but it is fully recovered by RTAS.",
"Limited recovery\n\t\
RTAS was able to recover the state of the machine, but some\n\t\
feature of the machine has been disabled or lost (for example\n\t\
error checking) or performance may suffer.",
"Not recovered\n\t\
Whether RTAS did not try to recover anything or recovery failed:\n\t\
HOUSTON, WE HAVE A PROBLEM!"
#else
"Fully recovered",
"Limited recovery",
"Not recovered"
#endif /* VERBOSE_ERRORS */
};
#endif
const char *_errlog_extended[] = {
#ifdef VERBOSE_ERRORS
"Not present\n\t\
Sad, the RTAS call didn't return an extended error log.",
"Present\n\t\
The extended log is present and hopefully it contains a lot of\n\t\
useful information, which leads to the solution of the problem."
#else
"Not present",
"Present"
#endif /* VERBOSE_ERRORS */
};
const char *_errlog_initiator[] = {
"Unknown or not applicable",
"CPU",
"PCI",
"ISA",
"Memory",
"Power management"
};
const char *_errlog_target[] = {
"Unknown or not applicable",
"CPU",
"PCI",
"ISA",
"Memory",
"Power management"
};
rtas_error_log error_log;
char logdata[1024];
int error;
#if 0 /* unused?? */
int retries = 0; /* if HW error, try 10 times */
#endif
error = call_rtas ("event-scan", 4, 1, (unsigned long *)&error_log,
INTERNAL_ERROR | EPOW_WARNING,
0, __pa(logdata), 1024);
if (error == 1) /* no errors found */
return 0;
if (error == -1) {
printk(KERN_ERR "Unable to get errors. Do you a favor and throw this box away\n");
return 0;
}
if (error_log.version != 1)
printk(KERN_WARNING "Unknown version (%d), please implement me\n",
error_log.version);
switch (error_log.disposition) {
case DISP_FULLY_RECOVERED:
/* there was an error, but everything is fine now */
return 0;
case DISP_NOT_RECOVERED:
printk("We have a really serious Problem!\n");
case DISP_LIMITED_RECOVERY:
printk("Error classification\n");
printk("Severity : %s\n",
ppc_rtas_errorlog_check_severity (error_log));
printk("Initiator : %s\n",
ppc_rtas_errorlog_check_initiator (error_log));
printk("Target : %s\n",
ppc_rtas_errorlog_check_target (error_log));
printk("Type : %s\n",
ppc_rtas_errorlog_check_type (error_log));
printk("Ext. log : %s\n",
ppc_rtas_errorlog_check_extended (error_log));
if (error_log.extended)
ppc_rtas_errorlog_disect_extended (logdata);
return 1;
default:
/* nothing */
break;
}
return 0;
}
/* ****************************************************************** */
const char * ppc_rtas_errorlog_check_type (rtas_error_log error_log)
{
const char *_errlog_type[] = {
"unknown type",
"too many tries failed",
"TCE error",
"RTAS device failed",
"target timed out",
"parity error on data", /* 5 */
"parity error on address",
"parity error on external cache",
"access to invalid address",
"uncorrectable ECC error",
"corrected ECC error" /* 10 */
};
if (error_log.type == TYPE_EPOW)
return "EPOW";
if (error_log.type >= TYPE_PMGM_POWER_SW_ON)
return "PowerMGM Event (not handled right now)";
return _errlog_type[error_log.type];
}
#ifndef __ERROR_LOG_H__
#define __ERROR_LOG_H__
#define VERBOSE_ERRORS 1 /* Maybe I enlarge the kernel too much */
#undef VERBOSE_ERRORS
/* Event classes */
/* XXX: Endianess correct? NOW*/
#define INTERNAL_ERROR 0x80000000 /* set bit 0 */
#define EPOW_WARNING 0x40000000 /* set bit 1 */
#define POWERMGM_EVENTS 0x20000000 /* set bit 2 */
/* event-scan returns */
#define SEVERITY_FATAL 0x5
#define SEVERITY_ERROR 0x4
#define SEVERITY_ERROR_SYNC 0x3
#define SEVERITY_WARNING 0x2
#define SEVERITY_EVENT 0x1
#define SEVERITY_NO_ERROR 0x0
#define DISP_FULLY_RECOVERED 0x0
#define DISP_LIMITED_RECOVERY 0x1
#define DISP_NOT_RECOVERED 0x2
#define PART_PRESENT 0x0
#define PART_NOT_PRESENT 0x1
#define INITIATOR_UNKNOWN 0x0
#define INITIATOR_CPU 0x1
#define INITIATOR_PCI 0x2
#define INITIATOR_ISA 0x3
#define INITIATOR_MEMORY 0x4
#define INITIATOR_POWERMGM 0x5
#define TARGET_UNKNOWN 0x0
#define TARGET_CPU 0x1
#define TARGET_PCI 0x2
#define TARGET_ISA 0x3
#define TARGET_MEMORY 0x4
#define TARGET_POWERMGM 0x5
#define TYPE_RETRY 0x01
#define TYPE_TCE_ERR 0x02
#define TYPE_INTERN_DEV_FAIL 0x03
#define TYPE_TIMEOUT 0x04
#define TYPE_DATA_PARITY 0x05
#define TYPE_ADDR_PARITY 0x06
#define TYPE_CACHE_PARITY 0x07
#define TYPE_ADDR_INVALID 0x08
#define TYPE_ECC_UNCORR 0x09
#define TYPE_ECC_CORR 0x0a
#define TYPE_EPOW 0x40
/* I don't add PowerMGM events right now, this is a different topic */
#define TYPE_PMGM_POWER_SW_ON 0x60
#define TYPE_PMGM_POWER_SW_OFF 0x61
#define TYPE_PMGM_LID_OPEN 0x62
#define TYPE_PMGM_LID_CLOSE 0x63
#define TYPE_PMGM_SLEEP_BTN 0x64
#define TYPE_PMGM_WAKE_BTN 0x65
#define TYPE_PMGM_BATTERY_WARN 0x66
#define TYPE_PMGM_BATTERY_CRIT 0x67
#define TYPE_PMGM_SWITCH_TO_BAT 0x68
#define TYPE_PMGM_SWITCH_TO_AC 0x69
#define TYPE_PMGM_KBD_OR_MOUSE 0x6a
#define TYPE_PMGM_ENCLOS_OPEN 0x6b
#define TYPE_PMGM_ENCLOS_CLOSED 0x6c
#define TYPE_PMGM_RING_INDICATE 0x6d
#define TYPE_PMGM_LAN_ATTENTION 0x6e
#define TYPE_PMGM_TIME_ALARM 0x6f
#define TYPE_PMGM_CONFIG_CHANGE 0x70
#define TYPE_PMGM_SERVICE_PROC 0x71
typedef struct _rtas_error_log {
unsigned long version:8; /* Architectural version */
unsigned long severity:3; /* Severity level of error */
unsigned long disposition:2; /* Degree of recovery */
unsigned long extended:1; /* extended log present? */
unsigned long /* reserved */ :2; /* Reserved for future use */
unsigned long initiator:4; /* Initiator of event */
unsigned long target:4; /* Target of failed operation */
unsigned long type:8; /* General event or error*/
unsigned long extended_log_length:32; /* length in bytes */
} rtas_error_log;
/* ****************************************************************** */
#define ppc_rtas_errorlog_check_severity(x) \
(_errlog_severity[x.severity])
#define ppc_rtas_errorlog_check_target(x) \
(_errlog_target[x.target])
#define ppc_rtas_errorlog_check_initiator(x) \
(_errlog_initiator[x.initiator])
#define ppc_rtas_errorlog_check_extended(x) \
(_errlog_extended[x.extended])
#define ppc_rtas_errorlog_disect_extended(x) \
do { /* implement me */ } while(0)
extern const char * ppc_rtas_errorlog_check_type (rtas_error_log error_log);
extern int ppc_rtas_errorlog_scan(void);
#endif /* __ERROR_LOG_H__ */
This diff is collapsed.
......@@ -2,16 +2,6 @@
# Makefile for the linux kernel.
#
ifdef CONFIG_PPC64BRIDGE
EXTRA_AFLAGS := -Wa,-mppc64bridge
endif
ifdef CONFIG_4xx
EXTRA_AFLAGS := -Wa,-m405
endif
ifdef CONFIG_E500
EXTRA_AFLAGS := -Wa,-me500
endif
CFLAGS_prom_init.o += -fPIC
CFLAGS_btext.o += -fPIC
......@@ -25,7 +15,8 @@ ifeq ($(CONFIG_4xx),y)
obj-$(CONFIG_4xx) += ppc4xx_pic.o
obj-$(CONFIG_40x) += ppc4xx_setup.o
obj-$(CONFIG_GEN_RTC) += todc_time.o
obj-$(CONFIG_KGDB) += ppc4xx_kgdb.o
obj-$(CONFIG_PPC4xx_DMA) += ppc4xx_dma.o
obj-$(CONFIG_PPC4xx_EDMA) += ppc4xx_sgdma.o
ifeq ($(CONFIG_40x),y)
obj-$(CONFIG_KGDB) += ppc4xx_kgdb.o
obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o ppc405_pci.o
......
This diff is collapsed.
This diff is collapsed.
......@@ -424,8 +424,6 @@ config IRQSTACKS
for handling hard and soft interrupts. This can help avoid
overflowing the process kernel stacks.
endmenu
config SPINLINE
bool "Inline spinlock code at each call site"
depends on SMP && !PPC_SPLPAR && !PPC_ISERIES
......@@ -436,6 +434,8 @@ config SPINLINE
If in doubt, say N.
endmenu
source "security/Kconfig"
source "crypto/Kconfig"
......
......@@ -15,14 +15,11 @@ obj-y := setup.o entry.o traps.o irq.o idle.o dma.o \
obj-$(CONFIG_PPC_OF) += of_device.o
obj-$(CONFIG_PCI) += pci.o pci_dn.o pci_iommu.o
pci-obj-$(CONFIG_PPC_ISERIES) += iSeries_pci.o iSeries_pci_reset.o \
iSeries_IoMmTable.o
pci-obj-$(CONFIG_PPC_PSERIES) += pci_dn.o pci_dma_direct.o
ifdef CONFIG_PPC_ISERIES
obj-$(CONFIG_PCI) += iSeries_pci.o iSeries_pci_reset.o \
iSeries_IoMmTable.o
else
obj-$(CONFIG_PCI) += pci_dma_direct.o
endif
obj-$(CONFIG_PCI) += pci.o pci_iommu.o $(pci-obj-y)
obj-$(CONFIG_PPC_ISERIES) += iSeries_irq.o \
iSeries_VpdInfo.o XmPciLpEvent.o \
......
This diff is collapsed.
......@@ -618,7 +618,7 @@ void __init eeh_init(void)
info.buid_lo = BUID_LO(buid);
info.buid_hi = BUID_HI(buid);
traverse_pci_devices(phb, early_enable_eeh, NULL, &info);
traverse_pci_devices(phb, early_enable_eeh, &info);
}
if (eeh_subsystem_enabled) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -600,8 +600,9 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
BUG(); /* No I/O resource for this PHB? */
if (request_resource(&ioport_resource, res))
printk(KERN_ERR "Failed to request IO"
"on hose %d\n", 0 /* FIXME */);
printk(KERN_ERR "Failed to request IO on "
"PCI domain %d\n", pci_domain_nr(bus));
for (i = 0; i < 3; ++i) {
res = &hose->mem_resources[i];
......@@ -609,8 +610,9 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
BUG(); /* No memory resource for this PHB? */
bus->resource[i+1] = res;
if (res->flags && request_resource(&iomem_resource, res))
printk(KERN_ERR "Failed to request MEM"
"on hose %d\n", 0 /* FIXME */);
printk(KERN_ERR "Failed to request MEM on "
"PCI domain %d\n",
pci_domain_nr(bus));
}
} else if (pci_probe_only &&
(dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment