Commit e4840b0e authored by Anton Blanchard's avatar Anton Blanchard

Merge samba.org:/scratch/anton/linux-2.5

into samba.org:/scratch/anton/sfr
parents 3815cbcd 8420aa16
...@@ -46,6 +46,7 @@ CONFIG_NR_CPUS=32 ...@@ -46,6 +46,7 @@ CONFIG_NR_CPUS=32
# CONFIG_HMT is not set # CONFIG_HMT is not set
# CONFIG_DISCONTIGMEM is not set # CONFIG_DISCONTIGMEM is not set
# CONFIG_RTAS_FLASH is not set # CONFIG_RTAS_FLASH is not set
CONFIG_SCANLOG=y
CONFIG_PPC_RTAS=y CONFIG_PPC_RTAS=y
# #
...@@ -54,7 +55,6 @@ CONFIG_PPC_RTAS=y ...@@ -54,7 +55,6 @@ CONFIG_PPC_RTAS=y
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_KCORE_ELF=y CONFIG_KCORE_ELF=y
CONFIG_BINFMT_ELF=y CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_ELF32=y
# CONFIG_BINFMT_MISC is not set # CONFIG_BINFMT_MISC is not set
CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_LEGACY_PROC=y
CONFIG_PCI_NAMES=y CONFIG_PCI_NAMES=y
......
...@@ -180,7 +180,7 @@ static struct aligninfo aligninfo[128] = { ...@@ -180,7 +180,7 @@ static struct aligninfo aligninfo[128] = {
#define SWAP(a, b) (t = (a), (a) = (b), (b) = t) #define SWAP(a, b) (t = (a), (a) = (b), (b) = t)
unsigned static inline make_dsisr( unsigned instr ) static inline unsigned make_dsisr(unsigned instr)
{ {
unsigned dsisr; unsigned dsisr;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/sys.h> #include <asm/unistd.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/mmu.h> #include <asm/mmu.h>
...@@ -301,6 +301,8 @@ _GLOBAL(_switch) ...@@ -301,6 +301,8 @@ _GLOBAL(_switch)
REST_8GPRS(14, r1) REST_8GPRS(14, r1)
REST_10GPRS(22, r1) REST_10GPRS(22, r1)
/* convert old thread to its task_struct for return value */
addi r3,r3,-THREAD
ld r7,_NIP(r1) /* Return to _switch caller in new task */ ld r7,_NIP(r1) /* Return to _switch caller in new task */
mtlr r7 mtlr r7
addi r1,r1,SWITCH_FRAME_SIZE addi r1,r1,SWITCH_FRAME_SIZE
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/eeh.h> #include <asm/eeh.h>
#include <asm/tlb.h> #include <asm/tlb.h>
#include <asm/cacheflush.h>
/* /*
* Note: pte --> Linux PTE * Note: pte --> Linux PTE
...@@ -348,6 +349,9 @@ int __hash_page(unsigned long ea, unsigned long access, unsigned long vsid, ...@@ -348,6 +349,9 @@ int __hash_page(unsigned long ea, unsigned long access, unsigned long vsid,
} }
} }
if (unlikely(slot == -2))
panic("hash_page: pte_insert failed\n");
pte_val(new_pte) |= (slot<<12) & _PAGE_GROUP_IX; pte_val(new_pte) |= (slot<<12) & _PAGE_GROUP_IX;
/* /*
......
...@@ -555,14 +555,15 @@ void openpic_request_IPIs(void) ...@@ -555,14 +555,15 @@ void openpic_request_IPIs(void)
if (OpenPIC == NULL) if (OpenPIC == NULL)
return; return;
request_irq(openpic_vec_ipi, /* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
openpic_ipi_action, 0, "IPI0 (call function)", 0); request_irq(openpic_vec_ipi, openpic_ipi_action, SA_INTERRUPT,
request_irq(openpic_vec_ipi+1, "IPI0 (call function)", 0);
openpic_ipi_action, 0, "IPI1 (reschedule)", 0); request_irq(openpic_vec_ipi+1, openpic_ipi_action, SA_INTERRUPT,
request_irq(openpic_vec_ipi+2, "IPI1 (reschedule)", 0);
openpic_ipi_action, 0, "IPI2 (invalidate tlb)", 0); request_irq(openpic_vec_ipi+2, openpic_ipi_action, SA_INTERRUPT,
request_irq(openpic_vec_ipi+3, "IPI2 (invalidate tlb)", 0);
openpic_ipi_action, 0, "IPI3 (xmon break)", 0); request_irq(openpic_vec_ipi+3, openpic_ipi_action, SA_INTERRUPT,
"IPI3 (xmon break)", 0);
for ( i = 0; i < OPENPIC_NUM_IPI ; i++ ) for ( i = 0; i < OPENPIC_NUM_IPI ; i++ )
openpic_enable_ipi(openpic_vec_ipi+i); openpic_enable_ipi(openpic_vec_ipi+i);
...@@ -754,17 +755,12 @@ static void openpic_set_affinity(unsigned int irq_nr, unsigned long cpumask) ...@@ -754,17 +755,12 @@ static void openpic_set_affinity(unsigned int irq_nr, unsigned long cpumask)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
static void openpic_end_ipi(unsigned int irq_nr) static void openpic_end_ipi(unsigned int irq_nr)
{ {
/* IPIs are marked IRQ_PER_CPU. This has the side effect of /*
* IPIs are marked IRQ_PER_CPU. This has the side effect of
* preventing the IRQ_PENDING/IRQ_INPROGRESS logic from * preventing the IRQ_PENDING/IRQ_INPROGRESS logic from
* applying to them. We EOI them late to avoid re-entering. * applying to them. We EOI them late to avoid re-entering.
* however, I'm wondering if we could simply let them have the * We mark IPI's with SA_INTERRUPT as they must run with
* SA_INTERRUPT flag and let them execute with all interrupts OFF. * irqs disabled.
* This would have the side effect of either running cross-CPU
* functions with interrupts off, or we can re-enable them explicitely
* with a local_irq_enable() in smp_call_function_interrupt(), since
* smp_call_function() is protected by a spinlock.
* Or maybe we shouldn't set the IRQ_PER_CPU flag on cross-CPU
* function calls IPI at all but that would make a special case.
*/ */
openpic_eoi(); openpic_eoi();
} }
......
...@@ -460,8 +460,13 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group, ...@@ -460,8 +460,13 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
if (lpar_rc == H_PTEG_Full) if (lpar_rc == H_PTEG_Full)
return -1; return -1;
/*
* Since we try and ioremap PHBs we dont own, the pte insert
* will fail. However we must catch the failure in hash_page
* or we will loop forever, so return -2 in this case.
*/
if (lpar_rc != H_Success) if (lpar_rc != H_Success)
panic("Bad return code from pte enter rc = %lx\n", lpar_rc); return -2;
return slot; return slot;
} }
......
...@@ -82,11 +82,12 @@ dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpregs) ...@@ -82,11 +82,12 @@ dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpregs)
return 1; return 1;
} }
void struct task_struct *__switch_to(struct task_struct *prev,
__switch_to(struct task_struct *prev, struct task_struct *new) struct task_struct *new)
{ {
struct thread_struct *new_thread, *old_thread; struct thread_struct *new_thread, *old_thread;
unsigned long flags; unsigned long flags;
struct task_struct *last;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* avoid complexity of lazy save/restore of fpu /* avoid complexity of lazy save/restore of fpu
...@@ -106,8 +107,9 @@ __switch_to(struct task_struct *prev, struct task_struct *new) ...@@ -106,8 +107,9 @@ __switch_to(struct task_struct *prev, struct task_struct *new)
old_thread = &current->thread; old_thread = &current->thread;
local_irq_save(flags); local_irq_save(flags);
_switch(old_thread, new_thread); last = _switch(old_thread, new_thread);
local_irq_restore(flags); local_irq_restore(flags);
return last;
} }
static void show_tsk_stack(struct task_struct *p, unsigned long sp); static void show_tsk_stack(struct task_struct *p, unsigned long sp);
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include <asm/unistd.h> #include <asm/unistd.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#define DEBUG_SIG 0
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
/* /*
* These are the flags in the MSR that the user is allowed to change * These are the flags in the MSR that the user is allowed to change
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/signal.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -423,8 +424,11 @@ xics_init_IRQ( void ) ...@@ -423,8 +424,11 @@ xics_init_IRQ( void )
} }
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
real_irq_to_virt_map[XICS_IPI] = virt_irq_to_real_map[XICS_IPI] = XICS_IPI; real_irq_to_virt_map[XICS_IPI] = virt_irq_to_real_map[XICS_IPI] =
request_irq(XICS_IPI + XICS_IRQ_OFFSET, xics_ipi_action, 0, "IPI", 0); XICS_IPI;
/* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
request_irq(XICS_IPI + XICS_IRQ_OFFSET, xics_ipi_action, SA_INTERRUPT,
"IPI", 0);
irq_desc[XICS_IPI+XICS_IRQ_OFFSET].status |= IRQ_PER_CPU; irq_desc[XICS_IPI+XICS_IRQ_OFFSET].status |= IRQ_PER_CPU;
#endif #endif
ppc64_boot_msg(0x21, "XICS Done"); ppc64_boot_msg(0x21, "XICS Done");
......
...@@ -233,6 +233,7 @@ static void map_io_page(unsigned long ea, unsigned long pa, int flags) ...@@ -233,6 +233,7 @@ static void map_io_page(unsigned long ea, unsigned long pa, int flags)
hpteg = ((hash & htab_data.htab_hash_mask)*HPTES_PER_GROUP); hpteg = ((hash & htab_data.htab_hash_mask)*HPTES_PER_GROUP);
/* Panic if a pte grpup is full */
if (ppc_md.hpte_insert(hpteg, va, pa >> PAGE_SHIFT, 0, if (ppc_md.hpte_insert(hpteg, va, pa >> PAGE_SHIFT, 0,
_PAGE_NO_CACHE|_PAGE_GUARDED|PP_RWXX, _PAGE_NO_CACHE|_PAGE_GUARDED|PP_RWXX,
1, 0) == -1) { 1, 0) == -1) {
......
...@@ -82,7 +82,7 @@ typedef struct { ...@@ -82,7 +82,7 @@ typedef struct {
#define irq_enter() (preempt_count() += HARDIRQ_OFFSET) #define irq_enter() (preempt_count() += HARDIRQ_OFFSET)
#if CONFIG_PREEMPT #ifdef CONFIG_PREEMPT
# define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked()) # define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
#else #else
......
...@@ -26,6 +26,8 @@ typedef unsigned long __kernel_size_t; ...@@ -26,6 +26,8 @@ typedef unsigned long __kernel_size_t;
typedef long __kernel_ssize_t; typedef long __kernel_ssize_t;
typedef long __kernel_ptrdiff_t; typedef long __kernel_ptrdiff_t;
typedef long __kernel_time_t; typedef long __kernel_time_t;
typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef long __kernel_suseconds_t; typedef long __kernel_suseconds_t;
typedef long __kernel_clock_t; typedef long __kernel_clock_t;
typedef int __kernel_daddr_t; typedef int __kernel_daddr_t;
......
...@@ -23,12 +23,12 @@ struct semaphore { ...@@ -23,12 +23,12 @@ struct semaphore {
*/ */
atomic_t count; atomic_t count;
wait_queue_head_t wait; wait_queue_head_t wait;
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
long __magic; long __magic;
#endif #endif
}; };
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
# define __SEM_DEBUG_INIT(name) \ # define __SEM_DEBUG_INIT(name) \
, (long)&(name).__magic , (long)&(name).__magic
#else #else
...@@ -53,7 +53,7 @@ static inline void sema_init (struct semaphore *sem, int val) ...@@ -53,7 +53,7 @@ static inline void sema_init (struct semaphore *sem, int val)
{ {
atomic_set(&sem->count, val); atomic_set(&sem->count, val);
init_waitqueue_head(&sem->wait); init_waitqueue_head(&sem->wait);
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
sem->__magic = (long)&sem->__magic; sem->__magic = (long)&sem->__magic;
#endif #endif
} }
...@@ -74,7 +74,7 @@ extern void __up(struct semaphore * sem); ...@@ -74,7 +74,7 @@ extern void __up(struct semaphore * sem);
static inline void down(struct semaphore * sem) static inline void down(struct semaphore * sem)
{ {
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
might_sleep(); might_sleep();
...@@ -91,7 +91,7 @@ static inline int down_interruptible(struct semaphore * sem) ...@@ -91,7 +91,7 @@ static inline int down_interruptible(struct semaphore * sem)
{ {
int ret = 0; int ret = 0;
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
might_sleep(); might_sleep();
...@@ -106,7 +106,7 @@ static inline int down_trylock(struct semaphore * sem) ...@@ -106,7 +106,7 @@ static inline int down_trylock(struct semaphore * sem)
{ {
int ret; int ret;
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
...@@ -117,7 +117,7 @@ static inline int down_trylock(struct semaphore * sem) ...@@ -117,7 +117,7 @@ static inline int down_trylock(struct semaphore * sem)
static inline void up(struct semaphore * sem) static inline void up(struct semaphore * sem)
{ {
#if WAITQUEUE_DEBUG #ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
......
...@@ -89,11 +89,13 @@ extern void cvt_df(double *from, float *to, unsigned long *fpscr); ...@@ -89,11 +89,13 @@ extern void cvt_df(double *from, float *to, unsigned long *fpscr);
extern int abs(int); extern int abs(int);
struct task_struct; struct task_struct;
extern void __switch_to(struct task_struct *, struct task_struct *); extern struct task_struct *__switch_to(struct task_struct *,
#define switch_to(prev, next, last) __switch_to((prev), (next)) struct task_struct *);
#define switch_to(prev, next, last) ((last) = __switch_to((prev), (next)))
struct thread_struct; struct thread_struct;
extern void _switch(struct thread_struct *prev, struct thread_struct *next); extern struct task_struct * _switch(struct thread_struct *prev,
struct thread_struct *next);
struct pt_regs; struct pt_regs;
extern void dump_regs(struct pt_regs *); extern void dump_regs(struct pt_regs *);
......
...@@ -251,6 +251,9 @@ ...@@ -251,6 +251,9 @@
#define __NR_sys_epoll_wait 238 #define __NR_sys_epoll_wait 238
#define __NR_remap_file_pages 239 #define __NR_remap_file_pages 239
#define NR_syscalls 260
#ifndef __ASSEMBLY__
#ifdef __KERNEL_SYSCALLS__ #ifdef __KERNEL_SYSCALLS__
/* /*
...@@ -284,4 +287,6 @@ extern pid_t waitpid(pid_t pid, int *wait_stat, int options); ...@@ -284,4 +287,6 @@ extern pid_t waitpid(pid_t pid, int *wait_stat, int options);
*/ */
#define cond_syscall(x) asm(".weak\t." #x "\n\t.set\t." #x ",.sys_ni_syscall"); #define cond_syscall(x) asm(".weak\t." #x "\n\t.set\t." #x ",.sys_ni_syscall");
#endif /* __ASSEMBLY__ */
#endif /* _ASM_PPC_UNISTD_H_ */ #endif /* _ASM_PPC_UNISTD_H_ */
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