mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-25 20:27:55 +01:00
- Unbreak booting sparc64 kernels after the metadata unification in
r329190; sparc64 kernels are always 64-bit but with that revision in place, the loader was treating them as 32-bit ones. - In order to reduce the likelihood of this kind of breakage in the future, #ifdef out md_load() on sparc64 and make md_load_dual() - which is currently local to metadata.c anyway - static. - Make md_getboothowto() - also local to metadata.c - static. - Get rid of the unused DTB pointer on sparc64.
This commit is contained in:
parent
fcfaa4734c
commit
dd5dbb3199
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333955
@ -94,7 +94,7 @@ md_bootserial(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
static int
|
||||
md_getboothowto(char *kargs)
|
||||
{
|
||||
char *cp;
|
||||
@ -307,7 +307,7 @@ md_copymodules(vm_offset_t addr, int kern64)
|
||||
* - The kernel environment is copied into kernel space.
|
||||
* - Module metadata are formatted and placed in kernel space.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
md_load_dual(char *args, vm_offset_t *modulep, vm_offset_t *dtb, int kern64)
|
||||
{
|
||||
struct preloaded_file *kfp;
|
||||
@ -460,13 +460,15 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offset_t *dtb, int kern64)
|
||||
return(0);
|
||||
}
|
||||
|
||||
#if !defined(__sparc64__)
|
||||
int
|
||||
md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb)
|
||||
{
|
||||
return (md_load_dual(args, modulep, dtb, 0));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__mips__) || defined(__powerpc__)
|
||||
#if defined(__mips__) || defined(__powerpc__) || defined(__sparc64__)
|
||||
int
|
||||
md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb)
|
||||
{
|
||||
|
@ -62,7 +62,9 @@ struct preloaded_file;
|
||||
struct file_format;
|
||||
|
||||
/* MD code implementing MI interfaces */
|
||||
#if !defined(__sparc64__)
|
||||
vm_offset_t md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
|
||||
#endif
|
||||
vm_offset_t md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
|
||||
|
||||
extern void reboot(void);
|
||||
|
@ -339,7 +339,7 @@ static int
|
||||
__elfN(exec)(struct preloaded_file *fp)
|
||||
{
|
||||
struct file_metadata *fmp;
|
||||
vm_offset_t mdp, dtbp;
|
||||
vm_offset_t mdp;
|
||||
Elf_Addr entry;
|
||||
Elf_Ehdr *e;
|
||||
int error;
|
||||
@ -348,7 +348,7 @@ __elfN(exec)(struct preloaded_file *fp)
|
||||
return (EFTYPE);
|
||||
e = (Elf_Ehdr *)&fmp->md_data;
|
||||
|
||||
if ((error = md_load(fp->f_args, &mdp, &dtbp)) != 0)
|
||||
if ((error = md_load64(fp->f_args, &mdp, NULL)) != 0)
|
||||
return (error);
|
||||
|
||||
printf("jumping to kernel entry at %#lx.\n", e->e_entry);
|
||||
|
Loading…
Reference in New Issue
Block a user