CVSROOT: /cvs Module name: src Changes by: d...@cvs.openbsd.org 2014/03/23 19:18:28
Modified files: sys/dev/pci : if_myxreg.h Log message: annotate some packed structures with the alignment the hardware requires and the driver provides. without this gcc assumes the alignment of these structures is 1, which leads to some horrible asm. this is particularly interesting when reading stuff from the myx_status struct (like the txdone count) which needs to be atomic. doing byte reads and shifting them into a word in registers isnt atomic. its also probably a bit slow. specifying the alignment fixes this. deraadt@ warned me about this maybe 8 years ago.