Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48197
b: refs/heads/master
c: 135637a
h: refs/heads/master
i:
  48195: 6ee695b
v: v3
  • Loading branch information
Kumar Gala committed Feb 8, 2007
1 parent 4199722 commit a563fa8
Show file tree
Hide file tree
Showing 28 changed files with 582 additions and 89 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97c5a20ae68774b4c9246c4657be0d88317f103f
refs/heads/master: 135637aa781a0480ba4ef2d3ad18fae408ace874
19 changes: 17 additions & 2 deletions trunk/arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,21 @@ config PPC_MPC52xx
bool
default n

config PPC_MPC5200
bool
select PPC_MPC52xx
default n

config PPC_MPC5200_BUGFIX
bool "MPC5200 (L25R) bugfix support"
depends on PPC_MPC5200
default n
help
Enable workarounds for original MPC5200 errata. This is not required
for MPC5200B based boards.

It is safe to say 'Y' here

config PPC_EFIKA
bool "bPlan Efika 5k2. MPC5200B based computer"
depends on PPC_MULTIPLATFORM && PPC32
Expand All @@ -448,7 +463,7 @@ config PPC_EFIKA
config PPC_LITE5200
bool "Freescale Lite5200 Eval Board"
depends on PPC_MULTIPLATFORM && PPC32
select PPC_MPC52xx
select PPC_MPC5200
default n

config PPC_PMAC
Expand Down Expand Up @@ -1206,7 +1221,7 @@ source "arch/powerpc/oprofile/Kconfig"

config KPROBES
bool "Kprobes (EXPERIMENTAL)"
depends on PPC64 && KALLSYMS && EXPERIMENTAL && MODULES
depends on !BOOKE && !4xx && KALLSYMS && EXPERIMENTAL && MODULES
help
Kprobes allows you to trap at almost any kernel address and
execute a callback function. register_kprobe() establishes
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/powerpc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,10 @@ void do_IRQ(struct pt_regs *regs)

/*
* Every platform is required to implement ppc_md.get_irq.
* This function will either return an irq number or -1 to
* This function will either return an irq number or NO_IRQ to
* indicate there are no more pending.
* The value -2 is for buggy hardware and means that this IRQ
* has already been handled. -- Tom
* The value NO_IRQ_IGNORE is for buggy hardware and means that this
* IRQ has already been handled. -- Tom
*/
irq = ppc_md.get_irq();

Expand Down
8 changes: 6 additions & 2 deletions trunk/arch/powerpc/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
if ((unsigned long)p->addr & 0x03) {
printk("Attempt to register kprobe at an unaligned address\n");
ret = -EINVAL;
} else if (IS_MTMSRD(insn) || IS_RFID(insn)) {
printk("Cannot register a kprobe on rfid or mtmsrd\n");
} else if (IS_MTMSRD(insn) || IS_RFID(insn) || IS_RFI(insn)) {
printk("Cannot register a kprobe on rfi/rfid or mtmsr[d]\n");
ret = -EINVAL;
}

Expand Down Expand Up @@ -483,8 +483,12 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
memcpy(&kcb->jprobe_saved_regs, regs, sizeof(struct pt_regs));

/* setup return addr to the jprobe handler routine */
#ifdef CONFIG_PPC64
regs->nip = (unsigned long)(((func_descr_t *)jp->entry)->entry);
regs->gpr[2] = (unsigned long)(((func_descr_t *)jp->entry)->toc);
#else
regs->nip = (unsigned long)jp->entry;
#endif

return 1;
}
Expand Down
11 changes: 7 additions & 4 deletions trunk/arch/powerpc/kernel/lparcfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,10 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf,

ssize_t retval = -ENOMEM;

if (!firmware_has_feature(FW_FEATURE_SPLPAR) ||
firmware_has_feature(FW_FEATURE_ISERIES))
return -EINVAL;

kbuf = kmalloc(count, GFP_KERNEL);
if (!kbuf)
goto out;
Expand Down Expand Up @@ -517,7 +521,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
static ssize_t lparcfg_write(struct file *file, const char __user * buf,
size_t count, loff_t * off)
{
return count;
return -EINVAL;
}

#endif /* CONFIG_PPC_PSERIES */
Expand Down Expand Up @@ -570,6 +574,7 @@ static int lparcfg_open(struct inode *inode, struct file *file)
struct file_operations lparcfg_fops = {
.owner = THIS_MODULE,
.read = seq_read,
.write = lparcfg_write,
.open = lparcfg_open,
.release = single_release,
};
Expand All @@ -581,10 +586,8 @@ int __init lparcfg_init(void)

/* Allow writing if we have FW_FEATURE_SPLPAR */
if (firmware_has_feature(FW_FEATURE_SPLPAR) &&
!firmware_has_feature(FW_FEATURE_ISERIES)) {
lparcfg_fops.write = lparcfg_write;
!firmware_has_feature(FW_FEATURE_ISERIES))
mode |= S_IWUSR;
}

ent = create_proc_entry("ppc64/lparcfg", mode, NULL);
if (ent) {
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/powerpc/kernel/setup_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ int have_of = 1;

#ifdef CONFIG_VGA_CONSOLE
unsigned long vgacon_remap_base;
EXPORT_SYMBOL(vgacon_remap_base);
#endif

/*
Expand Down
109 changes: 74 additions & 35 deletions trunk/arch/powerpc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,34 +535,40 @@ static void emulate_single_step(struct pt_regs *regs)
}
}

static void parse_fpe(struct pt_regs *regs)
static inline int __parse_fpscr(unsigned long fpscr)
{
int code = 0;
unsigned long fpscr;

flush_fp_to_thread(current);

fpscr = current->thread.fpscr.val;
int ret = 0;

/* Invalid operation */
if ((fpscr & FPSCR_VE) && (fpscr & FPSCR_VX))
code = FPE_FLTINV;
ret = FPE_FLTINV;

/* Overflow */
else if ((fpscr & FPSCR_OE) && (fpscr & FPSCR_OX))
code = FPE_FLTOVF;
ret = FPE_FLTOVF;

/* Underflow */
else if ((fpscr & FPSCR_UE) && (fpscr & FPSCR_UX))
code = FPE_FLTUND;
ret = FPE_FLTUND;

/* Divide by zero */
else if ((fpscr & FPSCR_ZE) && (fpscr & FPSCR_ZX))
code = FPE_FLTDIV;
ret = FPE_FLTDIV;

/* Inexact result */
else if ((fpscr & FPSCR_XE) && (fpscr & FPSCR_XX))
code = FPE_FLTRES;
ret = FPE_FLTRES;

return ret;
}

static void parse_fpe(struct pt_regs *regs)
{
int code = 0;

flush_fp_to_thread(current);

code = __parse_fpscr(current->thread.fpscr.val);

_exception(SIGFPE, regs, code, regs->nip);
}
Expand Down Expand Up @@ -739,20 +745,7 @@ void __kprobes program_check_exception(struct pt_regs *regs)
extern int do_mathemu(struct pt_regs *regs);

/* We can now get here via a FP Unavailable exception if the core
* has no FPU, in that case no reason flags will be set */
#ifdef CONFIG_MATH_EMULATION
/* (reason & REASON_ILLEGAL) would be the obvious thing here,
* but there seems to be a hardware bug on the 405GP (RevD)
* that means ESR is sometimes set incorrectly - either to
* ESR_DST (!?) or 0. In the process of chasing this with the
* hardware people - not sure if it can happen on any illegal
* instruction or only on FP instructions, whether there is a
* pattern to occurences etc. -dgibson 31/Mar/2003 */
if (!(reason & REASON_TRAP) && do_mathemu(regs) == 0) {
emulate_single_step(regs);
return;
}
#endif /* CONFIG_MATH_EMULATION */
* has no FPU, in that case the reason flags will be 0 */

if (reason & REASON_FP) {
/* IEEE FP exception */
Expand All @@ -778,6 +771,31 @@ void __kprobes program_check_exception(struct pt_regs *regs)

local_irq_enable();

#ifdef CONFIG_MATH_EMULATION
/* (reason & REASON_ILLEGAL) would be the obvious thing here,
* but there seems to be a hardware bug on the 405GP (RevD)
* that means ESR is sometimes set incorrectly - either to
* ESR_DST (!?) or 0. In the process of chasing this with the
* hardware people - not sure if it can happen on any illegal
* instruction or only on FP instructions, whether there is a
* pattern to occurences etc. -dgibson 31/Mar/2003 */
switch (do_mathemu(regs)) {
case 0:
emulate_single_step(regs);
return;
case 1: {
int code = 0;
code = __parse_fpscr(current->thread.fpscr.val);
_exception(SIGFPE, regs, code, regs->nip);
return;
}
case -EFAULT:
_exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
return;
}
/* fall through on any other errors */
#endif /* CONFIG_MATH_EMULATION */

/* Try to emulate it if we should. */
if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED)) {
switch (emulate_instruction(regs)) {
Expand Down Expand Up @@ -891,18 +909,39 @@ void SoftwareEmulation(struct pt_regs *regs)

#ifdef CONFIG_MATH_EMULATION
errcode = do_mathemu(regs);

switch (errcode) {
case 0:
emulate_single_step(regs);
return;
case 1: {
int code = 0;
code = __parse_fpscr(current->thread.fpscr.val);
_exception(SIGFPE, regs, code, regs->nip);
return;
}
case -EFAULT:
_exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
return;
default:
_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
return;
}

#else
errcode = Soft_emulate_8xx(regs);
#endif
if (errcode) {
if (errcode > 0)
_exception(SIGFPE, regs, 0, 0);
else if (errcode == -EFAULT)
_exception(SIGSEGV, regs, 0, 0);
else
_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
} else
switch (errcode) {
case 0:
emulate_single_step(regs);
return;
case 1:
_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
return;
case -EFAULT:
_exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
return;
}
#endif
}
#endif /* CONFIG_8xx */

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ obj-$(CONFIG_PPC64) += checksum_64.o copypage_64.o copyuser_64.o \
strcase.o
obj-$(CONFIG_QUICC_ENGINE) += rheap.o
obj-$(CONFIG_XMON) += sstep.o
obj-$(CONFIG_KPROBES) += sstep.o
obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o

ifeq ($(CONFIG_PPC64),y)
obj-$(CONFIG_SMP) += locks.o
obj-$(CONFIG_DEBUG_KERNEL) += sstep.o
endif

# Temporary hack until we have migrated to asm-powerpc
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/powerpc/lib/rheap.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/slab.h>

Expand Down Expand Up @@ -671,7 +672,7 @@ void rh_dump(rh_info_t * info)
int maxnr;
int i, nr;

maxnr = sizeof(st) / sizeof(st[0]);
maxnr = ARRAY_SIZE(st);

printk(KERN_INFO
"info @0x%p (%d slots empty / %d max)\n",
Expand Down
4 changes: 0 additions & 4 deletions trunk/arch/powerpc/mm/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ unsigned long memory_limit;
extern void hash_preload(struct mm_struct *mm, unsigned long ea,
unsigned long access, unsigned long trap);

/*
* This is called by /dev/mem to know if a given address has to
* be mapped non-cacheable or not
*/
int page_is_ram(unsigned long pfn)
{
unsigned long paddr = (pfn << PAGE_SHIFT);
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/powerpc/platforms/52xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
ifeq ($(CONFIG_PPC_MERGE),y)
obj-y += mpc52xx_pic.o mpc52xx_common.o
obj-$(CONFIG_PCI) += mpc52xx_pci.o
endif

obj-$(CONFIG_PPC_EFIKA) += efika-setup.o efika-pci.o
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/powerpc/platforms/52xx/lite5200.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ static void __init lite52xx_setup_arch(void)
mpc52xx_setup_cpu(); /* Generic */
lite52xx_setup_cpu(); /* Platorm specific */

#ifdef CONFIG_PCI
np = of_find_node_by_type(np, "pci");
if (np)
mpc52xx_add_bridge(np);
#endif

#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start)
ROOT_DEV = Root_RAM0;
Expand Down
Loading

0 comments on commit a563fa8

Please sign in to comment.