diff options
Diffstat (limited to 'arch/mips/kernel/rtlx.c')
| -rw-r--r-- | arch/mips/kernel/rtlx.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index 8cf24d716d41..aab89e97abb5 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c | |||
| @@ -40,12 +40,11 @@ | |||
| 40 | #include <asm/atomic.h> | 40 | #include <asm/atomic.h> |
| 41 | #include <asm/cpu.h> | 41 | #include <asm/cpu.h> |
| 42 | #include <asm/processor.h> | 42 | #include <asm/processor.h> |
| 43 | #include <asm/mips_mt.h> | ||
| 43 | #include <asm/system.h> | 44 | #include <asm/system.h> |
| 44 | #include <asm/vpe.h> | 45 | #include <asm/vpe.h> |
| 45 | #include <asm/rtlx.h> | 46 | #include <asm/rtlx.h> |
| 46 | 47 | ||
| 47 | #define RTLX_TARG_VPE 1 | ||
| 48 | |||
| 49 | static struct rtlx_info *rtlx; | 48 | static struct rtlx_info *rtlx; |
| 50 | static int major; | 49 | static int major; |
| 51 | static char module_name[] = "rtlx"; | 50 | static char module_name[] = "rtlx"; |
| @@ -165,10 +164,10 @@ int rtlx_open(int index, int can_sleep) | |||
| 165 | } | 164 | } |
| 166 | 165 | ||
| 167 | if (rtlx == NULL) { | 166 | if (rtlx == NULL) { |
| 168 | if( (p = vpe_get_shared(RTLX_TARG_VPE)) == NULL) { | 167 | if( (p = vpe_get_shared(tclimit)) == NULL) { |
| 169 | if (can_sleep) { | 168 | if (can_sleep) { |
| 170 | __wait_event_interruptible(channel_wqs[index].lx_queue, | 169 | __wait_event_interruptible(channel_wqs[index].lx_queue, |
| 171 | (p = vpe_get_shared(RTLX_TARG_VPE)), | 170 | (p = vpe_get_shared(tclimit)), |
| 172 | ret); | 171 | ret); |
| 173 | if (ret) | 172 | if (ret) |
| 174 | goto out_fail; | 173 | goto out_fail; |
| @@ -472,11 +471,24 @@ static int rtlx_irq_num = MIPS_CPU_IRQ_BASE + MIPS_CPU_RTLX_IRQ; | |||
| 472 | static char register_chrdev_failed[] __initdata = | 471 | static char register_chrdev_failed[] __initdata = |
| 473 | KERN_ERR "rtlx_module_init: unable to register device\n"; | 472 | KERN_ERR "rtlx_module_init: unable to register device\n"; |
| 474 | 473 | ||
| 475 | static int rtlx_module_init(void) | 474 | static int __init rtlx_module_init(void) |
| 476 | { | 475 | { |
| 477 | struct device *dev; | 476 | struct device *dev; |
| 478 | int i, err; | 477 | int i, err; |
| 479 | 478 | ||
| 479 | if (!cpu_has_mipsmt) { | ||
| 480 | printk("VPE loader: not a MIPS MT capable processor\n"); | ||
| 481 | return -ENODEV; | ||
| 482 | } | ||
| 483 | |||
| 484 | if (tclimit == 0) { | ||
| 485 | printk(KERN_WARNING "No TCs reserved for AP/SP, not " | ||
| 486 | "initializing RTLX.\nPass maxtcs=<n> argument as kernel " | ||
| 487 | "argument\n"); | ||
| 488 | |||
| 489 | return -ENODEV; | ||
| 490 | } | ||
| 491 | |||
| 480 | major = register_chrdev(0, module_name, &rtlx_fops); | 492 | major = register_chrdev(0, module_name, &rtlx_fops); |
| 481 | if (major < 0) { | 493 | if (major < 0) { |
| 482 | printk(register_chrdev_failed); | 494 | printk(register_chrdev_failed); |
| @@ -501,7 +513,7 @@ static int rtlx_module_init(void) | |||
| 501 | /* set up notifiers */ | 513 | /* set up notifiers */ |
| 502 | notify.start = starting; | 514 | notify.start = starting; |
| 503 | notify.stop = stopping; | 515 | notify.stop = stopping; |
| 504 | vpe_notify(RTLX_TARG_VPE, ¬ify); | 516 | vpe_notify(tclimit, ¬ify); |
| 505 | 517 | ||
| 506 | if (cpu_has_vint) | 518 | if (cpu_has_vint) |
| 507 | set_vi_handler(MIPS_CPU_RTLX_IRQ, rtlx_dispatch); | 519 | set_vi_handler(MIPS_CPU_RTLX_IRQ, rtlx_dispatch); |
