Skip to content

Commit

Permalink
x86: Add a default implementation for cleanup_before_linux()
Browse files Browse the repository at this point in the history
This function provides an opportunity for some last minute cleanup and
reconfiguration before control is handed over to Linux. It's possible this
may need to do something in the future, but for now it's left empty. It's set
up as a weak symbol so it can be overridden if necessary on a case by case
basis.

Signed-off-by: Gabe Black <[email protected]>
Signed-off-by: Simon Glass <[email protected]>
  • Loading branch information
Gabe Black authored and sjg20 committed Nov 30, 2012
1 parent 9ad4736 commit f30fc4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/x86/cpu/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ void setup_gdt(gd_t *id, u64 *gdt_addr)
load_fs(X86_GDT_ENTRY_32BIT_FS);
}

int __weak x86_cleanup_before_linux(void)
{
return 0;
}

int x86_cpu_init_f(void)
{
const u32 em_rst = ~X86_CR0_EM;
Expand Down
1 change: 1 addition & 0 deletions arch/x86/include/asm/u-boot-x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ int cpu_init_f(void);
void init_gd(gd_t *id, u64 *gdt_addr);
void setup_gdt(gd_t *id, u64 *gdt_addr);
int init_cache(void);
int cleanup_before_linux(void);

/* cpu/.../timer.c */
void timer_isr(void *);
Expand Down

0 comments on commit f30fc4d

Please sign in to comment.