Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move uninitialised .data16 variables to .bss16; saves around 2000
bytes of useless zeroes in the final image.
  • Loading branch information
Michael Brown committed Jul 16, 2007
1 parent 3892047 commit 6d2e4e7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/arch/i386/core/basemem_packet.c
Expand Up @@ -27,4 +27,4 @@
#include <basemem_packet.h>

#undef basemem_packet
char __data16_array ( basemem_packet, [BASEMEM_PACKET_LEN] );
char __bss16_array ( basemem_packet, [BASEMEM_PACKET_LEN] );
4 changes: 2 additions & 2 deletions src/arch/i386/drivers/net/undiload.c
Expand Up @@ -36,11 +36,11 @@
*/

/** Parameter block for calling UNDI loader */
static struct s_UNDI_LOADER __data16 ( undi_loader );
static struct s_UNDI_LOADER __bss16 ( undi_loader );
#define undi_loader __use_data16 ( undi_loader )

/** UNDI loader entry point */
static SEGOFF16_t __data16 ( undi_loader_entry );
static SEGOFF16_t __bss16 ( undi_loader_entry );
#define undi_loader_entry __use_data16 ( undi_loader_entry )

/**
Expand Down
4 changes: 2 additions & 2 deletions src/arch/i386/drivers/net/undinet.c
Expand Up @@ -136,15 +136,15 @@ undinet_function_name ( unsigned int function ) {
* Used as the paramter block for all UNDI API calls. Resides in base
* memory.
*/
static union u_PXENV_ANY __data16 ( undinet_params );
static union u_PXENV_ANY __bss16 ( undinet_params );
#define undinet_params __use_data16 ( undinet_params )

/** UNDI entry point
*
* Used as the indirection vector for all UNDI API calls. Resides in
* base memory.
*/
SEGOFF16_t __data16 ( undinet_entry_point );
SEGOFF16_t __bss16 ( undinet_entry_point );
#define undinet_entry_point __use_data16 ( undinet_entry_point )

/**
Expand Down
2 changes: 1 addition & 1 deletion src/arch/i386/firmware/pcbios/memmap.c
Expand Up @@ -49,7 +49,7 @@ struct e820_entry {
#define E820_TYPE_NVS 4 /**< ACPI NVS memory */

/** Buffer for INT 15,e820 calls */
static struct e820_entry __data16 ( e820buf );
static struct e820_entry __bss16 ( e820buf );
#define e820buf __use_data16 ( e820buf )

/**
Expand Down
6 changes: 3 additions & 3 deletions src/arch/i386/image/multiboot.c
Expand Up @@ -195,7 +195,7 @@ multiboot_build_module_list ( struct image *image,
* along with the other structures belonging to the Multiboot
* information table.
*/
static struct multiboot_info __data16 ( mbinfo );
static struct multiboot_info __bss16 ( mbinfo );
#define mbinfo __use_data16 ( mbinfo )

/** The multiboot bootloader name */
Expand All @@ -204,11 +204,11 @@ static char __data16_array ( mb_bootloader_name, [] ) = "gPXE " VERSION;

/** The multiboot memory map */
static struct multiboot_memory_map
__data16_array ( mbmemmap, [MAX_MEMORY_REGIONS] );
__bss16_array ( mbmemmap, [MAX_MEMORY_REGIONS] );
#define mbmemmap __use_data16 ( mbmemmap )

/** The multiboot module list */
static struct multiboot_module __data16_array ( mbmodules, [MAX_MODULES] );
static struct multiboot_module __bss16_array ( mbmodules, [MAX_MODULES] );
#define mbmodules __use_data16 ( mbmodules )

/**
Expand Down
2 changes: 1 addition & 1 deletion src/arch/i386/include/basemem_packet.h
Expand Up @@ -7,7 +7,7 @@
#define BASEMEM_PACKET_LEN 1514

/** Base memory packet buffer */
extern char __data16_array ( basemem_packet, [BASEMEM_PACKET_LEN] );
extern char __bss16_array ( basemem_packet, [BASEMEM_PACKET_LEN] );
#define basemem_packet __use_data16 ( basemem_packet )

#endif /* BASEMEM_PACKET_H */

0 comments on commit 6d2e4e7

Please sign in to comment.