diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/m68k/kernel/sys_m68k.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'arch/m68k/kernel/sys_m68k.c')
-rw-r--r-- | arch/m68k/kernel/sys_m68k.c | 105 |
1 files changed, 68 insertions, 37 deletions
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c index 2f431ece7b5f..8623f8dc16f8 100644 --- a/arch/m68k/kernel/sys_m68k.c +++ b/arch/m68k/kernel/sys_m68k.c | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
13 | #include <linux/fs.h> | 13 | #include <linux/fs.h> |
14 | #include <linux/smp.h> | 14 | #include <linux/smp.h> |
15 | #include <linux/smp_lock.h> | ||
16 | #include <linux/sem.h> | 15 | #include <linux/sem.h> |
17 | #include <linux/msg.h> | 16 | #include <linux/msg.h> |
18 | #include <linux/shm.h> | 17 | #include <linux/shm.h> |
@@ -28,7 +27,10 @@ | |||
28 | #include <asm/traps.h> | 27 | #include <asm/traps.h> |
29 | #include <asm/page.h> | 28 | #include <asm/page.h> |
30 | #include <asm/unistd.h> | 29 | #include <asm/unistd.h> |
31 | #include <linux/elf.h> | 30 | #include <asm/cacheflush.h> |
31 | |||
32 | #ifdef CONFIG_MMU | ||
33 | |||
32 | #include <asm/tlb.h> | 34 | #include <asm/tlb.h> |
33 | 35 | ||
34 | asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address, | 36 | asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address, |
@@ -377,7 +379,6 @@ sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len) | |||
377 | struct vm_area_struct *vma; | 379 | struct vm_area_struct *vma; |
378 | int ret = -EINVAL; | 380 | int ret = -EINVAL; |
379 | 381 | ||
380 | lock_kernel(); | ||
381 | if (scope < FLUSH_SCOPE_LINE || scope > FLUSH_SCOPE_ALL || | 382 | if (scope < FLUSH_SCOPE_LINE || scope > FLUSH_SCOPE_ALL || |
382 | cache & ~FLUSH_CACHE_BOTH) | 383 | cache & ~FLUSH_CACHE_BOTH) |
383 | goto out; | 384 | goto out; |
@@ -446,43 +447,9 @@ sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len) | |||
446 | } | 447 | } |
447 | } | 448 | } |
448 | out: | 449 | out: |
449 | unlock_kernel(); | ||
450 | return ret; | 450 | return ret; |
451 | } | 451 | } |
452 | 452 | ||
453 | asmlinkage int sys_getpagesize(void) | ||
454 | { | ||
455 | return PAGE_SIZE; | ||
456 | } | ||
457 | |||
458 | /* | ||
459 | * Do a system call from kernel instead of calling sys_execve so we | ||
460 | * end up with proper pt_regs. | ||
461 | */ | ||
462 | int kernel_execve(const char *filename, | ||
463 | const char *const argv[], | ||
464 | const char *const envp[]) | ||
465 | { | ||
466 | register long __res asm ("%d0") = __NR_execve; | ||
467 | register long __a asm ("%d1") = (long)(filename); | ||
468 | register long __b asm ("%d2") = (long)(argv); | ||
469 | register long __c asm ("%d3") = (long)(envp); | ||
470 | asm volatile ("trap #0" : "+d" (__res) | ||
471 | : "d" (__a), "d" (__b), "d" (__c)); | ||
472 | return __res; | ||
473 | } | ||
474 | |||
475 | asmlinkage unsigned long sys_get_thread_area(void) | ||
476 | { | ||
477 | return current_thread_info()->tp_value; | ||
478 | } | ||
479 | |||
480 | asmlinkage int sys_set_thread_area(unsigned long tp) | ||
481 | { | ||
482 | current_thread_info()->tp_value = tp; | ||
483 | return 0; | ||
484 | } | ||
485 | |||
486 | /* This syscall gets its arguments in A0 (mem), D2 (oldval) and | 453 | /* This syscall gets its arguments in A0 (mem), D2 (oldval) and |
487 | D1 (newval). */ | 454 | D1 (newval). */ |
488 | asmlinkage int | 455 | asmlinkage int |
@@ -542,6 +509,70 @@ sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5, | |||
542 | } | 509 | } |
543 | } | 510 | } |
544 | 511 | ||
512 | #else | ||
513 | |||
514 | /* sys_cacheflush -- flush (part of) the processor cache. */ | ||
515 | asmlinkage int | ||
516 | sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len) | ||
517 | { | ||
518 | flush_cache_all(); | ||
519 | return 0; | ||
520 | } | ||
521 | |||
522 | /* This syscall gets its arguments in A0 (mem), D2 (oldval) and | ||
523 | D1 (newval). */ | ||
524 | asmlinkage int | ||
525 | sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5, | ||
526 | unsigned long __user * mem) | ||
527 | { | ||
528 | struct mm_struct *mm = current->mm; | ||
529 | unsigned long mem_value; | ||
530 | |||
531 | down_read(&mm->mmap_sem); | ||
532 | |||
533 | mem_value = *mem; | ||
534 | if (mem_value == oldval) | ||
535 | *mem = newval; | ||
536 | |||
537 | up_read(&mm->mmap_sem); | ||
538 | return mem_value; | ||
539 | } | ||
540 | |||
541 | #endif /* CONFIG_MMU */ | ||
542 | |||
543 | asmlinkage int sys_getpagesize(void) | ||
544 | { | ||
545 | return PAGE_SIZE; | ||
546 | } | ||
547 | |||
548 | /* | ||
549 | * Do a system call from kernel instead of calling sys_execve so we | ||
550 | * end up with proper pt_regs. | ||
551 | */ | ||
552 | int kernel_execve(const char *filename, | ||
553 | const char *const argv[], | ||
554 | const char *const envp[]) | ||
555 | { | ||
556 | register long __res asm ("%d0") = __NR_execve; | ||
557 | register long __a asm ("%d1") = (long)(filename); | ||
558 | register long __b asm ("%d2") = (long)(argv); | ||
559 | register long __c asm ("%d3") = (long)(envp); | ||
560 | asm volatile ("trap #0" : "+d" (__res) | ||
561 | : "d" (__a), "d" (__b), "d" (__c)); | ||
562 | return __res; | ||
563 | } | ||
564 | |||
565 | asmlinkage unsigned long sys_get_thread_area(void) | ||
566 | { | ||
567 | return current_thread_info()->tp_value; | ||
568 | } | ||
569 | |||
570 | asmlinkage int sys_set_thread_area(unsigned long tp) | ||
571 | { | ||
572 | current_thread_info()->tp_value = tp; | ||
573 | return 0; | ||
574 | } | ||
575 | |||
545 | asmlinkage int sys_atomic_barrier(void) | 576 | asmlinkage int sys_atomic_barrier(void) |
546 | { | 577 | { |
547 | /* no code needed for uniprocs */ | 578 | /* no code needed for uniprocs */ |