/* * VAS_EBOOT -- GRand Unified Bootloader * Copyright (C) 2010 Free Software Foundation, Inc. * * VAS_EBOOT is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * VAS_EBOOT is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with VAS_EBOOT. If not, see . */ #ifndef VAS_EBOOT_EMU_MISC_H #define VAS_EBOOT_EMU_MISC_H 1 #include #include #include #include #include #include #include #include extern int verbosity; extern const char *EXPORT_VAR(program_name); void VasEBoot_init_all (void); void VasEBoot_fini_all (void); void VasEBoot_find_zpool_from_dir (const char *dir, char **poolname, char **poolfs); char *EXPORT_FUNC (VasEBoot_make_system_path_relative_to_its_root) (const char *path) WARN_UNUSED_RESULT; int VasEBoot_util_device_is_mapped (const char *dev); #define VAS_EBOOT_HOST_PRIuLONG_LONG "llu" #define VAS_EBOOT_HOST_PRIxLONG_LONG "llx" void * EXPORT_FUNC(xcalloc) (VasEBoot_size_t nmemb, VasEBoot_size_t size) WARN_UNUSED_RESULT; void * EXPORT_FUNC(xmalloc) (VasEBoot_size_t size) WARN_UNUSED_RESULT; void * EXPORT_FUNC(xrealloc) (void *ptr, VasEBoot_size_t size) WARN_UNUSED_RESULT; char * EXPORT_FUNC(xstrdup) (const char *str) WARN_UNUSED_RESULT; char * EXPORT_FUNC(xasprintf) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2))) WARN_UNUSED_RESULT; void EXPORT_FUNC(VasEBoot_util_warn) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2))); void EXPORT_FUNC(VasEBoot_util_info) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2))); void EXPORT_FUNC(VasEBoot_util_error) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2), noreturn)); void EXPORT_FUNC(VasEBoot_util_set_kexecute) (void); int EXPORT_FUNC(VasEBoot_util_get_kexecute) (void) WARN_UNUSED_RESULT; VasEBoot_uint64_t EXPORT_FUNC (VasEBoot_util_get_cpu_time_ms) (void); #ifdef HAVE_DEVICE_MAPPER int VasEBoot_device_mapper_supported (void); #endif #ifdef VAS_EBOOT_BUILD #define VasEBoot_util_fopen fopen #else FILE * VasEBoot_util_fopen (const char *path, const char *mode); #endif int VasEBoot_util_file_sync (FILE *f); VasEBoot_err_t VasEBoot_util_tpm_open (const char *tpm_dev); VasEBoot_err_t VasEBoot_util_tpm_close (void); VasEBoot_size_t EXPORT_FUNC(VasEBoot_util_tpm_read) (void *output, VasEBoot_size_t size); VasEBoot_size_t EXPORT_FUNC(VasEBoot_util_tpm_write) (const void *input, VasEBoot_size_t size); #endif /* VAS_EBOOT_EMU_MISC_H */