Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4968
b: refs/heads/master
c: 6b6a93c
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Jul 25, 2005
1 parent bda6e93 commit 7698809
Show file tree
Hide file tree
Showing 20 changed files with 101 additions and 327 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: 7686ee1ad976efeddf10583f013462c66408ae51
refs/heads/master: 6b6a93c6876ea1c530d5d3f68e3678093a27fab0
17 changes: 8 additions & 9 deletions trunk/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 trunk/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 trunk/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 trunk/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 trunk/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 trunk/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 trunk/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 trunk/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 trunk/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 trunk/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
4 changes: 2 additions & 2 deletions trunk/include/asm-arm/locks.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
" strex ip, lr, [%0]\n" \
" teq ip, #0\n" \
" bne 1b\n" \
" teq lr, #0\n" \
" cmp lr, #0\n" \
" movle ip, %0\n" \
" blle " #wake \
: \
Expand Down Expand Up @@ -100,7 +100,7 @@
__asm__ __volatile__( \
"@ up_op_read\n" \
"1: ldrex lr, [%0]\n" \
" add lr, lr, %1\n" \
" adds lr, lr, %1\n" \
" strex ip, lr, [%0]\n" \
" teq ip, #0\n" \
" bne 1b\n" \
Expand Down
35 changes: 19 additions & 16 deletions trunk/include/asm-arm/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ typedef struct {
} rwlock_t;

#define RW_LOCK_UNLOCKED (rwlock_t) { 0 }
#define rwlock_init(x) do { *(x) + RW_LOCK_UNLOCKED; } while (0)
#define rwlock_init(x) do { *(x) = RW_LOCK_UNLOCKED; } while (0)
#define rwlock_is_locked(x) (*((volatile unsigned int *)(x)) != 0)

/*
* Write locks are easy - we just set bit 31. When unlocking, we can
Expand All @@ -100,6 +101,21 @@ static inline void _raw_write_lock(rwlock_t *rw)
: "cc", "memory");
}

static inline int _raw_write_trylock(rwlock_t *rw)
{
unsigned long tmp;

__asm__ __volatile__(
"1: ldrex %0, [%1]\n"
" teq %0, #0\n"
" strexeq %0, %2, [%1]"
: "=&r" (tmp)
: "r" (&rw->lock), "r" (0x80000000)
: "cc", "memory");

return tmp == 0;
}

static inline void _raw_write_unlock(rwlock_t *rw)
{
__asm__ __volatile__(
Expand Down Expand Up @@ -138,6 +154,8 @@ static inline void _raw_read_lock(rwlock_t *rw)

static inline void _raw_read_unlock(rwlock_t *rw)
{
unsigned long tmp, tmp2;

__asm__ __volatile__(
"1: ldrex %0, [%2]\n"
" sub %0, %0, #1\n"
Expand All @@ -151,19 +169,4 @@ static inline void _raw_read_unlock(rwlock_t *rw)

#define _raw_read_trylock(lock) generic_raw_read_trylock(lock)

static inline int _raw_write_trylock(rwlock_t *rw)
{
unsigned long tmp;

__asm__ __volatile__(
"1: ldrex %0, [%1]\n"
" teq %0, #0\n"
" strexeq %0, %2, [%1]"
: "=&r" (tmp)
: "r" (&rw->lock), "r" (0x80000000)
: "cc", "memory");

return tmp == 0;
}

#endif /* __ASM_SPINLOCK_H */
Loading

0 comments on commit 7698809

Please sign in to comment.