/* SPDX-License-Identifier: MIT */ #ifdef NV_RS_ROM_HOST_FIXTURE #include #define kvzalloc(bytes, flags) calloc(1, (bytes)) #define kvfree(buffer) free(buffer) #define GFP_KERNEL 0 #else #include #include #endif #include "rom_buffer.h" void *nv_rs_rom_buffer_alloc(size_t bytes) { /* CPU storage follows the constructor's u32 length. PROM acquisition and * physical FW allocation impose their own independent hardware bounds. */ if (!bytes || bytes > 0xffffffffULL) return NULL; return kvzalloc(bytes, GFP_KERNEL); } void nv_rs_rom_buffer_free(void *buffer) { kvfree(buffer); }