Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95749
b: refs/heads/master
c: c0cd661
h: refs/heads/master
i:
  95747: fbb9e66
v: v3
  • Loading branch information
Hidetoshi Seto authored and Tony Luck committed May 1, 2008
1 parent 5173b35 commit a8812d4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 34 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: 6d3c51110819918617d9e2d1da7ff53f4b2c1187
refs/heads/master: c0cd661b1b0ad83dac54420169ec9ca14df409e9
68 changes: 35 additions & 33 deletions trunk/arch/ia64/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,33 @@ unlock_ipi_calllock(void)
spin_unlock_irq(&call_lock);
}

static inline void
handle_call_data(void)
{
struct call_data_struct *data;
void (*func)(void *info);
void *info;
int wait;

/* release the 'pointer lock' */
data = (struct call_data_struct *)call_data;
func = data->func;
info = data->info;
wait = data->wait;

mb();
atomic_inc(&data->started);
/* At this point the structure may be gone unless wait is true. */
(*func)(info);

/* Notify the sending CPU that the task is done. */
mb();
if (wait)
atomic_inc(&data->finished);
}

static void
stop_this_cpu (void)
stop_this_cpu(void)
{
/*
* Remove this CPU:
Expand Down Expand Up @@ -138,44 +163,21 @@ handle_IPI (int irq, void *dev_id)
ops &= ~(1 << which);

switch (which) {
case IPI_CALL_FUNC:
{
struct call_data_struct *data;
void (*func)(void *info);
void *info;
int wait;

/* release the 'pointer lock' */
data = (struct call_data_struct *) call_data;
func = data->func;
info = data->info;
wait = data->wait;

mb();
atomic_inc(&data->started);
/*
* At this point the structure may be gone unless
* wait is true.
*/
(*func)(info);

/* Notify the sending CPU that the task is done. */
mb();
if (wait)
atomic_inc(&data->finished);
}
break;

case IPI_CPU_STOP:
case IPI_CALL_FUNC:
handle_call_data();
break;

case IPI_CPU_STOP:
stop_this_cpu();
break;
#ifdef CONFIG_KEXEC
case IPI_KDUMP_CPU_STOP:
case IPI_KDUMP_CPU_STOP:
unw_init_running(kdump_cpu_freeze, NULL);
break;
#endif
default:
printk(KERN_CRIT "Unknown IPI on CPU %d: %lu\n", this_cpu, which);
default:
printk(KERN_CRIT "Unknown IPI on CPU %d: %lu\n",
this_cpu, which);
break;
}
} while (ops);
Expand Down

0 comments on commit a8812d4

Please sign in to comment.