Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Jul 25, 2005
2 parents 4e8fd22 + db7d9a4 commit e892278
Show file tree
Hide file tree
Showing 17 changed files with 79 additions and 308 deletions.
17 changes: 8 additions & 9 deletions arch/sparc64/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -1600,11 +1600,11 @@ sys_clone: flushw
ba,pt %xcc, sparc_do_fork
add %sp, PTREGS_OFF, %o2
ret_from_syscall:
/* Clear SPARC_FLAG_NEWCHILD, switch_to leaves thread.flags in
* %o7 for us. Check performance counter stuff too.
/* Clear current_thread_info()->new_child, and
* check performance counter stuff too.
*/
andn %o7, _TIF_NEWCHILD, %l0
stx %l0, [%g6 + TI_FLAGS]
stb %g0, [%g6 + TI_NEW_CHILD]
ldx [%g6 + TI_FLAGS], %l0
call schedule_tail
mov %g7, %o0
andcc %l0, _TIF_PERFCTR, %g0
Expand Down Expand Up @@ -1720,12 +1720,11 @@ ret_sys_call:
/* Check if force_successful_syscall_return()
* was invoked.
*/
ldx [%curptr + TI_FLAGS], %l0
andcc %l0, _TIF_SYSCALL_SUCCESS, %g0
be,pt %icc, 1f
andn %l0, _TIF_SYSCALL_SUCCESS, %l0
ldub [%curptr + TI_SYS_NOERROR], %l0
brz,pt %l0, 1f
nop
ba,pt %xcc, 80f
stx %l0, [%curptr + TI_FLAGS]
stb %g0, [%curptr + TI_SYS_NOERROR]

1:
cmp %o0, -ERESTART_RESTARTBLOCK
Expand Down
20 changes: 7 additions & 13 deletions arch/sparc64/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,8 +782,14 @@ static void distribute_irqs(void)
}
#endif

struct sun5_timer {
u64 count0;
u64 limit0;
u64 count1;
u64 limit1;
};

struct sun5_timer *prom_timers;
static struct sun5_timer *prom_timers;
static u64 prom_limit0, prom_limit1;

static void map_prom_timers(void)
Expand Down Expand Up @@ -839,18 +845,6 @@ static void kill_prom_timer(void)
: "g1", "g2");
}

void enable_prom_timer(void)
{
if (!prom_timers)
return;

/* Set it to whatever was there before. */
prom_timers->limit1 = prom_limit1;
prom_timers->count1 = 0;
prom_timers->limit0 = prom_limit0;
prom_timers->count0 = 0;
}

void init_irqwork_curcpu(void)
{
register struct irq_work_struct *workp asm("o2");
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,8 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
memcpy(child_trap_frame, (((struct sparc_stackf *)regs)-1), (TRACEREG_SZ+STACKFRAME_SZ));

t->flags = (t->flags & ~((0xffUL << TI_FLAG_CWP_SHIFT) | (0xffUL << TI_FLAG_CURRENT_DS_SHIFT))) |
_TIF_NEWCHILD |
(((regs->tstate + 1) & TSTATE_CWP) << TI_FLAG_CWP_SHIFT);
t->new_child = 1;
t->ksp = ((unsigned long) child_trap_frame) - STACK_BIAS;
t->kregs = (struct pt_regs *)(child_trap_frame+sizeof(struct sparc_stackf));
t->fpsaved[0] = 0;
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc64/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void __init smp_callin(void)
/* Clear this or we will die instantly when we
* schedule back to this idler...
*/
clear_thread_flag(TIF_NEWCHILD);
current_thread_info()->new_child = 0;

/* Attach to the address space of init_task. */
atomic_inc(&init_mm.mm_count);
Expand Down
2 changes: 2 additions & 0 deletions arch/sparc64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -2125,6 +2125,8 @@ void __init trap_init(void)
TI_PCR != offsetof(struct thread_info, pcr_reg) ||
TI_CEE_STUFF != offsetof(struct thread_info, cee_stuff) ||
TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) ||
TI_NEW_CHILD != offsetof(struct thread_info, new_child) ||
TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) ||
TI_FPREGS != offsetof(struct thread_info, fpregs) ||
(TI_FPREGS & (64 - 1)))
thread_info_offsets_are_bolixed_dave();
Expand Down
14 changes: 0 additions & 14 deletions drivers/sbus/char/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,6 @@ config SUN_JSFLASH

# XXX Why don't we do "source drivers/char/Config.in" somewhere?
# no shit
config APM_RTC_IS_GMT
bool
depends on EXPERIMENTAL && SPARC32 && PCI
default y
help
Say Y here if your RTC (Real Time Clock a.k.a. hardware clock)
stores the time in GMT (Greenwich Mean Time). Say N if your RTC
stores localtime.

It is in fact recommended to store GMT in your RTC, because then you
don't have to worry about daylight savings time changes. The only
reason not to use GMT in your RTC is if you also run a broken OS
that doesn't understand GMT.

config RTC
tristate "PC-style Real Time Clock Support"
depends on PCI && EXPERIMENTAL && SPARC32
Expand Down
6 changes: 2 additions & 4 deletions drivers/sbus/char/aurora.c
Original file line number Diff line number Diff line change
Expand Up @@ -1515,8 +1515,7 @@ static void aurora_close(struct tty_struct * tty, struct file * filp)
*/
timeout = jiffies+HZ;
while(port->SRER & SRER_TXEMPTY) {
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(port->timeout);
msleep_interruptible(jiffies_to_msecs(port->timeout));
if (time_after(jiffies, timeout))
break;
}
Expand All @@ -1533,8 +1532,7 @@ static void aurora_close(struct tty_struct * tty, struct file * filp)
port->tty = 0;
if (port->blocked_open) {
if (port->close_delay) {
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(port->close_delay);
msleep_interruptible(jiffies_to_msecs(port->close_delay));
}
wake_up_interruptible(&port->open_wait);
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/sbus/char/bbc_envctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
* Copyright (C) 2001 David S. Miller (davem@redhat.com)
*/

#define __KERNEL_SYSCALLS__

#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <asm/oplib.h>
#include <asm/ebus.h>
#define __KERNEL_SYSCALLS__
static int errno;
#include <asm/unistd.h>

Expand Down
10 changes: 4 additions & 6 deletions drivers/sbus/char/envctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* Daniele Bellucci <bellucda@tiscali.it>
*/

#define __KERNEL_SYSCALLS__

#include <linux/config.h>
#include <linux/module.h>
#include <linux/sched.h>
Expand All @@ -35,7 +37,6 @@
#include <asm/uaccess.h>
#include <asm/envctrl.h>

#define __KERNEL_SYSCALLS__
static int errno;
#include <asm/unistd.h>

Expand Down Expand Up @@ -1007,7 +1008,7 @@ static int kenvctrld(void *__unused)
return -ENODEV;
}

poll_interval = 5 * HZ; /* TODO env_mon_interval */
poll_interval = 5000; /* TODO env_mon_interval */

daemonize("kenvctrld");
allow_signal(SIGKILL);
Expand All @@ -1016,10 +1017,7 @@ static int kenvctrld(void *__unused)

printk(KERN_INFO "envctrl: %s starting...\n", current->comm);
for (;;) {
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(poll_interval);

if(signal_pending(current))
if(msleep_interruptible(poll_interval))
break;

for (whichcpu = 0; whichcpu < ENVCTRL_MAX_CPU; ++whichcpu) {
Expand Down
8 changes: 5 additions & 3 deletions drivers/sbus/char/vfc_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,16 @@ void vfc_i2c_delay_wakeup(struct vfc_dev *dev)

void vfc_i2c_delay_no_busy(struct vfc_dev *dev, unsigned long usecs)
{
DEFINE_WAIT(wait);
init_timer(&dev->poll_timer);
dev->poll_timer.expires = jiffies +
((unsigned long)usecs*(HZ))/1000000;
dev->poll_timer.expires = jiffies + usecs_to_jiffies(usecs);
dev->poll_timer.data=(unsigned long)dev;
dev->poll_timer.function=(void *)(unsigned long)vfc_i2c_delay_wakeup;
add_timer(&dev->poll_timer);
sleep_on(&dev->poll_wait);
prepare_to_wait(&dev->poll_wait, &wait, TASK_UNINTERRUPTIBLE);
schedule();
del_timer(&dev->poll_timer);
finish_wait(&dev->poll_wait, &wait);
}

void inline vfc_i2c_delay(struct vfc_dev *dev)
Expand Down
56 changes: 28 additions & 28 deletions include/asm-sparc64/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,52 +20,52 @@ extern void change_bit(unsigned long nr, volatile unsigned long *addr);

/* "non-atomic" versions... */

static __inline__ void __set_bit(int nr, volatile unsigned long *addr)
static inline void __set_bit(int nr, volatile unsigned long *addr)
{
volatile unsigned long *m = addr + (nr >> 6);
unsigned long *m = ((unsigned long *)addr) + (nr >> 6);

*m |= (1UL << (nr & 63));
}

static __inline__ void __clear_bit(int nr, volatile unsigned long *addr)
static inline void __clear_bit(int nr, volatile unsigned long *addr)
{
volatile unsigned long *m = addr + (nr >> 6);
unsigned long *m = ((unsigned long *)addr) + (nr >> 6);

*m &= ~(1UL << (nr & 63));
}

static __inline__ void __change_bit(int nr, volatile unsigned long *addr)
static inline void __change_bit(int nr, volatile unsigned long *addr)
{
volatile unsigned long *m = addr + (nr >> 6);
unsigned long *m = ((unsigned long *)addr) + (nr >> 6);

*m ^= (1UL << (nr & 63));
}

static __inline__ int __test_and_set_bit(int nr, volatile unsigned long *addr)
static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
{
volatile unsigned long *m = addr + (nr >> 6);
long old = *m;
long mask = (1UL << (nr & 63));
unsigned long *m = ((unsigned long *)addr) + (nr >> 6);
unsigned long old = *m;
unsigned long mask = (1UL << (nr & 63));

*m = (old | mask);
return ((old & mask) != 0);
}

static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long *addr)
static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
{
volatile unsigned long *m = addr + (nr >> 6);
long old = *m;
long mask = (1UL << (nr & 63));
unsigned long *m = ((unsigned long *)addr) + (nr >> 6);
unsigned long old = *m;
unsigned long mask = (1UL << (nr & 63));

*m = (old & ~mask);
return ((old & mask) != 0);
}

static __inline__ int __test_and_change_bit(int nr, volatile unsigned long *addr)
static inline int __test_and_change_bit(int nr, volatile unsigned long *addr)
{
volatile unsigned long *m = addr + (nr >> 6);
long old = *m;
long mask = (1UL << (nr & 63));
unsigned long *m = ((unsigned long *)addr) + (nr >> 6);
unsigned long old = *m;
unsigned long mask = (1UL << (nr & 63));

*m = (old ^ mask);
return ((old & mask) != 0);
Expand All @@ -79,13 +79,13 @@ static __inline__ int __test_and_change_bit(int nr, volatile unsigned long *addr
#define smp_mb__after_clear_bit() barrier()
#endif

static __inline__ int test_bit(int nr, __const__ volatile unsigned long *addr)
static inline int test_bit(int nr, __const__ volatile unsigned long *addr)
{
return (1UL & ((addr)[nr >> 6] >> (nr & 63))) != 0UL;
return (1UL & (addr[nr >> 6] >> (nr & 63))) != 0UL;
}

/* The easy/cheese version for now. */
static __inline__ unsigned long ffz(unsigned long word)
static inline unsigned long ffz(unsigned long word)
{
unsigned long result;

Expand All @@ -103,7 +103,7 @@ static __inline__ unsigned long ffz(unsigned long word)
*
* Undefined if no bit exists, so code should check against 0 first.
*/
static __inline__ unsigned long __ffs(unsigned long word)
static inline unsigned long __ffs(unsigned long word)
{
unsigned long result = 0;

Expand Down Expand Up @@ -144,7 +144,7 @@ static inline int sched_find_first_bit(unsigned long *b)
* the libc and compiler builtin ffs routines, therefore
* differs in spirit from the above ffz (man ffs).
*/
static __inline__ int ffs(int x)
static inline int ffs(int x)
{
if (!x)
return 0;
Expand All @@ -158,31 +158,31 @@ static __inline__ int ffs(int x)

#ifdef ULTRA_HAS_POPULATION_COUNT

static __inline__ unsigned int hweight64(unsigned long w)
static inline unsigned int hweight64(unsigned long w)
{
unsigned int res;

__asm__ ("popc %1,%0" : "=r" (res) : "r" (w));
return res;
}

static __inline__ unsigned int hweight32(unsigned int w)
static inline unsigned int hweight32(unsigned int w)
{
unsigned int res;

__asm__ ("popc %1,%0" : "=r" (res) : "r" (w & 0xffffffff));
return res;
}

static __inline__ unsigned int hweight16(unsigned int w)
static inline unsigned int hweight16(unsigned int w)
{
unsigned int res;

__asm__ ("popc %1,%0" : "=r" (res) : "r" (w & 0xffff));
return res;
}

static __inline__ unsigned int hweight8(unsigned int w)
static inline unsigned int hweight8(unsigned int w)
{
unsigned int res;

Expand Down Expand Up @@ -236,7 +236,7 @@ extern unsigned long find_next_zero_bit(const unsigned long *,
#define test_and_clear_le_bit(nr,addr) \
test_and_clear_bit((nr) ^ 0x38, (addr))

static __inline__ int test_le_bit(int nr, __const__ unsigned long * addr)
static inline int test_le_bit(int nr, __const__ unsigned long * addr)
{
int mask;
__const__ unsigned char *ADDR = (__const__ unsigned char *) addr;
Expand Down
5 changes: 3 additions & 2 deletions include/asm-sparc64/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ struct sparc_trapf {
#define STACKFRAME32_SZ sizeof(struct sparc_stackf32)

#ifdef __KERNEL__
#define force_successful_syscall_return() \
set_thread_flag(TIF_SYSCALL_SUCCESS)
#define force_successful_syscall_return() \
do { current_thread_info()->syscall_noerror = 1; \
} while (0)
#define user_mode(regs) (!((regs)->tstate & TSTATE_PRIV))
#define instruction_pointer(regs) ((regs)->tpc)
#ifdef CONFIG_SMP
Expand Down
Loading

0 comments on commit e892278

Please sign in to comment.