Skip to content

Commit

Permalink
Copy pxelinux's shutdown sequence: use UNLOAD_STACK without STOP_BASE,
Browse files Browse the repository at this point in the history
and call UNDI_SHUTDOWN first to make sure the NIC is in a safe state.
  • Loading branch information
Michael Brown committed Jan 8, 2007
1 parent 8f8af10 commit fbdebac
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/arch/i386/prefix/pxeprefix.S
@@ -1,6 +1,6 @@
#define PXENV_UNDI_SHUTDOWN 0x05
#define PXENV_STOP_UNDI 0x15
#define PXENV_UNLOAD_STACK 0x70
#define PXENV_STOP_BASE 0x76

#define PXE_STACK_MAGIC 0x57ac /* 'STac' */

Expand Down Expand Up @@ -138,13 +138,19 @@ find_undi_basemem_usage:
shrw $6, %cx
movw %cx, undi_fbms_end

/*****************************************************************************
* Leave NIC in a safe state
*****************************************************************************
*/
shutdown_nic:
movw $PXENV_UNDI_SHUTDOWN, %bx
call pxe_call

/*****************************************************************************
* Unload PXE base code
*****************************************************************************
*/
unload_base_code:
movw $PXENV_STOP_BASE, %bx
call pxe_call
movw $PXENV_UNLOAD_STACK, %bx
call pxe_call
jnz do_not_free_base_code
Expand Down

0 comments on commit fbdebac

Please sign in to comment.