aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/irq.c19
-rw-r--r--arch/powerpc/kernel/ptrace.c13
-rw-r--r--arch/powerpc/kernel/sysfs.c4
-rw-r--r--arch/powerpc/kernel/time.c42
4 files changed, 55 insertions, 23 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index b4432332341f..c3f58f2f9f52 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -777,7 +777,6 @@ unsigned int irq_alloc_virt(struct irq_host *host,
777{ 777{
778 unsigned long flags; 778 unsigned long flags;
779 unsigned int i, j, found = NO_IRQ; 779 unsigned int i, j, found = NO_IRQ;
780 unsigned int limit = irq_virq_count - count;
781 780
782 if (count == 0 || count > (irq_virq_count - NUM_ISA_INTERRUPTS)) 781 if (count == 0 || count > (irq_virq_count - NUM_ISA_INTERRUPTS))
783 return NO_IRQ; 782 return NO_IRQ;
@@ -794,14 +793,16 @@ unsigned int irq_alloc_virt(struct irq_host *host,
794 /* Look for count consecutive numbers in the allocatable 793 /* Look for count consecutive numbers in the allocatable
795 * (non-legacy) space 794 * (non-legacy) space
796 */ 795 */
797 for (i = NUM_ISA_INTERRUPTS; i <= limit; ) { 796 for (i = NUM_ISA_INTERRUPTS, j = 0; i < irq_virq_count; i++) {
798 for (j = i; j < (i + count); j++) 797 if (irq_map[i].host != NULL)
799 if (irq_map[j].host != NULL) { 798 j = 0;
800 i = j + 1; 799 else
801 continue; 800 j++;
802 } 801
803 found = i; 802 if (j == count) {
804 break; 803 found = i - count + 1;
804 break;
805 }
805 } 806 }
806 if (found == NO_IRQ) { 807 if (found == NO_IRQ) {
807 spin_unlock_irqrestore(&irq_big_lock, flags); 808 spin_unlock_irqrestore(&irq_big_lock, flags);
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index dea75d73f983..975102a020d9 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -526,9 +526,7 @@ static void do_syscall_trace(void)
526 526
527void do_syscall_trace_enter(struct pt_regs *regs) 527void do_syscall_trace_enter(struct pt_regs *regs)
528{ 528{
529#ifdef CONFIG_PPC64
530 secure_computing(regs->gpr[0]); 529 secure_computing(regs->gpr[0]);
531#endif
532 530
533 if (test_thread_flag(TIF_SYSCALL_TRACE) 531 if (test_thread_flag(TIF_SYSCALL_TRACE)
534 && (current->ptrace & PT_PTRACED)) 532 && (current->ptrace & PT_PTRACED))
@@ -548,12 +546,8 @@ void do_syscall_trace_enter(struct pt_regs *regs)
548 546
549void do_syscall_trace_leave(struct pt_regs *regs) 547void do_syscall_trace_leave(struct pt_regs *regs)
550{ 548{
551#ifdef CONFIG_PPC32
552 secure_computing(regs->gpr[0]);
553#endif
554
555 if (unlikely(current->audit_context)) 549 if (unlikely(current->audit_context))
556 audit_syscall_exit((regs->ccr&0x1000)?AUDITSC_FAILURE:AUDITSC_SUCCESS, 550 audit_syscall_exit((regs->ccr&0x10000000)?AUDITSC_FAILURE:AUDITSC_SUCCESS,
557 regs->result); 551 regs->result);
558 552
559 if ((test_thread_flag(TIF_SYSCALL_TRACE) 553 if ((test_thread_flag(TIF_SYSCALL_TRACE)
@@ -561,8 +555,3 @@ void do_syscall_trace_leave(struct pt_regs *regs)
561 && (current->ptrace & PT_PTRACED)) 555 && (current->ptrace & PT_PTRACED))
562 do_syscall_trace(); 556 do_syscall_trace();
563} 557}
564
565#ifdef CONFIG_PPC32
566EXPORT_SYMBOL(do_syscall_trace_enter);
567EXPORT_SYMBOL(do_syscall_trace_leave);
568#endif
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 406f308ddead..d45a168bdaca 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -25,8 +25,8 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);
25/* SMT stuff */ 25/* SMT stuff */
26 26
27#ifdef CONFIG_PPC_MULTIPLATFORM 27#ifdef CONFIG_PPC_MULTIPLATFORM
28/* default to snooze disabled */ 28/* Time in microseconds we delay before sleeping in the idle loop */
29DEFINE_PER_CPU(unsigned long, smt_snooze_delay); 29DEFINE_PER_CPU(unsigned long, smt_snooze_delay) = { 100 };
30 30
31static ssize_t store_smt_snooze_delay(struct sys_device *dev, const char *buf, 31static ssize_t store_smt_snooze_delay(struct sys_device *dev, const char *buf,
32 size_t count) 32 size_t count)
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 8b278d85ca4e..85b9244a098c 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -1041,6 +1041,48 @@ void __init time_init(void)
1041 set_dec(tb_ticks_per_jiffy); 1041 set_dec(tb_ticks_per_jiffy);
1042} 1042}
1043 1043
1044#ifdef CONFIG_RTC_CLASS
1045static int set_rtc_class_time(struct rtc_time *tm)
1046{
1047 int err;
1048 struct class_device *class_dev =
1049 rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
1050
1051 if (class_dev == NULL)
1052 return -ENODEV;
1053
1054 err = rtc_set_time(class_dev, tm);
1055
1056 rtc_class_close(class_dev);
1057
1058 return 0;
1059}
1060
1061static void get_rtc_class_time(struct rtc_time *tm)
1062{
1063 int err;
1064 struct class_device *class_dev =
1065 rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
1066
1067 if (class_dev == NULL)
1068 return;
1069
1070 err = rtc_read_time(class_dev, tm);
1071
1072 rtc_class_close(class_dev);
1073
1074 return;
1075}
1076
1077int __init rtc_class_hookup(void)
1078{
1079 ppc_md.get_rtc_time = get_rtc_class_time;
1080 ppc_md.set_rtc_time = set_rtc_class_time;
1081
1082 return 0;
1083}
1084#endif /* CONFIG_RTC_CLASS */
1085
1044 1086
1045#define FEBRUARY 2 1087#define FEBRUARY 2
1046#define STARTOFTIME 1970 1088#define STARTOFTIME 1970