diff options
-rw-r--r-- | Android.mk | 1 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | firmware/2lib/2stub.c | 22 | ||||
-rw-r--r-- | firmware/stub/vboot_api_stub_init.c | 22 |
4 files changed, 19 insertions, 28 deletions
@@ -62,7 +62,6 @@ VBSLK_SRCS = \ VBINIT_SRCS += \ firmware/stub/tpm_lite_stub.c \ firmware/stub/utility_stub.c \ - firmware/stub/vboot_api_stub_init.c \ firmware/stub/vboot_api_stub_region.c VBSF_SRCS += \ @@ -434,7 +434,6 @@ FWLIB_SRCS += \ firmware/stub/tpm_lite_stub.c \ firmware/stub/vboot_api_stub.c \ firmware/stub/vboot_api_stub_disk.c \ - firmware/stub/vboot_api_stub_init.c \ firmware/stub/vboot_api_stub_stream.c \ firmware/2lib/2stub.c endif @@ -515,7 +514,6 @@ HOSTLIB_SRCS = \ firmware/stub/tpm_lite_stub.c \ firmware/stub/vboot_api_stub.c \ firmware/stub/vboot_api_stub_disk.c \ - firmware/stub/vboot_api_stub_init.c \ futility/dump_kernel_config_lib.c \ $(CROSSYSTEM_ARCH_C) \ host/lib/chromeos_config.c \ diff --git a/firmware/2lib/2stub.c b/firmware/2lib/2stub.c index 1454f77e..d26ee745 100644 --- a/firmware/2lib/2stub.c +++ b/firmware/2lib/2stub.c @@ -8,10 +8,15 @@ #include <stdarg.h> #include <stdlib.h> #include <stdio.h> +#include <sys/time.h> #include "2api.h" +#include "2common.h" #include "2sysincludes.h" +/*****************************************************************************/ +/* General utility stubs */ + __attribute__((weak)) void vb2ex_printf(const char *func, const char *fmt, ...) { @@ -33,10 +38,11 @@ void vb2ex_abort(void) } __attribute__((weak)) -vb2_error_t vb2ex_tpm_clear_owner(struct vb2_context *ctx) +uint32_t vb2ex_mtime(void) { - fprintf(stderr, "%s: function not implemented\n", __func__); - return VB2_ERROR_EX_UNIMPLEMENTED; + struct timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec * VB2_MSEC_PER_SEC + tv.tv_usec / VB2_USEC_PER_MSEC; } __attribute__((weak)) @@ -48,6 +54,16 @@ vb2_error_t vb2ex_read_resource(struct vb2_context *ctx, return VB2_ERROR_EX_UNIMPLEMENTED; } +/*****************************************************************************/ +/* TPM-related stubs */ + +__attribute__((weak)) +vb2_error_t vb2ex_tpm_clear_owner(struct vb2_context *ctx) +{ + fprintf(stderr, "%s: function not implemented\n", __func__); + return VB2_ERROR_EX_UNIMPLEMENTED; +} + __attribute__((weak)) vb2_error_t vb2ex_tpm_set_mode(enum vb2_tpm_mode mode_val) { diff --git a/firmware/stub/vboot_api_stub_init.c b/firmware/stub/vboot_api_stub_init.c deleted file mode 100644 index 80684126..00000000 --- a/firmware/stub/vboot_api_stub_init.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - * - * Stub implementations of firmware-provided API functions. - */ - -#include <stdarg.h> -#include <stdint.h> -#include <stdlib.h> -#include <sys/time.h> - -#include "2common.h" -#include "vboot_api.h" - -__attribute__((weak)) -uint32_t vb2ex_mtime(void) -{ - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec * VB2_MSEC_PER_SEC + tv.tv_usec / VB2_USEC_PER_MSEC; -} |