Changeset View
Changeset View
Standalone View
Standalone View
sys/boot/efi/boot1/boot1.c
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | Malloc(size_t len, const char *file __unused, int line __unused) | ||||
void *out; | void *out; | ||||
if (BS->AllocatePool(EfiLoaderData, len, &out) == EFI_SUCCESS) | if (BS->AllocatePool(EfiLoaderData, len, &out) == EFI_SUCCESS) | ||||
return (out); | return (out); | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
void * | |||||
Calloc(size_t number, size_t len, const char *file __unused, int line __unused) | |||||
{ | |||||
uintptr_t bytes = (uintptr_t)number * (uintptr_t)len; | |||||
void *out; | |||||
if ((out = Malloc(bytes, file, line)) != NULL) { | |||||
bzero(out, bytes); | |||||
} | |||||
return(out); | |||||
} | |||||
void | void | ||||
Free(void *buf, const char *file __unused, int line __unused) | Free(void *buf, const char *file __unused, int line __unused) | ||||
{ | { | ||||
if (buf != NULL) | if (buf != NULL) | ||||
(void)BS->FreePool(buf); | (void)BS->FreePool(buf); | ||||
} | } | ||||
static EFI_STATUS | static EFI_STATUS | ||||
▲ Show 20 Lines • Show All 497 Lines • Show Last 20 Lines |