aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/bios32.c3
-rw-r--r--arch/arm/kernel/dma.c36
-rw-r--r--arch/arm/kernel/smp.c2
-rw-r--r--arch/arm/kernel/time.c70
4 files changed, 46 insertions, 65 deletions
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index bd397e0b663e..c6273a3bfc25 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -527,6 +527,9 @@ static void __init pcibios_init_hw(struct hw_pci *hw)
527 if (!sys) 527 if (!sys)
528 panic("PCI: unable to allocate sys data!"); 528 panic("PCI: unable to allocate sys data!");
529 529
530#ifdef CONFIG_PCI_DOMAINS
531 sys->domain = hw->domain;
532#endif
530 sys->hw = hw; 533 sys->hw = hw;
531 sys->busnr = busnr; 534 sys->busnr = busnr;
532 sys->swizzle = hw->swizzle; 535 sys->swizzle = hw->swizzle;
diff --git a/arch/arm/kernel/dma.c b/arch/arm/kernel/dma.c
index 7d5b9fb01e71..2c4a185f92cd 100644
--- a/arch/arm/kernel/dma.c
+++ b/arch/arm/kernel/dma.c
@@ -16,6 +16,8 @@
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/scatterlist.h> 18#include <linux/scatterlist.h>
19#include <linux/seq_file.h>
20#include <linux/proc_fs.h>
19 21
20#include <asm/dma.h> 22#include <asm/dma.h>
21 23
@@ -264,3 +266,37 @@ int get_dma_residue(unsigned int chan)
264 return ret; 266 return ret;
265} 267}
266EXPORT_SYMBOL(get_dma_residue); 268EXPORT_SYMBOL(get_dma_residue);
269
270#ifdef CONFIG_PROC_FS
271static int proc_dma_show(struct seq_file *m, void *v)
272{
273 int i;
274
275 for (i = 0 ; i < MAX_DMA_CHANNELS ; i++) {
276 dma_t *dma = dma_channel(i);
277 if (dma && dma->lock)
278 seq_printf(m, "%2d: %s\n", i, dma->device_id);
279 }
280 return 0;
281}
282
283static int proc_dma_open(struct inode *inode, struct file *file)
284{
285 return single_open(file, proc_dma_show, NULL);
286}
287
288static const struct file_operations proc_dma_operations = {
289 .open = proc_dma_open,
290 .read = seq_read,
291 .llseek = seq_lseek,
292 .release = single_release,
293};
294
295static int __init proc_dma_init(void)
296{
297 proc_create("dma", 0, NULL, &proc_dma_operations);
298 return 0;
299}
300
301__initcall(proc_dma_init);
302#endif
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 577543f3857f..7a3cc0266934 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -162,7 +162,7 @@ int __cpu_disable(void)
162 struct task_struct *p; 162 struct task_struct *p;
163 int ret; 163 int ret;
164 164
165 ret = mach_cpu_disable(cpu); 165 ret = platform_cpu_disable(cpu);
166 if (ret) 166 if (ret)
167 return ret; 167 return ret;
168 168
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 28753805d2d1..38c261f9951c 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -72,12 +72,15 @@ unsigned long profile_pc(struct pt_regs *regs)
72EXPORT_SYMBOL(profile_pc); 72EXPORT_SYMBOL(profile_pc);
73#endif 73#endif
74 74
75#ifndef CONFIG_GENERIC_TIME 75#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
76static unsigned long dummy_gettimeoffset(void) 76u32 arch_gettimeoffset(void)
77{ 77{
78 if (system_timer->offset != NULL)
79 return system_timer->offset() * 1000;
80
78 return 0; 81 return 0;
79} 82}
80#endif 83#endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */
81 84
82#ifdef CONFIG_LEDS_TIMER 85#ifdef CONFIG_LEDS_TIMER
83static inline void do_leds(void) 86static inline void do_leds(void)
@@ -93,63 +96,6 @@ static inline void do_leds(void)
93#define do_leds() 96#define do_leds()
94#endif 97#endif
95 98
96#ifndef CONFIG_GENERIC_TIME
97void do_gettimeofday(struct timeval *tv)
98{
99 unsigned long flags;
100 unsigned long seq;
101 unsigned long usec, sec;
102
103 do {
104 seq = read_seqbegin_irqsave(&xtime_lock, flags);
105 usec = system_timer->offset();
106 sec = xtime.tv_sec;
107 usec += xtime.tv_nsec / 1000;
108 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
109
110 /* usec may have gone up a lot: be safe */
111 while (usec >= 1000000) {
112 usec -= 1000000;
113 sec++;
114 }
115
116 tv->tv_sec = sec;
117 tv->tv_usec = usec;
118}
119
120EXPORT_SYMBOL(do_gettimeofday);
121
122int do_settimeofday(struct timespec *tv)
123{
124 time_t wtm_sec, sec = tv->tv_sec;
125 long wtm_nsec, nsec = tv->tv_nsec;
126
127 if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
128 return -EINVAL;
129
130 write_seqlock_irq(&xtime_lock);
131 /*
132 * This is revolting. We need to set "xtime" correctly. However, the
133 * value in this location is the value at the most recent update of
134 * wall time. Discover what correction gettimeofday() would have
135 * done, and then undo it!
136 */
137 nsec -= system_timer->offset() * NSEC_PER_USEC;
138
139 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
140 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);
141
142 set_normalized_timespec(&xtime, sec, nsec);
143 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
144
145 ntp_clear();
146 write_sequnlock_irq(&xtime_lock);
147 clock_was_set();
148 return 0;
149}
150
151EXPORT_SYMBOL(do_settimeofday);
152#endif /* !CONFIG_GENERIC_TIME */
153 99
154#ifndef CONFIG_GENERIC_CLOCKEVENTS 100#ifndef CONFIG_GENERIC_CLOCKEVENTS
155/* 101/*
@@ -214,10 +160,6 @@ device_initcall(timer_init_sysfs);
214 160
215void __init time_init(void) 161void __init time_init(void)
216{ 162{
217#ifndef CONFIG_GENERIC_TIME
218 if (system_timer->offset == NULL)
219 system_timer->offset = dummy_gettimeoffset;
220#endif
221 system_timer->init(); 163 system_timer->init();
222} 164}
223 165