Add generic physical memory allocation functions

Add a set of generic physical memory allocation functions. These will
be used by most platforms, except for EFI. When running under EFI, the
firmware is in control of the memory map and it is possible for it to
change underneath the loader, so for EFI the memory allocation
functions will use the firmware interfaces to allocate memory. On other
platforms the loader has full control of the memory map and allocates
memory itself. Whether or not the generic functions are used is
determined by the PLATFORM_HAS_MM flag, this is defined when the
platform provides its own allocation functions (i.e. EFI).