Very quick and very dirty hack to get the Mellanox code building

inside gPXE.
This commit is contained in:
Michael Brown
2007-08-18 18:04:18 +01:00
parent 9d2c54735e
commit b42c5905cb
7 changed files with 76 additions and 45 deletions

View File

@@ -174,6 +174,8 @@ static inline unsigned long lalign(unsigned long buf, unsigned long align)
(~(((unsigned long)align) - 1)));
}
#include <gpxe/umalloc.h>
static int init_dev_data(void)
{
unsigned long tmp;
@@ -191,9 +193,13 @@ static int init_dev_data(void)
tprintf("outprm: va=%p, pa=0x%lx", dev_buffers_p->outprm_buf,
virt_to_bus(dev_buffers_p->outprm_buf));
phys_mem.base =
(virt_to_phys(_text) - reserve_size) & (~(reserve_size - 1));
userptr_t lotsofmem = umalloc ( reserve_size * 2 );
if ( ! lotsofmem ) {
printf ( "Could not allocate large memblock\n" );
return -1;
}
phys_mem.base = ( ( user_to_phys ( lotsofmem, 0 ) + reserve_size ) &
~( reserve_size - 1 ) );
phys_mem.offset = 0;
return 0;