Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 85016 | Differences between
and this patch

Collapse All | Expand All

(-)grub-0.96-orig/grub/asmstub.c (-24 / +26 lines)
Lines 90-96 Link Here
90
static jmp_buf env_for_exit;
90
static jmp_buf env_for_exit;
91
91
92
/* The current color for console.  */
92
/* The current color for console.  */
93
static int console_current_color = A_NORMAL;
93
int console_current_color = A_NORMAL;
94
94
95
/* The file descriptor for a serial device.  */
95
/* The file descriptor for a serial device.  */
96
static int serial_fd = -1;
96
static int serial_fd = -1;
Lines 113-143 Link Here
113
  char *scratch, *simstack;
113
  char *scratch, *simstack;
114
  int i;
114
  int i;
115
115
116
  auto void doit (void);
117
  
116
  /* We need a nested function so that we get a clean stack frame,
118
  /* We need a nested function so that we get a clean stack frame,
117
     regardless of how the code is optimized. */
119
     regardless of how the code is optimized. */
118
  static volatile void doit ()
120
  auto void doit (void)
119
  {
121
    {
120
    /* Make sure our stack lives in the simulated memory area. */
122
      /* Make sure our stack lives in the simulated memory area. */
121
    asm volatile ("movl %%esp, %0\n\tmovl %1, %%esp\n"
123
      asm volatile ("movl %%esp, %0\n\tmovl %1, %%esp\n"
122
		  : "=&r" (realstack) : "r" (simstack));
124
		    : "=&r" (realstack) : "r" (simstack));
123
125
      
124
    /* Do a setjmp here for the stop command.  */
126
      /* Do a setjmp here for the stop command.  */
125
    if (! setjmp (env_for_exit))
127
      if (! setjmp (env_for_exit))
126
      {
128
	{
127
	/* Actually enter the generic stage2 code.  */
129
	  /* Actually enter the generic stage2 code.  */
128
	status = 0;
130
	  status = 0;
129
	init_bios_info ();
131
	  init_bios_info ();
130
      }
132
	}
131
    else
133
      else
132
      {
134
	{
133
	/* If ERRNUM is non-zero, then set STATUS to non-zero.  */
135
	  /* If ERRNUM is non-zero, then set STATUS to non-zero.  */
134
	if (errnum)
136
	  if (errnum)
135
	  status = 1;
137
	    status = 1;
136
      }
138
	}
137
139
      
138
    /* Replace our stack before we use any local variables. */
140
      /* Replace our stack before we use any local variables. */
139
    asm volatile ("movl %0, %%esp\n" : : "r" (realstack));
141
      asm volatile ("movl %0, %%esp\n" : : "r" (realstack));
140
  }
142
    }
141
143
142
  assert (grub_scratch_mem == 0);
144
  assert (grub_scratch_mem == 0);
143
  scratch = malloc (0x100000 + EXTENDED_MEMSIZE + 15);
145
  scratch = malloc (0x100000 + EXTENDED_MEMSIZE + 15);
(-)grub-0.96-orig/lib/device.c (-2 / +5 lines)
Lines 493-504 Link Here
493
static int
493
static int
494
read_device_map (FILE *fp, char **map, const char *map_file)
494
read_device_map (FILE *fp, char **map, const char *map_file)
495
{
495
{
496
  static void show_error (int no, const char *msg)
496
  auto void show_error (int no, const char *msg);
497
  auto void show_warning (int no, const char *msg, ...);
498
  
499
  auto void show_error (int no, const char *msg)
497
    {
500
    {
498
      fprintf (stderr, "%s:%d: error: %s\n", map_file, no, msg);
501
      fprintf (stderr, "%s:%d: error: %s\n", map_file, no, msg);
499
    }
502
    }
500
  
503
  
501
  static void show_warning (int no, const char *msg, ...)
504
  auto void show_warning (int no, const char *msg, ...)
502
    {
505
    {
503
      va_list ap;
506
      va_list ap;
504
      
507
      
(-)grub-0.96-orig/stage2/builtins.c (-6 / +16 lines)
Lines 141-149 Link Here
141
  int num_entries = 0;
141
  int num_entries = 0;
142
  int last_length = 0;
142
  int last_length = 0;
143
143
144
  auto void disk_read_blocklist_func (int sector, int offset, int length);
145
  
144
  /* Collect contiguous blocks into one entry as many as possible,
146
  /* Collect contiguous blocks into one entry as many as possible,
145
     and print the blocklist notation on the screen.  */
147
     and print the blocklist notation on the screen.  */
146
  static void disk_read_blocklist_func (int sector, int offset, int length)
148
  auto void disk_read_blocklist_func (int sector, int offset, int length)
147
    {
149
    {
148
      if (num_sectors > 0)
150
      if (num_sectors > 0)
149
	{
151
	{
Lines 589-596 Link Here
589
    "white"
591
    "white"
590
  };
592
  };
591
593
594
  auto int color_number (char *str);
595
  
592
  /* Convert the color name STR into the magical number.  */
596
  /* Convert the color name STR into the magical number.  */
593
  static int color_number (char *str)
597
  auto int color_number (char *str)
594
    {
598
    {
595
      char *ptr;
599
      char *ptr;
596
      int i;
600
      int i;
Lines 1906-1913 Link Here
1906
  char *stage2_os_file = 0;
1910
  char *stage2_os_file = 0;
1907
#endif /* GRUB_UTIL */
1911
#endif /* GRUB_UTIL */
1908
  
1912
  
1913
  auto void disk_read_savesect_func (int sector, int offset, int length);
1914
  auto void disk_read_blocklist_func (int sector, int offset, int length);
1915
  
1909
  /* Save the first sector of Stage2 in STAGE2_SECT.  */
1916
  /* Save the first sector of Stage2 in STAGE2_SECT.  */
1910
  static void disk_read_savesect_func (int sector, int offset, int length)
1917
  auto void disk_read_savesect_func (int sector, int offset, int length)
1911
    {
1918
    {
1912
      if (debug)
1919
      if (debug)
1913
	printf ("[%d]", sector);
1920
	printf ("[%d]", sector);
Lines 1923-1929 Link Here
1923
1930
1924
  /* Write SECTOR to INSTALLLIST, and update INSTALLADDR and
1931
  /* Write SECTOR to INSTALLLIST, and update INSTALLADDR and
1925
     INSTALLSECT.  */
1932
     INSTALLSECT.  */
1926
  static void disk_read_blocklist_func (int sector, int offset, int length)
1933
  auto void disk_read_blocklist_func (int sector, int offset, int length)
1927
    {
1934
    {
1928
      if (debug)
1935
      if (debug)
1929
	printf("[%d]", sector);
1936
	printf("[%d]", sector);
Lines 3742-3748 Link Here
3742
  int to_code, from_code;
3749
  int to_code, from_code;
3743
  int map_in_interrupt = 0;
3750
  int map_in_interrupt = 0;
3744
  
3751
  
3745
  static int find_key_code (char *key)
3752
  auto int find_key_code (char *key);
3753
  auto int find_ascii_code (char *key);
3754
  
3755
  auto int find_key_code (char *key)
3746
    {
3756
    {
3747
      int i;
3757
      int i;
3748
3758
Lines 3759-3765 Link Here
3759
      return 0;
3769
      return 0;
3760
    }
3770
    }
3761
  
3771
  
3762
  static int find_ascii_code (char *key)
3772
  auto int find_ascii_code (char *key)
3763
    {
3773
    {
3764
      int i;
3774
      int i;
3765
      
3775
      
(-)grub-0.96-orig/stage2/char_io.c (-2 / +5 lines)
Lines 1206-1212 Link Here
1206
memcheck (int addr, int len)
1206
memcheck (int addr, int len)
1207
{
1207
{
1208
#ifdef GRUB_UTIL
1208
#ifdef GRUB_UTIL
1209
  static int start_addr (void)
1209
  auto int start_addr (void);
1210
  auto int end_addr (void);
1211
  
1212
  auto int start_addr (void)
1210
    {
1213
    {
1211
      int ret;
1214
      int ret;
1212
# if defined(HAVE_START_SYMBOL)
1215
# if defined(HAVE_START_SYMBOL)
Lines 1217-1223 Link Here
1217
      return ret;
1220
      return ret;
1218
    }
1221
    }
1219
1222
1220
  static int end_addr (void)
1223
  auto int end_addr (void)
1221
    {
1224
    {
1222
      int ret;
1225
      int ret;
1223
# if defined(HAVE_END_SYMBOL)
1226
# if defined(HAVE_END_SYMBOL)
(-)grub-0.96-orig/stage2/smp-imps.h (-30 lines)
Lines 183-218 Link Here
183
 */
183
 */
184
184
185
/*
185
/*
186
 *  "imps_any_new_apics" is non-zero if any of the APICS (local or I/O)
187
 *  are *not* an 82489DX.  This is useful to determine if more than 15
188
 *  CPUs can be supported (true if zero).
189
 */
190
extern int imps_any_new_apics;
191
192
/*
193
 *  "imps_enabled" is non-zero if the probe sequence found IMPS
194
 *  information and was successful.
195
 */
196
extern int imps_enabled;
197
198
/*
199
 *  This contains the local APIC hardware address.
200
 */
201
extern unsigned imps_lapic_addr;
202
203
/*
204
 *  This represents the number of CPUs found.
205
 */
206
extern int imps_num_cpus;
207
208
/*
209
 *  These map from virtual cpu numbers to APIC id's and back.
210
 */
211
extern unsigned char imps_cpu_apic_map[IMPS_MAX_CPUS];
212
extern unsigned char imps_apic_cpu_map[IMPS_MAX_CPUS];
213
214
215
/*
216
 *  This is the primary function for probing for Intel MPS 1.1/1.4
186
 *  This is the primary function for probing for Intel MPS 1.1/1.4
217
 *  compatible hardware and BIOS information.  While probing the CPUs
187
 *  compatible hardware and BIOS information.  While probing the CPUs
218
 *  information returned from the BIOS, this also starts up each CPU
188
 *  information returned from the BIOS, this also starts up each CPU

Return to bug 85016