mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-23 19:51:46 +00:00
gcc is rather over-aggressive about optimising out static data structures
even when __atribute__ (( unused )) is correctly set...
This commit is contained in:
parent
4c4e4de18f
commit
832e86246b
@ -12,7 +12,7 @@
|
||||
#include "init.h"
|
||||
#include "vga.h"
|
||||
|
||||
static struct console_driver vga_console;
|
||||
struct console_driver vga_console;
|
||||
|
||||
static char *vidmem; /* The video buffer */
|
||||
static int video_line, video_col;
|
||||
@ -94,7 +94,7 @@ static void vga_putc(int byte)
|
||||
write_crtc((video_col + (video_line *COLS)) & 0x0ff, CRTC_CURSOR_LO);
|
||||
}
|
||||
|
||||
static struct console_driver vga_console __console_driver = {
|
||||
struct console_driver vga_console __console_driver = {
|
||||
.putchar = vga_putc,
|
||||
.disabled = 1,
|
||||
};
|
||||
|
@ -68,7 +68,7 @@ static int bios_iskey ( void ) {
|
||||
return ( ( flags & ZF ) == 0 );
|
||||
}
|
||||
|
||||
static struct console_driver bios_console __console_driver = {
|
||||
struct console_driver bios_console __console_driver = {
|
||||
.putchar = bios_putchar,
|
||||
.getchar = bios_getchar,
|
||||
.iskey = bios_iskey,
|
||||
|
@ -404,7 +404,7 @@ static int nbi_boot ( void *context ) {
|
||||
}
|
||||
|
||||
/** Declaration of the NBI image format */
|
||||
static struct image nbi_image __image = {
|
||||
struct image nbi_image __image = {
|
||||
.name = "NBI",
|
||||
.probe = nbi_probe,
|
||||
.load = nbi_load,
|
||||
|
@ -15,10 +15,10 @@ struct post_reloc_fn {
|
||||
#define POST_RELOC_LIBRM 00
|
||||
|
||||
/* Macro for creating a post-relocation function table entry */
|
||||
#define POST_RELOC_FN( order, post_reloc_func ) \
|
||||
static struct post_reloc_fn PREFIX_OBJECT(post_reloc_fn__) \
|
||||
__table ( post_reloc_fn, order ) = { \
|
||||
.post_reloc = post_reloc_func, \
|
||||
#define POST_RELOC_FN( order, post_reloc_func ) \
|
||||
struct post_reloc_fn PREFIX_OBJECT(post_reloc_fn__) \
|
||||
__table ( post_reloc_fn, order ) = { \
|
||||
.post_reloc = post_reloc_func, \
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -434,7 +434,7 @@ static void btext_putc(int c)
|
||||
btext_drawchar((unsigned char)c);
|
||||
}
|
||||
|
||||
static struct console_driver btext_console __console_driver = {
|
||||
struct console_driver btext_console __console_driver = {
|
||||
.putchar = btext_putc,
|
||||
.disabled = 1,
|
||||
};
|
||||
|
@ -107,6 +107,6 @@ static int kbd_getc(void)
|
||||
return c;
|
||||
}
|
||||
|
||||
static struct console_driver pc_kbd_console __console_driver = {
|
||||
struct console_driver pc_kbd_console __console_driver = {
|
||||
.getchar = kbd_getc,
|
||||
};
|
||||
|
@ -91,7 +91,7 @@
|
||||
#define uart_writeb(val,addr) outb((val),(addr))
|
||||
#endif
|
||||
|
||||
static struct console_driver serial_console;
|
||||
struct console_driver serial_console;
|
||||
|
||||
/*
|
||||
* void serial_putc(int ch);
|
||||
@ -229,7 +229,7 @@ static void serial_fini ( void ) {
|
||||
/* Don't mark it as disabled; it's still usable */
|
||||
}
|
||||
|
||||
static struct console_driver serial_console __console_driver = {
|
||||
struct console_driver serial_console __console_driver = {
|
||||
.putchar = serial_putc,
|
||||
.getchar = serial_getc,
|
||||
.iskey = serial_ischar,
|
||||
|
@ -311,7 +311,7 @@ static const char * t509_name_device ( struct bus_dev *bus_dev __unused ) {
|
||||
* T509 bus operations table
|
||||
*
|
||||
*/
|
||||
static struct bus_driver t509_driver __bus_driver = {
|
||||
struct bus_driver t509_driver __bus_driver = {
|
||||
.name = "T509",
|
||||
.next_location = t509_next_location,
|
||||
.fill_device = t509_fill_device,
|
||||
@ -392,7 +392,7 @@ static void el3_t509_disable ( struct nic *nic, struct t509_device *t509 ) {
|
||||
deactivate_t509_device ( t509 );
|
||||
}
|
||||
|
||||
static struct {} el3_t509_driver;
|
||||
struct {} el3_t509_driver;
|
||||
|
||||
DRIVER ( "3c509", nic_driver, t509_driver, el3_t509_driver,
|
||||
el3_t509_probe, el3_t509_disable );
|
||||
|
@ -235,7 +235,7 @@ static struct pci_id tavor_nics[] = {
|
||||
PCI_ROM(0x15b3, 0x6278, "MT25208", "MT25208 HCA driver"),
|
||||
};
|
||||
|
||||
static struct pci_driver tavor_driver __pci_driver = {
|
||||
struct pci_driver tavor_driver __pci_driver = {
|
||||
.type = NIC_DRIVER,
|
||||
.name = "MT23108/MT25208",
|
||||
.probe = tavor_probe,
|
||||
|
@ -235,7 +235,7 @@ static struct pci_id mt25218_nics[] = {
|
||||
PCI_ROM(0x15b3, 0x6274, "MT25204", "MT25204 HCA driver"),
|
||||
};
|
||||
|
||||
static struct pci_driver mt25218_driver __pci_driver = {
|
||||
struct pci_driver mt25218_driver __pci_driver = {
|
||||
.type = NIC_DRIVER,
|
||||
.name = "MT25218",
|
||||
.probe = mt25218_probe,
|
||||
|
@ -961,7 +961,7 @@ static struct nic_operations ns8390_operations = {
|
||||
}
|
||||
|
||||
#ifdef INCLUDE_WD
|
||||
static struct isa_driver wd_driver __isa_driver = {
|
||||
struct isa_driver wd_driver __isa_driver = {
|
||||
.type = NIC_DRIVER,
|
||||
.name = "WD",
|
||||
.probe = wd_probe,
|
||||
@ -971,7 +971,7 @@ ISA_ROM("wd","WD8003/8013, SMC8216/8416, SMC 83c790 (EtherEZ)");
|
||||
#endif
|
||||
|
||||
#ifdef INCLUDE_3C503
|
||||
static struct isa_driver t503_driver __isa_driver = {
|
||||
struct isa_driver t503_driver __isa_driver = {
|
||||
.type = NIC_DRIVER,
|
||||
.name = "3C503",
|
||||
.probe = t503_probe,
|
||||
@ -981,7 +981,7 @@ ISA_ROM("3c503","3Com503, Etherlink II[/16]");
|
||||
#endif
|
||||
|
||||
#ifdef INCLUDE_NE
|
||||
static struct isa_driver ne_driver __isa_driver = {
|
||||
struct isa_driver ne_driver __isa_driver = {
|
||||
.type = NIC_DRIVER,
|
||||
.name = "NE*000",
|
||||
.probe = ne_probe,
|
||||
|
@ -131,7 +131,7 @@
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* static struct frob my_frobnicator __frobnicator = {
|
||||
* struct frob my_frobnicator __frobnicator = {
|
||||
* .name = "my_frob",
|
||||
* .frob = my_frob,
|
||||
* };
|
||||
@ -184,7 +184,7 @@
|
||||
*
|
||||
* @code
|
||||
*
|
||||
* static struct my_foo __table ( foo, 01 ) = {
|
||||
* struct my_foo __table ( foo, 01 ) = {
|
||||
* ...
|
||||
* };
|
||||
*
|
||||
|
@ -49,12 +49,12 @@ struct init_fn {
|
||||
#define INIT_RPC 11
|
||||
|
||||
/* Macro for creating an initialisation function table entry */
|
||||
#define INIT_FN( init_order, init_func, reset_func, exit_func ) \
|
||||
static struct init_fn PREFIX_OBJECT(init_fn__) \
|
||||
__table ( init_fn, init_order ) = { \
|
||||
.init = init_func, \
|
||||
.reset = reset_func, \
|
||||
.exit = exit_func, \
|
||||
#define INIT_FN( init_order, init_func, reset_func, exit_func ) \
|
||||
struct init_fn PREFIX_OBJECT(init_fn__) \
|
||||
__table ( init_fn, init_order ) = { \
|
||||
.init = init_func, \
|
||||
.reset = reset_func, \
|
||||
.exit = exit_func, \
|
||||
};
|
||||
|
||||
/* Function prototypes */
|
||||
|
@ -54,7 +54,7 @@ struct isa_driver {
|
||||
*
|
||||
*/
|
||||
#define ISA_DRIVER( _name, _probe_addrs, _probe_addr, _mfg_id, _prod_id ) \
|
||||
static struct isa_driver _name __table(isa_driver,01 ) = { \
|
||||
struct isa_driver _name __table(isa_driver,01 ) = { \
|
||||
.probe_addrs = _probe_addrs, \
|
||||
.addr_count = sizeof ( _probe_addrs ) / sizeof ( _probe_addrs[0] ), \
|
||||
.probe_addr = _probe_addr, \
|
||||
|
@ -13,7 +13,7 @@
|
||||
* followed by a little manual tweaking.
|
||||
*
|
||||
*/
|
||||
static struct errortab pxe_errortab[] __errortab = {
|
||||
struct errortab pxe_errortab[] __errortab = {
|
||||
{ PXENV_STATUS_SUCCESS, "Success" },
|
||||
{ PXENV_STATUS_FAILURE, "Failure" },
|
||||
{ PXENV_STATUS_BAD_FUNC, "Bad function" },
|
||||
|
@ -355,7 +355,7 @@ static int dns_resolv ( struct in_addr *addr, const char *name ) {
|
||||
}
|
||||
}
|
||||
|
||||
static struct resolver dns_resolver __resolver = {
|
||||
struct resolver dns_resolver __resolver = {
|
||||
.name = "DNS",
|
||||
.resolv = dns_resolv,
|
||||
};
|
||||
|
@ -166,7 +166,7 @@ static int http ( char *url, struct sockaddr_in *server __unused,
|
||||
return 1;
|
||||
}
|
||||
|
||||
static struct protocol http_protocol __protocol = {
|
||||
struct protocol http_protocol __protocol = {
|
||||
.name = "http",
|
||||
.default_port = 80,
|
||||
.load = http,
|
||||
|
@ -112,7 +112,7 @@ static void process_igmp ( unsigned long now, unsigned short ptype __unused,
|
||||
}
|
||||
}
|
||||
|
||||
static struct background igmp_background __background = {
|
||||
struct background igmp_background __background = {
|
||||
.send = send_igmp_reports,
|
||||
.process = process_igmp,
|
||||
};
|
||||
|
@ -610,7 +610,7 @@ nfssymlink:
|
||||
|
||||
INIT_FN ( INIT_RPC, rpc_init, nfs_reset, nfs_reset );
|
||||
|
||||
static struct protocol nfs_protocol __protocol = {
|
||||
struct protocol nfs_protocol __protocol = {
|
||||
.name = "nfs",
|
||||
.default_port = SUNRPC_PORT,
|
||||
.load = nfs,
|
||||
|
@ -100,7 +100,7 @@ static int nmb_resolv ( struct in_addr *addr, const char *name ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static struct resolver nmb_resolver __resolver = {
|
||||
struct resolver nmb_resolver __resolver = {
|
||||
.name = "NMB",
|
||||
.resolv = nmb_resolv,
|
||||
};
|
||||
|
@ -534,7 +534,7 @@ static int url_slam ( char *url __unused, struct sockaddr_in *server,
|
||||
return proto_slam(&info);
|
||||
}
|
||||
|
||||
static struct protocol slam_protocol __protocol = {
|
||||
struct protocol slam_protocol __protocol = {
|
||||
.name = "x-slam",
|
||||
.default_port = SLAM_PORT,
|
||||
.load = url_slam,
|
||||
|
Loading…
Reference in New Issue
Block a user