provide pushfl/popfl to C code

This commit is contained in:
drochner 1998-02-05 19:53:52 +00:00
parent e6b98c1152
commit 3f38ea4063
1 changed files with 16 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpufunc.h,v 1.11 1997/09/09 21:42:42 mycroft Exp $ */ /* $NetBSD: cpufunc.h,v 1.12 1998/02/05 19:53:52 drochner Exp $ */
/* /*
* Copyright (c) 1993 Charles Hannum. * Copyright (c) 1993 Charles Hannum.
@ -141,6 +141,21 @@ enable_intr(void)
__asm __volatile("sti"); __asm __volatile("sti");
} }
static __inline u_long
read_eflags(void)
{
u_long ef;
__asm __volatile("pushfl; popl %0" : "=r" (ef));
return (ef);
}
static __inline void
write_eflags(u_long ef)
{
__asm __volatile("pushl %0; popfl" : : "r" (ef));
}
/* Break into DDB/KGDB. */ /* Break into DDB/KGDB. */
static __inline void static __inline void
breakpoint(void) breakpoint(void)