[OpenBIOS] OpenBIOS documentation

BALATON Zoltan balaton at eik.bme.hu
Mon Oct 17 18:49:32 CEST 2016


On Mon, 17 Oct 2016, Programmingkid wrote:
> I noticed many of these kind of changes:
> Original coreboot version:
> 	ed_t *const periodic_ed = dma_memalign(sizeof(ed_t), sizeof(ed_t));
>
> OpenBIOS version:
> 	ed_t *const periodic_ed;

Plus another line following this calling ofmem_posix_memalign() isn't it? 
This should be eqiuvalent to dma_memalign using OpenBIOS's facilities.

> All of the dma_memalign() calls were removed. How did this code work 
> with so many uninitialized pointers?

They are not supposed to be unintialised as ofmem_posix_memalign() 
function initialises them.

> When compiling OpenBIOS with gcc 4.2.3, a lot of warnings were issued by 
> the compiler:
>
>  CC    target/drivers/usbohci.o
> cc1: warnings being treated as errors
> /Users/john/desktop/openbios/drivers/usbohci.c: In function ‘ohci_init’:
> /Users/john/desktop/openbios/drivers/usbohci.c:230: warning: dereferencing type-punned pointer will break strict-aliasing rules

These may be harmless caused but passing a pointer to a struct as void * 
which gcc does not like but apart from the warning it may actually work. I 
don't know how to supress this warning other than disabling it for this 
file. Maybe using a temporary void * pointer to allocate memory with 
ofmem_posix_memalign() and then assigning the result to the struct pointer 
could supress the warning but I'm not sure. In any case, I think these 
warnings and the problem seen with non-working keyboard are likely 
unrelated.

Regards,
BALATON Zoltan


More information about the OpenBIOS mailing list