Browse Source

gcc is rather over-aggressive about optimising out static data structures

even when __atribute__ (( unused )) is correctly set...
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
832e86246b

+ 2
- 2
src/arch/i386/core/video_subr.c View File

12
 #include "init.h"
12
 #include "init.h"
13
 #include "vga.h"
13
 #include "vga.h"
14
 
14
 
15
-static struct console_driver vga_console;
15
+struct console_driver vga_console;
16
 
16
 
17
 static char *vidmem;		/* The video buffer */
17
 static char *vidmem;		/* The video buffer */
18
 static int video_line, video_col;
18
 static int video_line, video_col;
94
 	write_crtc((video_col + (video_line *COLS)) & 0x0ff, CRTC_CURSOR_LO);
94
 	write_crtc((video_col + (video_line *COLS)) & 0x0ff, CRTC_CURSOR_LO);
95
 }
95
 }
96
 
96
 
97
-static struct console_driver vga_console __console_driver = {
97
+struct console_driver vga_console __console_driver = {
98
 	.putchar = vga_putc,
98
 	.putchar = vga_putc,
99
 	.disabled = 1,
99
 	.disabled = 1,
100
 };
100
 };

+ 1
- 1
src/arch/i386/firmware/pcbios/bios_console.c View File

68
 	return ( ( flags & ZF ) == 0 );
68
 	return ( ( flags & ZF ) == 0 );
69
 }
69
 }
70
 
70
 
71
-static struct console_driver bios_console __console_driver = {
71
+struct console_driver bios_console __console_driver = {
72
 	.putchar = bios_putchar,
72
 	.putchar = bios_putchar,
73
 	.getchar = bios_getchar,
73
 	.getchar = bios_getchar,
74
 	.iskey = bios_iskey,
74
 	.iskey = bios_iskey,

+ 1
- 1
src/arch/i386/image/nbi.c View File

404
 }
404
 }
405
 
405
 
406
 /** Declaration of the NBI image format */
406
 /** Declaration of the NBI image format */
407
-static struct image nbi_image __image = {
407
+struct image nbi_image __image = {
408
 	.name	= "NBI",
408
 	.name	= "NBI",
409
 	.probe	= nbi_probe,
409
 	.probe	= nbi_probe,
410
 	.load	= nbi_load,
410
 	.load	= nbi_load,

+ 4
- 4
src/arch/i386/include/relocate.h View File

15
 #define POST_RELOC_LIBRM	00
15
 #define POST_RELOC_LIBRM	00
16
 
16
 
17
 /* Macro for creating a post-relocation function table entry */
17
 /* Macro for creating a post-relocation function table entry */
18
-#define POST_RELOC_FN( order, post_reloc_func )				      \
19
-	static struct post_reloc_fn PREFIX_OBJECT(post_reloc_fn__)	      \
20
-	    __table ( post_reloc_fn, order ) = {			      \
21
-		.post_reloc = post_reloc_func,				      \
18
+#define POST_RELOC_FN( order, post_reloc_func )			\
19
+	struct post_reloc_fn PREFIX_OBJECT(post_reloc_fn__)	\
20
+	    __table ( post_reloc_fn, order ) = {		\
21
+		.post_reloc = post_reloc_func,			\
22
 	};
22
 	};
23
 
23
 
24
 #endif
24
 #endif

+ 1
- 1
src/core/btext.c View File

434
         btext_drawchar((unsigned char)c);
434
         btext_drawchar((unsigned char)c);
435
 }
435
 }
436
 
436
 
437
-static struct console_driver btext_console __console_driver = {
437
+struct console_driver btext_console __console_driver = {
438
 	.putchar = btext_putc,
438
 	.putchar = btext_putc,
439
 	.disabled = 1,
439
 	.disabled = 1,
440
 };
440
 };

+ 1
- 1
src/core/pc_kbd.c View File

107
     return c;
107
     return c;
108
 }
108
 }
109
 
109
 
110
-static struct console_driver pc_kbd_console __console_driver = {
110
+struct console_driver pc_kbd_console __console_driver = {
111
 	.getchar = kbd_getc,
111
 	.getchar = kbd_getc,
112
 };
112
 };

+ 2
- 2
src/core/serial.c View File

91
 #define uart_writeb(val,addr) outb((val),(addr))
91
 #define uart_writeb(val,addr) outb((val),(addr))
92
 #endif
92
 #endif
93
 
93
 
94
-static struct console_driver serial_console;
94
+struct console_driver serial_console;
95
 
95
 
96
 /*
96
 /*
97
  * void serial_putc(int ch);
97
  * void serial_putc(int ch);
229
 	/* Don't mark it as disabled; it's still usable */
229
 	/* Don't mark it as disabled; it's still usable */
230
 }
230
 }
231
 
231
 
232
-static struct console_driver serial_console __console_driver = {
232
+struct console_driver serial_console __console_driver = {
233
 	.putchar = serial_putc,
233
 	.putchar = serial_putc,
234
 	.getchar = serial_getc,
234
 	.getchar = serial_getc,
235
 	.iskey = serial_ischar,
235
 	.iskey = serial_ischar,

+ 2
- 2
src/drivers/net/3c509.c View File

311
  * T509 bus operations table
311
  * T509 bus operations table
312
  *
312
  *
313
  */
313
  */
314
-static struct bus_driver t509_driver __bus_driver = {
314
+struct bus_driver t509_driver __bus_driver = {
315
 	.name			= "T509",
315
 	.name			= "T509",
316
 	.next_location		= t509_next_location,
316
 	.next_location		= t509_next_location,
317
 	.fill_device		= t509_fill_device,
317
 	.fill_device		= t509_fill_device,
392
 	deactivate_t509_device ( t509 );
392
 	deactivate_t509_device ( t509 );
393
 }
393
 }
394
 
394
 
395
-static struct {} el3_t509_driver;
395
+struct {} el3_t509_driver;
396
 
396
 
397
 DRIVER ( "3c509", nic_driver, t509_driver, el3_t509_driver,
397
 DRIVER ( "3c509", nic_driver, t509_driver, el3_t509_driver,
398
 	 el3_t509_probe, el3_t509_disable );
398
 	 el3_t509_probe, el3_t509_disable );

+ 1
- 1
src/drivers/net/mlx_ipoib/mt23108.c View File

235
 	PCI_ROM(0x15b3, 0x6278, "MT25208", "MT25208 HCA driver"),
235
 	PCI_ROM(0x15b3, 0x6278, "MT25208", "MT25208 HCA driver"),
236
 };
236
 };
237
 
237
 
238
-static struct pci_driver tavor_driver __pci_driver = {
238
+struct pci_driver tavor_driver __pci_driver = {
239
 	.type = NIC_DRIVER,
239
 	.type = NIC_DRIVER,
240
 	.name = "MT23108/MT25208",
240
 	.name = "MT23108/MT25208",
241
 	.probe = tavor_probe,
241
 	.probe = tavor_probe,

+ 1
- 1
src/drivers/net/mlx_ipoib/mt25218.c View File

235
 	PCI_ROM(0x15b3, 0x6274, "MT25204", "MT25204 HCA driver"),
235
 	PCI_ROM(0x15b3, 0x6274, "MT25204", "MT25204 HCA driver"),
236
 };
236
 };
237
 
237
 
238
-static struct pci_driver mt25218_driver __pci_driver = {
238
+struct pci_driver mt25218_driver __pci_driver = {
239
 	.type = NIC_DRIVER,
239
 	.type = NIC_DRIVER,
240
 	.name = "MT25218",
240
 	.name = "MT25218",
241
 	.probe = mt25218_probe,
241
 	.probe = mt25218_probe,

+ 3
- 3
src/drivers/net/ns8390.c View File

961
 }
961
 }
962
 
962
 
963
 #ifdef	INCLUDE_WD
963
 #ifdef	INCLUDE_WD
964
-static struct isa_driver wd_driver __isa_driver = {
964
+struct isa_driver wd_driver __isa_driver = {
965
 	.type    = NIC_DRIVER,
965
 	.type    = NIC_DRIVER,
966
 	.name    = "WD",
966
 	.name    = "WD",
967
 	.probe   = wd_probe,
967
 	.probe   = wd_probe,
971
 #endif
971
 #endif
972
 
972
 
973
 #ifdef	INCLUDE_3C503
973
 #ifdef	INCLUDE_3C503
974
-static struct isa_driver t503_driver __isa_driver = {
974
+struct isa_driver t503_driver __isa_driver = {
975
 	.type    = NIC_DRIVER,
975
 	.type    = NIC_DRIVER,
976
 	.name    = "3C503",
976
 	.name    = "3C503",
977
 	.probe   = t503_probe,
977
 	.probe   = t503_probe,
981
 #endif
981
 #endif
982
 
982
 
983
 #ifdef	INCLUDE_NE
983
 #ifdef	INCLUDE_NE
984
-static struct isa_driver ne_driver __isa_driver = {
984
+struct isa_driver ne_driver __isa_driver = {
985
 	.type    = NIC_DRIVER,
985
 	.type    = NIC_DRIVER,
986
 	.name    = "NE*000",
986
 	.name    = "NE*000",
987
 	.probe   = ne_probe,
987
 	.probe   = ne_probe,

+ 2
- 2
src/include/gpxe/tables.h View File

131
  *	...
131
  *	...
132
  *   }
132
  *   }
133
  *
133
  *
134
- *   static struct frob my_frobnicator __frobnicator = {
134
+ *   struct frob my_frobnicator __frobnicator = {
135
  *	.name = "my_frob",
135
  *	.name = "my_frob",
136
  *	.frob = my_frob,
136
  *	.frob = my_frob,
137
  *   };
137
  *   };
184
  *
184
  *
185
  * @code
185
  * @code
186
  *
186
  *
187
- *   static struct my_foo __table ( foo, 01 ) = {
187
+ *   struct my_foo __table ( foo, 01 ) = {
188
  *      ...
188
  *      ...
189
  *   };
189
  *   };
190
  *
190
  *

+ 6
- 6
src/include/init.h View File

49
 #define	INIT_RPC	11
49
 #define	INIT_RPC	11
50
 
50
 
51
 /* Macro for creating an initialisation function table entry */
51
 /* Macro for creating an initialisation function table entry */
52
-#define INIT_FN( init_order, init_func, reset_func, exit_func )		      \
53
-	static struct init_fn PREFIX_OBJECT(init_fn__)			      \
54
-	    __table ( init_fn, init_order ) = {				      \
55
-		.init = init_func,					      \
56
-		.reset = reset_func,					      \
57
-		.exit = exit_func,					      \
52
+#define INIT_FN( init_order, init_func, reset_func, exit_func )	\
53
+	struct init_fn PREFIX_OBJECT(init_fn__)			\
54
+	    __table ( init_fn, init_order ) = {			\
55
+		.init = init_func,				\
56
+		.reset = reset_func,				\
57
+		.exit = exit_func,				\
58
 	};
58
 	};
59
 
59
 
60
 /* Function prototypes */
60
 /* Function prototypes */

+ 1
- 1
src/include/isa.h View File

54
  *
54
  *
55
  */
55
  */
56
 #define ISA_DRIVER( _name, _probe_addrs, _probe_addr, _mfg_id, _prod_id )   \
56
 #define ISA_DRIVER( _name, _probe_addrs, _probe_addr, _mfg_id, _prod_id )   \
57
-static struct isa_driver _name __table(isa_driver,01 ) = {		    \
57
+struct isa_driver _name __table(isa_driver,01 ) = {			    \
58
 	.probe_addrs = _probe_addrs,					    \
58
 	.probe_addrs = _probe_addrs,					    \
59
 	.addr_count = sizeof ( _probe_addrs ) / sizeof ( _probe_addrs[0] ), \
59
 	.addr_count = sizeof ( _probe_addrs ) / sizeof ( _probe_addrs[0] ), \
60
 	.probe_addr = _probe_addr,					    \
60
 	.probe_addr = _probe_addr,					    \

+ 1
- 1
src/interface/pxe/pxe_errors.c View File

13
  * followed by a little manual tweaking.
13
  * followed by a little manual tweaking.
14
  *
14
  *
15
  */
15
  */
16
-static struct errortab pxe_errortab[] __errortab = {
16
+struct errortab pxe_errortab[] __errortab = {
17
 	{ PXENV_STATUS_SUCCESS, "Success" },
17
 	{ PXENV_STATUS_SUCCESS, "Success" },
18
 	{ PXENV_STATUS_FAILURE, "Failure" },
18
 	{ PXENV_STATUS_FAILURE, "Failure" },
19
 	{ PXENV_STATUS_BAD_FUNC, "Bad function" },
19
 	{ PXENV_STATUS_BAD_FUNC, "Bad function" },

+ 1
- 1
src/proto/dns.c View File

355
 	}
355
 	}
356
 }
356
 }
357
 
357
 
358
-static struct resolver dns_resolver __resolver = {
358
+struct resolver dns_resolver __resolver = {
359
 	.name = "DNS",
359
 	.name = "DNS",
360
 	.resolv = dns_resolv,
360
 	.resolv = dns_resolv,
361
 };
361
 };

+ 1
- 1
src/proto/http.c View File

166
 	return 1;
166
 	return 1;
167
 }
167
 }
168
 
168
 
169
-static struct protocol http_protocol __protocol = {
169
+struct protocol http_protocol __protocol = {
170
 	.name = "http",
170
 	.name = "http",
171
 	.default_port = 80,
171
 	.default_port = 80,
172
 	.load = http,
172
 	.load = http,

+ 1
- 1
src/proto/igmp.c View File

112
 	}
112
 	}
113
 }
113
 }
114
 
114
 
115
-static struct background igmp_background __background = {
115
+struct background igmp_background __background = {
116
 	.send = send_igmp_reports,
116
 	.send = send_igmp_reports,
117
 	.process = process_igmp,
117
 	.process = process_igmp,
118
 };
118
 };

+ 1
- 1
src/proto/nfs.c View File

610
 
610
 
611
 INIT_FN ( INIT_RPC, rpc_init, nfs_reset, nfs_reset );
611
 INIT_FN ( INIT_RPC, rpc_init, nfs_reset, nfs_reset );
612
 
612
 
613
-static struct protocol nfs_protocol __protocol = {
613
+struct protocol nfs_protocol __protocol = {
614
 	.name = "nfs",
614
 	.name = "nfs",
615
 	.default_port = SUNRPC_PORT,
615
 	.default_port = SUNRPC_PORT,
616
 	.load = nfs,
616
 	.load = nfs,

+ 1
- 1
src/proto/nmb.c View File

100
 	return 1;
100
 	return 1;
101
 }
101
 }
102
 
102
 
103
-static struct resolver nmb_resolver __resolver = {
103
+struct resolver nmb_resolver __resolver = {
104
 	.name = "NMB",
104
 	.name = "NMB",
105
 	.resolv = nmb_resolv,
105
 	.resolv = nmb_resolv,
106
 };
106
 };

+ 1
- 1
src/proto/slam.c View File

534
 	return proto_slam(&info);
534
 	return proto_slam(&info);
535
 }
535
 }
536
 
536
 
537
-static struct protocol slam_protocol __protocol = {
537
+struct protocol slam_protocol __protocol = {
538
 	.name = "x-slam",
538
 	.name = "x-slam",
539
 	.default_port = SLAM_PORT,
539
 	.default_port = SLAM_PORT,
540
 	.load = url_slam,
540
 	.load = url_slam,

Loading…
Cancel
Save