191852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved. 291852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson * Use of this source code is governed by a BSD-style license that can be 391852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson * found in the LICENSE file. 491852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson * 591852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson * Workaround for TODO(crbug.com/437107). Remove this file when it's fixed. 691852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson */ 791852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson 891852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson#define _STUB_IMPLEMENTATION_ 991852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson 1091852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson#include <stdio.h> 1191852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson#include <stdlib.h> 1291852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson 1391852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson#include "vboot_api.h" 1491852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson 1591852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardsonvoid *VbExMalloc(size_t size) 1691852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson{ 1791852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson void *p = malloc(size); 1891852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson 1991852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson if (!p) { 2091852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson /* Fatal Error. We must abort. */ 2191852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson abort(); 2291852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson } 2391852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson 2491852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson return p; 2591852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson} 2691852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardsonvoid VbExFree(void *ptr) 2791852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson{ 2891852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson free(ptr); 2991852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson} 3091852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson 3191852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson 3291852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson/* 3391852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson * This file should be used only when building the static version of futility, 3491852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson * so let's intentionally break any tests that link with it by accident. 3591852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson */ 3691852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardsonint vboot_api_stub_check_memory(void) 3791852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson{ 3891852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson return -1; 3991852e7f58d50a031bcb5c02e68473cefb10ebb0Bill Richardson} 40