Commit f99104c0 authored by David S. Miller's avatar David S. Miller

Merge nuts.ninka.net:/home/davem/src/BK/sparcwork-2.5

into nuts.ninka.net:/home/davem/src/BK/sparc-2.5
parents 664bd62e 51983eb2
...@@ -1597,7 +1597,8 @@ L: ultralinux@vger.kernel.org ...@@ -1597,7 +1597,8 @@ L: ultralinux@vger.kernel.org
S: Maintained S: Maintained
SPARC (sparc32): SPARC (sparc32):
S: Unmaintained L: sparclinux@vger.kernel.org
S: Unmaintained - please send patches to mailing list
SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER
P: Roger Wolff P: Roger Wolff
......
...@@ -72,7 +72,7 @@ device_scan(void) ...@@ -72,7 +72,7 @@ device_scan(void)
if (linux_num_cpus == 0) { if (linux_num_cpus == 0) {
printk("No CPU nodes found, cannot continue.\n"); printk("No CPU nodes found, cannot continue.\n");
/* Probably a sun4e, Sun is trying to trick us ;-) */ /* Probably a sun4e, Sun is trying to trick us ;-) */
halt(); prom_halt();
} }
printk("Found %d CPU prom device tree node(s).\n", linux_num_cpus); printk("Found %d CPU prom device tree node(s).\n", linux_num_cpus);
} }
......
...@@ -777,7 +777,7 @@ void ioport_init(void) ...@@ -777,7 +777,7 @@ void ioport_init(void)
default: default:
printk("ioport_init: cpu type %d is unknown.\n", printk("ioport_init: cpu type %d is unknown.\n",
sparc_cpu_model); sparc_cpu_model);
halt(); prom_halt();
}; };
} }
......
...@@ -725,3 +725,39 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ...@@ -725,3 +725,39 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
"g1", "g2", "g3", "o0", "o1", "memory", "cc"); "g1", "g2", "g3", "o0", "o1", "memory", "cc");
return retval; return retval;
} }
extern void scheduling_functions_start_here(void);
extern void scheduling_functions_end_here(void);
unsigned long get_wchan(struct task_struct *task)
{
unsigned long pc, fp, bias = 0;
unsigned long task_base = (unsigned long) task;
unsigned long ret = 0;
struct reg_window *rw;
int count = 0;
if (!task || task == current ||
task->state == TASK_RUNNING)
goto out;
fp = task->thread_info->ksp + bias;
do {
/* Bogus frame pointer? */
if (fp < (task_base + sizeof(struct task_struct)) ||
fp >= (task_base + (2 * PAGE_SIZE)))
break;
rw = (struct reg_window *) fp;
pc = rw->ins[7];
if (pc < ((unsigned long) scheduling_functions_start_here) ||
pc >= ((unsigned long) scheduling_functions_end_here)) {
ret = pc;
goto out;
}
fp = rw->ins[6] + bias;
} while (++count < 16);
out:
return ret;
}
...@@ -814,3 +814,41 @@ asmlinkage int sparc_execve(struct pt_regs *regs) ...@@ -814,3 +814,41 @@ asmlinkage int sparc_execve(struct pt_regs *regs)
out: out:
return error; return error;
} }
extern void scheduling_functions_start_here(void);
extern void scheduling_functions_end_here(void);
unsigned long get_wchan(struct task_struct *task)
{
unsigned long pc, fp, bias = 0;
unsigned long thread_info_base;
struct reg_window *rw;
unsigned long ret = 0;
int count = 0;
if (!task || task == current ||
task->state == TASK_RUNNING)
goto out;
thread_info_base = (unsigned long) task->thread_info;
bias = STACK_BIAS;
fp = task->thread_info->ksp + bias;
do {
/* Bogus frame pointer? */
if (fp < (thread_info_base + sizeof(struct thread_info)) ||
fp >= (thread_info_base + THREAD_SIZE))
break;
rw = (struct reg_window *) fp;
pc = rw->ins[7];
if (pc < ((unsigned long) scheduling_functions_start_here) ||
pc >= ((unsigned long) scheduling_functions_end_here)) {
ret = pc;
goto out;
}
fp = rw->ins[6] + bias;
} while (++count < 16);
out:
return ret;
}
...@@ -139,34 +139,7 @@ extern __inline__ void start_thread(struct pt_regs * regs, unsigned long pc, ...@@ -139,34 +139,7 @@ extern __inline__ void start_thread(struct pt_regs * regs, unsigned long pc,
#define release_thread(tsk) do { } while(0) #define release_thread(tsk) do { } while(0)
extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
#define get_wchan(__TSK) \ extern unsigned long get_wchan(struct task_struct *);
({ extern void scheduling_functions_start_here(void); \
extern void scheduling_functions_end_here(void); \
unsigned long pc, fp, bias = 0; \
unsigned long task_base = (unsigned long) (__TSK); \
unsigned long __ret = 0; \
struct reg_window *rw; \
int count = 0; \
if (!(__TSK) || (__TSK) == current || \
(__TSK)->state == TASK_RUNNING) \
goto __out; \
fp = (__TSK)->thread_info->ksp + bias; \
do { \
/* Bogus frame pointer? */ \
if (fp < (task_base + sizeof(struct task_struct)) || \
fp >= (task_base + (2 * PAGE_SIZE))) \
break; \
rw = (struct reg_window *) fp; \
pc = rw->ins[7]; \
if (pc < ((unsigned long) scheduling_functions_start_here) || \
pc >= ((unsigned long) scheduling_functions_end_here)) { \
__ret = pc; \
goto __out; \
} \
fp = rw->ins[6] + bias; \
} while (++count < 16); \
__out: __ret; \
})
#define KSTK_EIP(tsk) ((tsk)->thread.kregs->pc) #define KSTK_EIP(tsk) ((tsk)->thread.kregs->pc)
#define KSTK_ESP(tsk) ((tsk)->thread.kregs->u_regs[UREG_FP]) #define KSTK_ESP(tsk) ((tsk)->thread.kregs->u_regs[UREG_FP])
......
...@@ -53,9 +53,6 @@ extern unsigned long empty_bad_page; ...@@ -53,9 +53,6 @@ extern unsigned long empty_bad_page;
extern unsigned long empty_bad_page_table; extern unsigned long empty_bad_page_table;
extern unsigned long empty_zero_page; extern unsigned long empty_zero_page;
extern struct linux_romvec *romvec;
#define halt() romvec->pv_halt()
extern void sun_do_break(void); extern void sun_do_break(void);
extern int serial_console; extern int serial_console;
extern int stop_a_enabled; extern int stop_a_enabled;
......
...@@ -187,36 +187,7 @@ do { \ ...@@ -187,36 +187,7 @@ do { \
extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
#define get_wchan(__TSK) \ extern unsigned long get_wchan(struct task_struct *task);
({ extern void scheduling_functions_start_here(void); \
extern void scheduling_functions_end_here(void); \
unsigned long pc, fp, bias = 0; \
unsigned long thread_info_base; \
struct reg_window *rw; \
unsigned long __ret = 0; \
int count = 0; \
if (!(__TSK) || (__TSK) == current || \
(__TSK)->state == TASK_RUNNING) \
goto __out; \
thread_info_base = (unsigned long) ((__TSK)->thread_info); \
bias = STACK_BIAS; \
fp = (__TSK)->thread_info->ksp + bias; \
do { \
/* Bogus frame pointer? */ \
if (fp < (thread_info_base + sizeof(struct thread_info)) || \
fp >= (thread_info_base + THREAD_SIZE)) \
break; \
rw = (struct reg_window *) fp; \
pc = rw->ins[7]; \
if (pc < ((unsigned long) scheduling_functions_start_here) || \
pc >= ((unsigned long) scheduling_functions_end_here)) { \
__ret = pc; \
goto __out; \
} \
fp = rw->ins[6] + bias; \
} while (++count < 16); \
__out: __ret; \
})
#define KSTK_EIP(tsk) ((tsk)->thread_info->kregs->tpc) #define KSTK_EIP(tsk) ((tsk)->thread_info->kregs->tpc)
#define KSTK_ESP(tsk) ((tsk)->thread_info->kregs->u_regs[UREG_FP]) #define KSTK_ESP(tsk) ((tsk)->thread_info->kregs->u_regs[UREG_FP])
......
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