mirror of https://github.com/ipxe/ipxe.git
Update to REAL_CODE()
parent
6631f46999
commit
04d6005d77
|
@ -75,19 +75,16 @@ static unsigned int extmemsize_e801 ( void ) {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
unsigned int extmem;
|
unsigned int extmem;
|
||||||
|
|
||||||
REAL_EXEC ( rm_mem_e801,
|
__asm__ __volatile__ ( REAL_CODE ( "stc\n\t"
|
||||||
"stc\n\t"
|
|
||||||
"int $0x15\n\t"
|
"int $0x15\n\t"
|
||||||
"pushfw\n\t"
|
"pushfw\n\t"
|
||||||
"popw %w0\n\t",
|
"popw %w0\n\t" )
|
||||||
5,
|
: "=r" ( flags ),
|
||||||
OUT_CONSTRAINTS ( "=r" ( flags ),
|
|
||||||
"=a" ( extmem_1m_to_16m_k ),
|
"=a" ( extmem_1m_to_16m_k ),
|
||||||
"=b" ( extmem_16m_plus_64k ),
|
"=b" ( extmem_16m_plus_64k ),
|
||||||
"=c" ( confmem_1m_to_16m_k ),
|
"=c" ( confmem_1m_to_16m_k ),
|
||||||
"=d" ( confmem_16m_plus_64k ) ),
|
"=d" ( confmem_16m_plus_64k )
|
||||||
IN_CONSTRAINTS ( "a" ( 0xe801 ) ),
|
: "a" ( 0xe801 ) );
|
||||||
CLOBBER ( "cc" ) );
|
|
||||||
|
|
||||||
if ( flags & CF )
|
if ( flags & CF )
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -111,13 +108,9 @@ static unsigned int extmemsize_e801 ( void ) {
|
||||||
static unsigned int extmemsize_88 ( void ) {
|
static unsigned int extmemsize_88 ( void ) {
|
||||||
uint16_t extmem;
|
uint16_t extmem;
|
||||||
|
|
||||||
REAL_EXEC ( rm_mem_88,
|
|
||||||
/* Ignore CF; it is not reliable for this call */
|
/* Ignore CF; it is not reliable for this call */
|
||||||
"int $0x15\n\t",
|
__asm__ __volatile__ ( REAL_CODE ( "int $0x15" )
|
||||||
1,
|
: "=a" ( extmem ) : "a" ( 0x8800 ) );
|
||||||
OUT_CONSTRAINTS ( "=a" ( extmem ) ),
|
|
||||||
IN_CONSTRAINTS ( "a" ( 0x8800 ) ),
|
|
||||||
CLOBBER ( "cc" ) );
|
|
||||||
|
|
||||||
DBG ( "Extended memory size %d kB\n", extmem );
|
DBG ( "Extended memory size %d kB\n", extmem );
|
||||||
return extmem;
|
return extmem;
|
||||||
|
@ -153,32 +146,30 @@ static int meme820 ( struct memory_region *memmap, unsigned int entries ) {
|
||||||
unsigned int discard_c, discard_d, discard_D;
|
unsigned int discard_c, discard_d, discard_D;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
REAL_EXEC ( rm_mem_e820,
|
__asm__ __volatile__ ( REAL_CODE ( "stc\n\t"
|
||||||
"stc\n\t"
|
|
||||||
"int $0x15\n\t"
|
"int $0x15\n\t"
|
||||||
"pushfw\n\t"
|
"pushfw\n\t"
|
||||||
"popw %w0\n\t",
|
"popw %w0\n\t" )
|
||||||
6,
|
: "=r" ( flags ), "=a" ( smap ),
|
||||||
OUT_CONSTRAINTS ( "=r" ( flags ),
|
"=b" ( next ), "=D" ( discard_D ),
|
||||||
"=a" ( smap ),
|
"=c" ( discard_c ), "=d" ( discard_d )
|
||||||
"=b" ( next ),
|
: "a" ( 0xe820 ), "b" ( next ),
|
||||||
"=D" ( discard_D ),
|
"D" ( &__from_data16 ( e820buf ) ),
|
||||||
"=c" ( discard_c ),
|
|
||||||
"=d" ( discard_d ) ),
|
|
||||||
IN_CONSTRAINTS ( "a" ( 0xe820 ),
|
|
||||||
"b" ( next ),
|
|
||||||
"D" ( &__from_data16 ( e820buf )),
|
|
||||||
"c" ( sizeof ( e820buf ) ),
|
"c" ( sizeof ( e820buf ) ),
|
||||||
"d" ( SMAP ) ),
|
"d" ( SMAP )
|
||||||
CLOBBER ( "memory" ) );
|
: "memory" );
|
||||||
|
|
||||||
if ( smap != SMAP )
|
if ( smap != SMAP )
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
|
|
||||||
if ( flags & CF )
|
if ( flags & CF )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
DBG ( "E820 region [%llx,%llx) type %d\n", e820buf.start,
|
DBG ( "E820 region [%llx,%llx) type %d\n", e820buf.start,
|
||||||
( e820buf.start + e820buf.len ), ( int ) e820buf.type );
|
( e820buf.start + e820buf.len ), ( int ) e820buf.type );
|
||||||
if ( e820buf.type != E820_TYPE_RAM )
|
if ( e820buf.type != E820_TYPE_RAM )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
memmap[index].start = e820buf.start;
|
memmap[index].start = e820buf.start;
|
||||||
memmap[index].end = e820buf.start + e820buf.len;
|
memmap[index].end = e820buf.start + e820buf.len;
|
||||||
index++;
|
index++;
|
||||||
|
|
Loading…
Reference in New Issue