In-tree gcc (4.2) doesn't understand __attribute__((ms_abi)) (EFIABI_ATTR). Avoid declaring functions with that attribute when the compiler is detected to be gcc < 4.4.
I realize that the old in-tree gcc is not a high priority but there is some value in keeping it functioning and this is one of the last couple thing blocking amd64/gcc4.2 buildkernel.