summaryrefslogtreecommitdiff
path: root/patches/linux/2.6.11.3/170-linux-2.6.11-allow-gcc-4.0-ppc-mikpe.patch
blob: 60f02e3c7b44f4276668271351b2c198a648e9bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Fixes

In file included from arch/ppc/kernel/time.c:68:
arch/ppc/kernel/time.c:92: error: static declaration of 'time_offset' follows non-static declaration
include/linux/timex.h:236: error: previous declaration of 'time_offset' was here
make[1]: *** [arch/ppc/kernel/time.o] Error 1

when compiling with gcc-4.0

Taken from
http://user.it.uu.se/~mikpe/linux/patches/2.6/patch-gcc4-fixes-v2-2.6.11
Also removes some obsolete externs that caused problems for Mike
Mike's patch has a bit more stuff in it, but this was enough for me


diff -rupN linux-2.6.11/arch/ppc/kernel/time.c linux-2.6.11.gcc4-fixes-v2/arch/ppc/kernel/time.c
--- linux-2.6.11/arch/ppc/kernel/time.c	2005-03-02 19:24:14.000000000 +0100
+++ linux-2.6.11.gcc4-fixes-v2/arch/ppc/kernel/time.c	2005-03-02 19:36:26.000000000 +0100
@@ -89,7 +89,7 @@ unsigned long tb_to_ns_scale;
 
 extern unsigned long wall_jiffies;
 
-static long time_offset;
+static long ppc_time_offset;
 
 DEFINE_SPINLOCK(rtc_lock);
 
@@ -172,7 +172,7 @@ void timer_interrupt(struct pt_regs * re
 		     xtime.tv_sec - last_rtc_update >= 659 &&
 		     abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ &&
 		     jiffies - wall_jiffies == 1) {
-		  	if (ppc_md.set_rtc_time(xtime.tv_sec+1 + time_offset) == 0)
+		  	if (ppc_md.set_rtc_time(xtime.tv_sec+1 + ppc_time_offset) == 0)
 				last_rtc_update = xtime.tv_sec+1;
 			else
 				/* Try again one minute later */
@@ -289,7 +289,7 @@ void __init time_init(void)
 	unsigned old_stamp, stamp, elapsed;
 
         if (ppc_md.time_init != NULL)
-                time_offset = ppc_md.time_init();
+                ppc_time_offset = ppc_md.time_init();
 
 	if (__USE_RTC()) {
 		/* 601 processor: dec counts down by 128 every 128ns */
@@ -334,10 +334,10 @@ void __init time_init(void)
 	set_dec(tb_ticks_per_jiffy);
 
 	/* If platform provided a timezone (pmac), we correct the time */
-        if (time_offset) {
-		sys_tz.tz_minuteswest = -time_offset / 60;
+        if (ppc_time_offset) {
+		sys_tz.tz_minuteswest = -ppc_time_offset / 60;
 		sys_tz.tz_dsttime = 0;
-		xtime.tv_sec -= time_offset;
+		xtime.tv_sec -= ppc_time_offset;
         }
         set_normalized_timespec(&wall_to_monotonic,
                                 -xtime.tv_sec, -xtime.tv_nsec);
diff -rupN linux-2.6.11/arch/ppc/syslib/open_pic_defs.h linux-2.6.11.gcc4-fixes-v2/arch/ppc/syslib/open_pic_defs.h
--- linux-2.6.11/arch/ppc/syslib/open_pic_defs.h	2005-03-02 19:24:14.000000000 +0100
+++ linux-2.6.11.gcc4-fixes-v2/arch/ppc/syslib/open_pic_defs.h	2005-03-02 19:36:26.000000000 +0100
@@ -172,9 +172,6 @@ struct OpenPIC {
     OpenPIC_Processor Processor[OPENPIC_MAX_PROCESSORS];
 };
 
-extern volatile struct OpenPIC __iomem *OpenPIC;
-
-
     /*
      *  Current Task Priority Register
      */
diff -rupN linux-2.6.11/include/asm-ppc/prom.h linux-2.6.11.gcc4-fixes-v2/include/asm-ppc/prom.h
--- linux-2.6.11/include/asm-ppc/prom.h	2003-09-28 12:19:57.000000000 +0200
+++ linux-2.6.11.gcc4-fixes-v2/include/asm-ppc/prom.h	2005-03-02 19:36:26.000000000 +0100
@@ -13,9 +13,6 @@
 typedef void *phandle;
 typedef void *ihandle;
 
-extern char *prom_display_paths[];
-extern unsigned int prom_num_displays;
-
 struct address_range {
 	unsigned int space;
 	unsigned int address;