diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2007-07-27 14:37:51 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-07-31 16:35:26 -0400 |
commit | 0f5d0df35ea9efe52242b9b3c79517cc50202e37 (patch) | |
tree | b5b87edabbd07de0bc792cee161ae4039d12287d /arch/mips/kernel/vpe.c | |
parent | 41790e04e6656fa1aef205ad9a76ab4edbb5f14a (diff) |
[MIPS] RP: Sysfs interface for stopping RP program
The old method of attempting to load a invalid program was just too icky.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/vpe.c')
-rw-r--r-- | arch/mips/kernel/vpe.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 1323cb6d058d..3c09b9785f4c 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c | |||
@@ -1340,6 +1340,23 @@ static void kspd_sp_exit( int sp_id) | |||
1340 | } | 1340 | } |
1341 | #endif | 1341 | #endif |
1342 | 1342 | ||
1343 | static ssize_t store_kill(struct class_device *dev, const char *buf, size_t len) | ||
1344 | { | ||
1345 | struct vpe *vpe = get_vpe(tclimit); | ||
1346 | struct vpe_notifications *not; | ||
1347 | |||
1348 | list_for_each_entry(not, &vpe->notify, list) { | ||
1349 | not->stop(tclimit); | ||
1350 | } | ||
1351 | |||
1352 | release_progmem(vpe->load_addr); | ||
1353 | cleanup_tc(get_tc(tclimit)); | ||
1354 | vpe_stop(vpe); | ||
1355 | vpe_free(vpe); | ||
1356 | |||
1357 | return len; | ||
1358 | } | ||
1359 | |||
1343 | static ssize_t show_ntcs(struct class_device *cd, char *buf) | 1360 | static ssize_t show_ntcs(struct class_device *cd, char *buf) |
1344 | { | 1361 | { |
1345 | struct vpe *vpe = get_vpe(tclimit); | 1362 | struct vpe *vpe = get_vpe(tclimit); |
@@ -1369,6 +1386,7 @@ out_einval: | |||
1369 | } | 1386 | } |
1370 | 1387 | ||
1371 | static struct class_device_attribute vpe_class_attributes[] = { | 1388 | static struct class_device_attribute vpe_class_attributes[] = { |
1389 | __ATTR(kill, S_IWUSR, NULL, store_kill), | ||
1372 | __ATTR(ntcs, S_IRUGO | S_IWUSR, show_ntcs, store_ntcs), | 1390 | __ATTR(ntcs, S_IRUGO | S_IWUSR, show_ntcs, store_ntcs), |
1373 | {} | 1391 | {} |
1374 | }; | 1392 | }; |