Commit 4e5adcc1 authored by Anton Blanchard's avatar Anton Blanchard

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

into samba.org:/scratch/anton/linux-2.5_work
parents 454e1bfb 390ca130
...@@ -487,10 +487,26 @@ CONFIG_VIOPATH=y ...@@ -487,10 +487,26 @@ CONFIG_VIOPATH=y
# #
CONFIG_VT=y CONFIG_VT=y
CONFIG_VT_CONSOLE=y CONFIG_VT_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_SERIAL_CONSOLE=y
# CONFIG_SERIAL_EXTENDED is not set
# CONFIG_SERIAL_NONSTANDARD is not set # CONFIG_SERIAL_NONSTANDARD is not set
#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
# CONFIG_SERIAL_8250_CS is not set
# CONFIG_SERIAL_8250_EXTENDED is not set
# CONFIG_SERIAL_8250_MANY_PORTS is not set
# CONFIG_SERIAL_8250_SHARE_IRQ is not set
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
# CONFIG_SERIAL_8250_MULTIPORT is not set
# CONFIG_SERIAL_8250_RSA is not set
#
# Non-8250 serial port support
#
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256 CONFIG_UNIX98_PTY_COUNT=256
CONFIG_HVC_CONSOLE=y CONFIG_HVC_CONSOLE=y
......
...@@ -169,10 +169,12 @@ setup_irq(unsigned int irq, struct irqaction * new) ...@@ -169,10 +169,12 @@ setup_irq(unsigned int irq, struct irqaction * new)
inline void synchronize_irq(unsigned int irq) inline void synchronize_irq(unsigned int irq)
{ {
while (irq_desc[irq].status & IRQ_INPROGRESS) { /* is there anything to synchronize with? */
barrier(); if (!irq_desc[irq].action)
return;
while (irq_desc[irq].status & IRQ_INPROGRESS)
cpu_relax(); cpu_relax();
}
} }
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
...@@ -567,7 +569,6 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq) ...@@ -567,7 +569,6 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq)
int do_IRQ(struct pt_regs *regs) int do_IRQ(struct pt_regs *regs)
{ {
int cpu = smp_processor_id();
int irq, first = 1; int irq, first = 1;
#ifdef CONFIG_PPC_ISERIES #ifdef CONFIG_PPC_ISERIES
struct paca_struct *lpaca; struct paca_struct *lpaca;
...@@ -605,7 +606,7 @@ int do_IRQ(struct pt_regs *regs) ...@@ -605,7 +606,7 @@ int do_IRQ(struct pt_regs *regs)
ppc_spurious_interrupts++; ppc_spurious_interrupts++;
#endif #endif
irq_exit(); irq_exit();
#ifdef CONFIG_PPC_ISERIES #ifdef CONFIG_PPC_ISERIES
if (lpaca->xLpPaca.xIntDword.xFields.xDecrInt) { if (lpaca->xLpPaca.xIntDword.xFields.xDecrInt) {
...@@ -615,9 +616,6 @@ int do_IRQ(struct pt_regs *regs) ...@@ -615,9 +616,6 @@ int do_IRQ(struct pt_regs *regs)
} }
#endif #endif
if (softirq_pending(cpu))
do_softirq();
return 1; /* lets ret_from_int know we can do checks */ return 1; /* lets ret_from_int know we can do checks */
} }
......
...@@ -155,7 +155,7 @@ long plpar_pte_protect(unsigned long flags, ...@@ -155,7 +155,7 @@ long plpar_pte_protect(unsigned long flags,
unsigned long ptex, unsigned long ptex,
unsigned long avpn) unsigned long avpn)
{ {
return plpar_hcall_norets(H_PROTECT, flags, ptex); return plpar_hcall_norets(H_PROTECT, flags, ptex, avpn);
} }
long plpar_tce_get(unsigned long liobn, long plpar_tce_get(unsigned long liobn,
...@@ -552,6 +552,7 @@ static long pSeries_lpar_insert_hpte(unsigned long hpte_group, ...@@ -552,6 +552,7 @@ static long pSeries_lpar_insert_hpte(unsigned long hpte_group,
int secondary, unsigned long hpteflags, int secondary, unsigned long hpteflags,
int bolted, int large) int bolted, int large)
{ {
/* XXX fix for large page */
unsigned long avpn = vpn >> 11; unsigned long avpn = vpn >> 11;
unsigned long arpn = physRpn_to_absRpn(prpn); unsigned long arpn = physRpn_to_absRpn(prpn);
unsigned long lpar_rc; unsigned long lpar_rc;
...@@ -651,11 +652,10 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot, unsigned long newpp, ...@@ -651,11 +652,10 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot, unsigned long newpp,
unsigned long va, int large) unsigned long va, int large)
{ {
unsigned long lpar_rc; unsigned long lpar_rc;
unsigned long flags; unsigned long flags = (newpp & 7) | H_AVPN;
flags = (newpp & 7) | H_AVPN; unsigned long avpn = va >> 23;
unsigned long vpn = va >> PAGE_SHIFT;
lpar_rc = plpar_pte_protect(flags, slot, (vpn >> 4) & ~0x7fUL); lpar_rc = plpar_pte_protect(flags, slot, (avpn << 7));
if (lpar_rc == H_Not_Found) { if (lpar_rc == H_Not_Found) {
udbg_printf("updatepp missed\n"); udbg_printf("updatepp missed\n");
...@@ -748,18 +748,11 @@ static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp, ...@@ -748,18 +748,11 @@ static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp,
static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va, static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
int large, int local) int large, int local)
{ {
unsigned long vpn, avpn; unsigned long avpn = va >> 23;
unsigned long lpar_rc; unsigned long lpar_rc;
unsigned long dummy1, dummy2; unsigned long dummy1, dummy2;
if (large) lpar_rc = plpar_pte_remove(H_AVPN, slot, (avpn << 7), &dummy1,
vpn = va >> LARGE_PAGE_SHIFT;
else
vpn = va >> PAGE_SHIFT;
avpn = vpn >> 11;
lpar_rc = plpar_pte_remove(H_AVPN, slot, (vpn >> 4) & ~0x7fUL, &dummy1,
&dummy2); &dummy2);
if (lpar_rc == H_Not_Found) { if (lpar_rc == H_Not_Found) {
......
...@@ -293,9 +293,6 @@ int timer_interrupt(struct pt_regs * regs) ...@@ -293,9 +293,6 @@ int timer_interrupt(struct pt_regs * regs)
irq_exit(); irq_exit();
if (softirq_pending(cpu))
do_softirq();
return 1; return 1;
} }
......
...@@ -128,13 +128,12 @@ void ...@@ -128,13 +128,12 @@ void
SystemResetException(struct pt_regs *regs) SystemResetException(struct pt_regs *regs)
{ {
if (fwnmi_active) { if (fwnmi_active) {
char *msg;
unsigned long *r3 = __va(regs->gpr[3]); /* for FWNMI debug */ unsigned long *r3 = __va(regs->gpr[3]); /* for FWNMI debug */
struct rtas_error_log *errlog; struct rtas_error_log *errlog;
msg = "FWNMI is active with save area at %016lx\n"; udbg_printf("FWNMI is active with save area at %016lx\n", r3);
udbg_printf(msg, r3); printk(msg, r3);
errlog = FWNMI_get_errinfo(regs); errlog = FWNMI_get_errinfo(regs);
FWNMI_release_errinfo();
} }
if (debugger) if (debugger)
......
...@@ -13,30 +13,86 @@ ...@@ -13,30 +13,86 @@
#include <linux/preempt.h> #include <linux/preempt.h>
typedef struct { typedef struct {
unsigned long __softirq_pending; unsigned int __softirq_pending;
unsigned long __syscall_count; unsigned int __syscall_count;
struct task_struct * __ksoftirqd_task; struct task_struct * __ksoftirqd_task;
unsigned long idle_timestamp; unsigned long idle_timestamp;
} ____cacheline_aligned irq_cpustat_t; } ____cacheline_aligned irq_cpustat_t;
#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
#define IRQ_OFFSET 64 /*
* We put the hardirq and softirq counter into the preemption
* counter. The bitmask has the following meaning:
*
* - bits 0-7 are the preemption count (max preemption depth: 256)
* - bits 8-15 are the softirq count (max # of softirqs: 256)
* - bits 16-24 are the hardirq count (max # of hardirqs: 512)
*
* - ( bit 26 is the PREEMPT_ACTIVE flag. )
*
* PREEMPT_MASK: 0x000000ff
* SOFTIRQ_MASK: 0x0000ff00
* HARDIRQ_MASK: 0x01ff0000
*/
#define PREEMPT_BITS 8
#define SOFTIRQ_BITS 8
#define HARDIRQ_BITS 9
#define PREEMPT_SHIFT 0
#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS)
#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
#define __HARDIRQ_MASK(x) ((1UL << (x))-1)
#define PREEMPT_MASK (__HARDIRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
#define SOFTIRQ_MASK (__HARDIRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
#define HARDIRQ_MASK (__HARDIRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
#define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT)
#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT)
#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT)
/*
* The hardirq mask has to be large enough to have
* space for potentially all IRQ sources in the system
* nesting on a single CPU:
*/
#if (1 << HARDIRQ_BITS) < NR_IRQS
# error HARDIRQ_BITS is too low!
#endif
/* /*
* Are we in an interrupt context? Either doing bottom half * Are we doing bottom half or hardware interrupt processing?
* or hardware interrupt processing? * Are we in a softirq context? Interrupt context?
*/ */
#define in_interrupt() \ #define in_irq() (hardirq_count())
((preempt_count() & ~PREEMPT_ACTIVE) >= IRQ_OFFSET) #define in_softirq() (softirq_count())
#define in_interrupt() (irq_count())
#define in_irq in_interrupt
#define hardirq_trylock() (!in_interrupt()) #define hardirq_trylock() (!in_interrupt())
#define hardirq_endlock() do { } while (0) #define hardirq_endlock() do { } while (0)
#define irq_enter() (preempt_count() += IRQ_OFFSET) #define irq_enter() (preempt_count() += HARDIRQ_OFFSET)
#define irq_exit() (preempt_count() -= IRQ_OFFSET)
#if CONFIG_PREEMPT
# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
#else
# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
#endif
#define irq_exit() \
do { \
preempt_count() -= IRQ_EXIT_OFFSET; \
if (!in_interrupt() && softirq_pending(smp_processor_id())) \
do_softirq(); \
preempt_enable_no_resched(); \
} while (0)
#ifndef CONFIG_SMP #ifndef CONFIG_SMP
# define synchronize_irq(irq) barrier() # define synchronize_irq(irq) barrier()
...@@ -45,4 +101,13 @@ typedef struct { ...@@ -45,4 +101,13 @@ typedef struct {
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#define show_stack(SP) \
do { \
if (SP) \
print_backtrace(SP); \
else \
print_backtrace(_get_SP()); \
} while (0)
#endif /* __ASM_HARDIRQ_H */ #endif /* __ASM_HARDIRQ_H */
...@@ -12,24 +12,16 @@ ...@@ -12,24 +12,16 @@
#include <asm/hardirq.h> #include <asm/hardirq.h>
#define local_bh_disable() \ #define local_bh_disable() \
do { preempt_count() += IRQ_OFFSET; barrier(); } while (0) do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define __local_bh_enable() \ #define __local_bh_enable() \
do { barrier(); preempt_count() -= IRQ_OFFSET; } while (0) do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
#define local_bh_enable() \ #define local_bh_enable() \
do { \ do { \
if (unlikely((preempt_count() == IRQ_OFFSET) && \ __local_bh_enable(); \
softirq_pending(smp_processor_id()))) { \ if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
__local_bh_enable(); \ do_softirq(); \
do_softirq(); \ preempt_check_resched(); \
preempt_check_resched(); \
} else { \
__local_bh_enable(); \
preempt_check_resched(); \
} \
} while (0) } while (0)
#define in_softirq() in_interrupt()
#endif /* __ASM_SOFTIRQ_H */ #endif /* __ASM_SOFTIRQ_H */
...@@ -88,26 +88,18 @@ struct task_struct; ...@@ -88,26 +88,18 @@ struct task_struct;
extern void __switch_to(struct task_struct *, struct task_struct *); extern void __switch_to(struct task_struct *, struct task_struct *);
#define switch_to(prev, next, last) __switch_to((prev), (next)) #define switch_to(prev, next, last) __switch_to((prev), (next))
#define prepare_arch_schedule(prev) do { } while(0)
#define finish_arch_schedule(prev) do { } while(0)
#define prepare_arch_switch(rq) do { } while(0)
#define finish_arch_switch(rq) spin_unlock_irq(&(rq)->lock)
struct thread_struct; struct thread_struct;
extern void _switch(struct thread_struct *prev, struct thread_struct *next); extern void _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 *);
#ifndef CONFIG_SMP #define irqs_disabled() \
({ \
#define cli() local_irq_disable() unsigned long flags; \
#define sti() local_irq_enable() local_save_flags(flags); \
#define save_flags(flags) local_save_flags(flags) !(flags & MSR_EE); \
#define restore_flags(flags) local_irq_restore(flags) })
#define save_and_cli(flags) local_irq_save(flags)
#endif /* !CONFIG_SMP */
static __inline__ int __is_processor(unsigned long pv) static __inline__ int __is_processor(unsigned long pv)
{ {
......
...@@ -27,6 +27,8 @@ struct thread_info { ...@@ -27,6 +27,8 @@ struct thread_info {
/* /*
* macros/functions for gaining access to the thread information structure * macros/functions for gaining access to the thread information structure
*
* preempt_count needs to be 1 initially, until the scheduler is functional.
*/ */
#define INIT_THREAD_INFO(tsk) \ #define INIT_THREAD_INFO(tsk) \
{ \ { \
...@@ -34,6 +36,7 @@ struct thread_info { ...@@ -34,6 +36,7 @@ struct thread_info {
exec_domain: &default_exec_domain, \ exec_domain: &default_exec_domain, \
flags: 0, \ flags: 0, \
cpu: 0, \ cpu: 0, \
preempt_count: 1, \
} }
#define init_thread_info (init_thread_union.thread_info) #define init_thread_info (init_thread_union.thread_info)
......
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