Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4965
b: refs/heads/master
c: 227510c
h: refs/heads/master
i:
  4963: f89b208
v: v3
  • Loading branch information
Cal Peake authored and David S. Miller committed Jul 25, 2005
1 parent 8fac2e4 commit 8a31a42
Show file tree
Hide file tree
Showing 21 changed files with 328 additions and 102 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: e89227889cec6b66758b44c83f78dba337e5d699
refs/heads/master: 227510c7f175c44b12cdff6eab316e53dbf71f92
17 changes: 9 additions & 8 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 current_thread_info()->new_child, and
* check performance counter stuff too.
/* Clear SPARC_FLAG_NEWCHILD, switch_to leaves thread.flags in
* %o7 for us. Check performance counter stuff too.
*/
stb %g0, [%g6 + TI_NEW_CHILD]
ldx [%g6 + TI_FLAGS], %l0
andn %o7, _TIF_NEWCHILD, %l0
stx %l0, [%g6 + TI_FLAGS]
call schedule_tail
mov %g7, %o0
andcc %l0, _TIF_PERFCTR, %g0
Expand Down Expand Up @@ -1720,11 +1720,12 @@ ret_sys_call:
/* Check if force_successful_syscall_return()
* was invoked.
*/
ldub [%curptr + TI_SYS_NOERROR], %l0
brz,pt %l0, 1f
nop
ldx [%curptr + TI_FLAGS], %l0
andcc %l0, _TIF_SYSCALL_SUCCESS, %g0
be,pt %icc, 1f
andn %l0, _TIF_SYSCALL_SUCCESS, %l0
ba,pt %xcc, 80f
stb %g0, [%curptr + TI_SYS_NOERROR]
stx %l0, [%curptr + TI_FLAGS]

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

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

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

static void map_prom_timers(void)
Expand Down Expand Up @@ -845,6 +839,18 @@ 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...
*/
current_thread_info()->new_child = 0;
clear_thread_flag(TIF_NEWCHILD);

/* Attach to the address space of init_task. */
atomic_inc(&init_mm.mm_count);
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/sparc64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -2125,8 +2125,6 @@ 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: 14 additions & 0 deletions trunk/drivers/sbus/char/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ 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: 4 additions & 2 deletions trunk/drivers/sbus/char/aurora.c
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,8 @@ static void aurora_close(struct tty_struct * tty, struct file * filp)
*/
timeout = jiffies+HZ;
while(port->SRER & SRER_TXEMPTY) {
msleep_interruptible(jiffies_to_msecs(port->timeout));
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(port->timeout);
if (time_after(jiffies, timeout))
break;
}
Expand All @@ -1532,7 +1533,8 @@ static void aurora_close(struct tty_struct * tty, struct file * filp)
port->tty = 0;
if (port->blocked_open) {
if (port->close_delay) {
msleep_interruptible(jiffies_to_msecs(port->close_delay));
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(port->close_delay);
}
wake_up_interruptible(&port->open_wait);
}
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/sbus/char/bbc_envctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
* 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: 6 additions & 4 deletions trunk/drivers/sbus/char/envctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
* Daniele Bellucci <bellucda@tiscali.it>
*/

#define __KERNEL_SYSCALLS__

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

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

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

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

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

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

if(signal_pending(current))
break;

for (whichcpu = 0; whichcpu < ENVCTRL_MAX_CPU; ++whichcpu) {
Expand Down
8 changes: 3 additions & 5 deletions trunk/drivers/sbus/char/vfc_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,14 @@ 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 + usecs_to_jiffies(usecs);
dev->poll_timer.expires = jiffies +
((unsigned long)usecs*(HZ))/1000000;
dev->poll_timer.data=(unsigned long)dev;
dev->poll_timer.function=(void *)(unsigned long)vfc_i2c_delay_wakeup;
add_timer(&dev->poll_timer);
prepare_to_wait(&dev->poll_wait, &wait, TASK_UNINTERRUPTIBLE);
schedule();
sleep_on(&dev->poll_wait);
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" \
" cmp lr, #0\n" \
" teq 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" \
" adds lr, lr, %1\n" \
" add lr, lr, %1\n" \
" strex ip, lr, [%0]\n" \
" teq ip, #0\n" \
" bne 1b\n" \
Expand Down
35 changes: 16 additions & 19 deletions trunk/include/asm-arm/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ typedef struct {
} rwlock_t;

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

/*
* Write locks are easy - we just set bit 31. When unlocking, we can
Expand All @@ -101,21 +100,6 @@ 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 @@ -154,8 +138,6 @@ 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 @@ -169,4 +151,19 @@ 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 8a31a42

Please sign in to comment.