| 1 |
/* |
| 2 |
* This file is part of the flashrom project. |
| 3 |
* |
| 4 |
* Copyright 2022 Google LLC |
| 5 |
* |
| 6 |
* This program is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of the GNU General Public License as published by |
| 8 |
* the Free Software Foundation; version 2 of the License. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
*/ |
| 15 |
|
| 16 |
#ifndef WRAPS_H |
| 17 |
#define WRAPS_H |
| 18 |
|
| 19 |
#include <stdio.h> |
| 20 |
#include "flash.h" |
| 21 |
|
| 22 |
struct programmer_cfg; /* defined in programmer.h */ |
| 23 |
struct termios; |
| 24 |
|
| 25 |
char *__wrap_strdup(const char *s); |
| 26 |
void __wrap_physunmap(void *virt_addr, size_t len); |
| 27 |
void *__wrap_physmap(const char *descr, uintptr_t phys_addr, size_t len); |
| 28 |
struct pci_dev *__wrap_pcidev_init(const struct programmer_cfg *cfg, void *devs, int bar); |
| 29 |
uintptr_t __wrap_pcidev_readbar(void *dev, int bar); |
| 30 |
void __wrap_sio_write(uint16_t port, uint8_t reg, uint8_t data); |
| 31 |
uint8_t __wrap_sio_read(uint16_t port, uint8_t reg); |
| 32 |
int __wrap_open(const char *pathname, int flags, ...); |
| 33 |
int __real_open(const char *pathname, int flags, ...); |
| 34 |
int __wrap_open64(const char *pathname, int flags, ...); |
| 35 |
int __wrap___open64_2(const char *pathname, int flags, ...); |
| 36 |
int __wrap_fcntl(int fd, int cmd, ...); |
| 37 |
int __wrap_fcntl64(int fd, int cmd, ...); |
| 38 |
int __wrap_ioctl(int fd, unsigned long int request, ...); |
| 39 |
int __wrap_write(int fd, const void *buf, size_t sz); |
| 40 |
int __wrap_read(int fd, void *buf, size_t sz); |
| 41 |
FILE *__wrap_fopen(const char *pathname, const char *mode); |
| 42 |
FILE *__real_fopen(const char *pathname, const char *mode); |
| 43 |
FILE *__wrap_fopen64(const char *pathname, const char *mode); |
| 44 |
FILE *__wrap_fdopen(int fd, const char *mode); |
| 45 |
FILE *__real_fdopen(int fd, const char *mode); |
| 46 |
int __wrap_stat(const char *path, void *buf); |
| 47 |
int __wrap_stat64(const char *path, void *buf); |
| 48 |
int __wrap___xstat(const char *path, void *buf); |
| 49 |
int __wrap___xstat64(const char *path, void *buf); |
| 50 |
int __wrap_fstat(int fd, void *buf); |
| 51 |
int __wrap_fstat64(int fd, void *buf); |
| 52 |
int __wrap___fstat50(int fd, void *buf); |
| 53 |
int __wrap___fxstat(int fd, void *buf); |
| 54 |
int __wrap___fxstat64(int fd, void *buf); |
| 55 |
char *__wrap_fgets(char *buf, int len, FILE *fp); |
| 56 |
char *__wrap___fgets_chk(char *buf, int len, FILE *fp); |
| 57 |
size_t __wrap_fread(void *ptr, size_t size, size_t nmemb, FILE *fp); |
| 58 |
size_t __wrap_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *fp); |
| 59 |
size_t __real_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *fp); |
| 60 |
int __wrap_fflush(FILE *fp); |
| 61 |
int __wrap_fileno(FILE *fp); |
| 62 |
int __wrap_fsync(int fd); |
| 63 |
int __wrap_setvbuf(FILE *fp, char *buf, int type, size_t size); |
| 64 |
int __wrap_fprintf(FILE *fp, const char *fmt, ...); |
| 65 |
int __wrap___vfprintf_chk(FILE *fp, const char *fmt, va_list args); |
| 66 |
int __wrap_fclose(FILE *fp); |
| 67 |
int __real_fclose(FILE *fp); |
| 68 |
int __wrap_feof(FILE *fp); |
| 69 |
int __wrap_ferror(FILE *fp); |
| 70 |
void __wrap_clearerr(FILE *fp); |
| 71 |
int __wrap_rget_io_perms(void); |
| 72 |
void __wrap_OUTB(unsigned char value, unsigned short port); |
| 73 |
unsigned char __wrap_INB(unsigned short port); |
| 74 |
void __wrap_OUTW(unsigned short value, unsigned short port); |
| 75 |
unsigned short __wrap_INW(unsigned short port); |
| 76 |
void __wrap_OUTL(unsigned int value, unsigned short port); |
| 77 |
unsigned int __wrap_INL(unsigned short port); |
| 78 |
int __wrap_tcgetattr(int fd, struct termios *termios_p); |
| 79 |
int __wrap_tcsetattr(int fd, int optional_actions, const struct termios *termios_p); |
| 80 |
int __wrap_spi_send_command(const struct flashctx *flash, |
| 81 |
unsigned int writecnt, unsigned int readcnt, |
| 82 |
const unsigned char *writearr, unsigned char *readarr); |
| 83 |
|
| 84 |
#endif /* WRAPS_H */ |