mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
migrate ppc/qemu ofmem implementation to ucell parameter type (Igor Kovalenko)
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@521 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -37,8 +37,8 @@ DECLARE_NODE( rtas, INSTALL_OPEN, 0, "+/rtas" );
|
||||
static void
|
||||
rtas_instantiate( void )
|
||||
{
|
||||
int physbase = POP();
|
||||
int s=0x1000, size = (int)of_rtas_end - (int)of_rtas_start;
|
||||
ucell physbase = POP();
|
||||
ucell s=0x1000, size = (ucell)of_rtas_end - (ucell)of_rtas_start;
|
||||
ulong virt;
|
||||
|
||||
while( s < size )
|
||||
@@ -166,10 +166,10 @@ DECLARE_NODE( mmu_ciface, 0, 0, "+/openprom/client-services" );
|
||||
static void
|
||||
mem_claim( void )
|
||||
{
|
||||
int align = POP();
|
||||
int size = POP();
|
||||
int phys = POP();
|
||||
int ret = ofmem_claim_phys( phys, size, align );
|
||||
ucell align = POP();
|
||||
ucell size = POP();
|
||||
ucell phys = POP();
|
||||
ucell ret = ofmem_claim_phys( phys, size, align );
|
||||
|
||||
if( ret == -1 ) {
|
||||
printk("MEM: claim failure\n");
|
||||
@@ -190,10 +190,10 @@ mem_release( void )
|
||||
static void
|
||||
mmu_claim( void )
|
||||
{
|
||||
int align = POP();
|
||||
int size = POP();
|
||||
int phys = POP();
|
||||
int ret = ofmem_claim_virt( phys, size, align );
|
||||
ucell align = POP();
|
||||
ucell size = POP();
|
||||
ucell phys = POP();
|
||||
ucell ret = ofmem_claim_virt( phys, size, align );
|
||||
|
||||
if( ret == -1 ) {
|
||||
printk("MMU: CLAIM failure\n");
|
||||
@@ -214,11 +214,11 @@ mmu_release( void )
|
||||
static void
|
||||
mmu_map( void )
|
||||
{
|
||||
int mode = POP();
|
||||
int size = POP();
|
||||
int virt = POP();
|
||||
int phys = POP();
|
||||
int ret;
|
||||
ucell mode = POP();
|
||||
ucell size = POP();
|
||||
ucell virt = POP();
|
||||
ucell phys = POP();
|
||||
ucell ret;
|
||||
|
||||
/* printk("mmu_map: %x %x %x %x\n", phys, virt, size, mode ); */
|
||||
ret = ofmem_map( phys, virt, size, mode );
|
||||
@@ -258,10 +258,10 @@ mmu_translate( void )
|
||||
static void
|
||||
ciface_claim( void )
|
||||
{
|
||||
int align = POP();
|
||||
int size = POP();
|
||||
int virt = POP();
|
||||
int ret = ofmem_claim( virt, size, align );
|
||||
ucell align = POP();
|
||||
ucell size = POP();
|
||||
ucell virt = POP();
|
||||
ucell ret = ofmem_claim( virt, size, align );
|
||||
|
||||
/* printk("ciface_claim: %08x %08x %x\n", virt, size, align ); */
|
||||
PUSH( ret );
|
||||
|
||||
@@ -315,7 +315,7 @@ join_ranges( range_t **rr )
|
||||
}
|
||||
|
||||
static void
|
||||
fill_range( ulong ea, ucell size, range_t **rr )
|
||||
fill_range( ucell ea, ucell size, range_t **rr )
|
||||
{
|
||||
add_entry_( ea, size, rr );
|
||||
join_ranges( rr );
|
||||
@@ -328,7 +328,7 @@ find_area( ucell align, ucell size, range_t *r, ucell min, ucell max, int revers
|
||||
range_t *r2;
|
||||
|
||||
if( (align & (align-1)) ) {
|
||||
printk("bad alignment %d\n", align);
|
||||
printk("bad alignment " FMT_ucell "\n", align);
|
||||
align = 0x1000;
|
||||
}
|
||||
if( !align )
|
||||
@@ -383,8 +383,8 @@ ofmem_claim_phys_( ucell phys, ucell size, ucell align, ucell min, ucell max, in
|
||||
return phys;
|
||||
}
|
||||
phys = find_area( align, size, ofmem->phys_range, min, max, reverse );
|
||||
if( phys == (ulong)-1 ) {
|
||||
printk("ofmem->claim_phys - out of space\n");
|
||||
if( phys == (ucell)-1 ) {
|
||||
printk("ofmem_claim_phys - out of space\n");
|
||||
return -1;
|
||||
}
|
||||
add_entry( phys, size, &ofmem->phys_range );
|
||||
@@ -413,7 +413,7 @@ ofmem_claim_virt_( ucell virt, ucell size, ucell align, ucell min, ucell max, in
|
||||
}
|
||||
|
||||
virt = find_area( align, size, ofmem->virt_range, min, max, reverse );
|
||||
if( virt == (ulong)-1 ) {
|
||||
if( virt == (ucell)-1 ) {
|
||||
printk("ofmem_claim_virt - out of space\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -454,7 +454,7 @@ ofmem_claim( ucell addr, ucell size, ucell align )
|
||||
align = 0x1000;
|
||||
phys = ofmem_claim_phys_( addr, size, align, 0, get_ram_size(), 1 /* reverse */ );
|
||||
virt = ofmem_claim_virt_( addr, size, align, 0, get_ram_size(), 1 /* reverse */ );
|
||||
if( phys == (ulong)-1 || virt == (ulong)-1 ) {
|
||||
if( phys == (ucell)-1 || virt == (ucell)-1 ) {
|
||||
printk("ofmem_claim failed\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -481,7 +481,7 @@ ofmem_claim( ucell addr, ucell size, ucell align )
|
||||
/************************************************************************/
|
||||
|
||||
static void
|
||||
split_trans( ulong virt )
|
||||
split_trans( ucell virt )
|
||||
{
|
||||
ofmem_t *ofmem = OFMEM;
|
||||
translation_t *t, *t2;
|
||||
@@ -513,7 +513,7 @@ map_page_range( ucell virt, ucell phys, ucell size, ucell mode )
|
||||
for( t=ofmem->trans; t; ) {
|
||||
if( virt == t->virt || (virt < t->virt && virt + size > t->virt )) {
|
||||
if( t->phys + virt - t->virt != phys ) {
|
||||
printk("mapping altered (ea %08x)\n", t->virt );
|
||||
printk("mapping altered (ea " FMT_ucellx ")\n", t->virt );
|
||||
} else if( t->mode != mode ){
|
||||
printk("mapping mode altered\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user