Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67259
b: refs/heads/master
c: dc559f7
h: refs/heads/master
i:
  67257: f6798c7
  67255: f3c5867
v: v3
  • Loading branch information
Olof Johansson authored and Paul Mackerras committed Aug 22, 2007
1 parent f273bd0 commit adc9c9c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 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: e5d8d54db25790524da34b0143f4e0176fb7677b
refs/heads/master: dc559f7cd5d6d11a99b6c29402b31fbb3f3a1db0
24 changes: 14 additions & 10 deletions trunk/arch/powerpc/platforms/pasemi/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,30 @@ static void pas_restart(char *cmd)

#ifdef CONFIG_SMP
static DEFINE_SPINLOCK(timebase_lock);
static unsigned long timebase;

static void __devinit pas_give_timebase(void)
{
unsigned long tb;

spin_lock(&timebase_lock);
mtspr(SPRN_TBCTL, TBCTL_FREEZE);
tb = mftb();
mtspr(SPRN_TBCTL, TBCTL_UPDATE_LOWER | (tb & 0xffffffff));
mtspr(SPRN_TBCTL, TBCTL_UPDATE_UPPER | (tb >> 32));
mtspr(SPRN_TBCTL, TBCTL_RESTART);
isync();
timebase = get_tb();
spin_unlock(&timebase_lock);
pr_debug("pas_give_timebase: cpu %d gave tb %lx\n",
smp_processor_id(), tb);

while (timebase)
barrier();
mtspr(SPRN_TBCTL, TBCTL_RESTART);
}

static void __devinit pas_take_timebase(void)
{
pr_debug("pas_take_timebase: cpu %d has tb %lx\n",
smp_processor_id(), mftb());
while (!timebase)
smp_rmb();

spin_lock(&timebase_lock);
set_tb(timebase >> 32, timebase & 0xffffffff);
timebase = 0;
spin_unlock(&timebase_lock);
}

struct smp_ops_t pas_smp_ops = {
Expand Down

0 comments on commit adc9c9c

Please sign in to comment.