Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/i386/stand/lib/gatea20.c,v retrieving revision 1.8 retrieving revision 1.8.48.1 diff -u -p -r1.8 -r1.8.48.1 --- src/sys/arch/i386/stand/lib/gatea20.c 2005/12/11 12:17:48 1.8 +++ src/sys/arch/i386/stand/lib/gatea20.c 2007/10/02 18:27:29 1.8.48.1 @@ -1,14 +1,14 @@ -/* $NetBSD: gatea20.c,v 1.8 2005/12/11 12:17:48 christos Exp $ */ +/* $NetBSD: gatea20.c,v 1.8.48.1 2007/10/02 18:27:29 joerg Exp $ */ /* extracted from freebsd:sys/i386/boot/biosboot/io.c */ #include -#include #include #include "libi386.h" #include "biosmca.h" +#include "cpufunc.h" #define K_RDWR 0x60 /* keyboard data & cmds (read/write) */ #define K_STATUS 0x64 /* keyboard status */ @@ -33,7 +33,10 @@ static unsigned char x_20 = KB_A20; void gateA20(void) { - __asm("pushfl ; cli"); + u_long psl; + + psl = x86_read_psl(); + x86_disable_intr(); /* * Not all systems enable A20 via the keyboard controller. * * IBM PS/2 L40 @@ -67,5 +70,5 @@ gateA20(void) while (inb(K_STATUS) & K_OBUF_FUL) (void)inb(K_RDWR); } - __asm("popfl"); + x86_write_psl(psl); }