aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wraps.h
diff options
context:
space:
mode:
authorAnastasia Klimchuk <aklm@chromium.org>2022-04-12 13:33:39 +1000
committerAnastasia Klimchuk <aklm@chromium.org>2022-04-29 04:30:38 +0000
commitc4784f1a9a491eab118bbec81808e2de1dec187f (patch)
treec23eed59a688548e05275947417f769aaa5e5b01 /tests/wraps.h
parent402e5d697c1ea09ef48bc09cbd4f743a7d44bc52 (diff)
downloadflashrom-c4784f1a9a491eab118bbec81808e2de1dec187f.tar.gz
flashrom-c4784f1a9a491eab118bbec81808e2de1dec187f.tar.bz2
flashrom-c4784f1a9a491eab118bbec81808e2de1dec187f.zip
tests: Add and include headers with function prototypes
Part 2 of fixing -Wmissing-prototypes warnings. This patch adds headers with function prototypes and includes the headers into source files. This fixes the warnings like this: warning: no previous prototype for ‘function_name’ [-Wmissing-prototypes] This patch is needed to sync compiler warning options between meson and makefile. TEST=running the following produces no warnings: meson setup --wipe (to clean build directory) ninja test Change-Id: Ia1ff22deb2354569f277649c6575ef2d5ffbb6e0 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/63489 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Diffstat (limited to 'tests/wraps.h')
-rw-r--r--tests/wraps.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/tests/wraps.h b/tests/wraps.h
new file mode 100644
index 00000000..c088d98d
--- /dev/null
+++ b/tests/wraps.h
@@ -0,0 +1,71 @@
+/*
+ * This file is part of the flashrom project.
+ *
+ * Copyright 2022 Google LLC
+ *
+ * This program 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; version 2 of the License.
+ *
+ * This program 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.
+ */
+
+#ifndef WRAPS_H
+#define WRAPS_H
+
+#include <stdio.h>
+#include "flash.h"
+
+char *__wrap_strdup(const char *s);
+void __wrap_physunmap(void *virt_addr, size_t len);
+void *__wrap_physmap(const char *descr, uintptr_t phys_addr, size_t len);
+struct pci_dev *__wrap_pcidev_init(void *devs, int bar);
+uintptr_t __wrap_pcidev_readbar(void *dev, int bar);
+void __wrap_sio_write(uint16_t port, uint8_t reg, uint8_t data);
+uint8_t __wrap_sio_read(uint16_t port, uint8_t reg);
+int __wrap_open(const char *pathname, int flags);
+int __wrap_open64(const char *pathname, int flags);
+int __wrap___open64_2(const char *pathname, int flags);
+int __wrap_ioctl(int fd, unsigned long int request, ...);
+int __wrap_write(int fd, const void *buf, size_t sz);
+int __wrap_read(int fd, void *buf, size_t sz);
+FILE *__wrap_fopen(const char *pathname, const char *mode);
+FILE *__wrap_fopen64(const char *pathname, const char *mode);
+FILE *__wrap_fdopen(int fd, const char *mode);
+int __wrap_stat(const char *path, void *buf);
+int __wrap_stat64(const char *path, void *buf);
+int __wrap___xstat(const char *path, void *buf);
+int __wrap___xstat64(const char *path, void *buf);
+int __wrap_fstat(int fd, void *buf);
+int __wrap_fstat64(int fd, void *buf);
+int __wrap___fxstat(int fd, void *buf);
+int __wrap___fxstat64(int fd, void *buf);
+char *__wrap_fgets(char *buf, int len, FILE *fp);
+char *__wrap___fgets_chk(char *buf, int len, FILE *fp);
+size_t __wrap_fread(void *ptr, size_t size, size_t nmemb, FILE *fp);
+size_t __wrap_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *fp);
+int __wrap_fflush(FILE *fp);
+int __wrap_fileno(FILE *fp);
+int __wrap_fsync(int fd);
+int __wrap_setvbuf(FILE *fp, char *buf, int type, size_t size);
+int __wrap_fprintf(FILE *fp, const char *fmt, ...);
+int __wrap___vfprintf_chk(FILE *fp, const char *fmt, va_list args);
+int __wrap_fclose(FILE *fp);
+int __wrap_feof(FILE *fp);
+int __wrap_ferror(FILE *fp);
+void __wrap_clearerr(FILE *fp);
+int __wrap_rget_io_perms(void);
+void __wrap_test_outb(unsigned char value, unsigned short port);
+unsigned char __wrap_test_inb(unsigned short port);
+void __wrap_test_outw(unsigned short value, unsigned short port);
+unsigned short __wrap_test_inw(unsigned short port);
+void __wrap_test_outl(unsigned int value, unsigned short port);
+unsigned int __wrap_test_inl(unsigned short port);
+int __wrap_spi_send_command(const struct flashctx *flash,
+ unsigned int writecnt, unsigned int readcnt,
+ const unsigned char *writearr, unsigned char *readarr);
+
+#endif /* WRAPS_H */