Patrick Venture | 123b5c0 | 2019-03-05 14:01:00 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | /* NOTE: IIRC, wak@ is working on exposing some of this in stdplus, so we can |
| 4 | * transition when that's ready. |
| 5 | * |
| 6 | * Copied some from gpioplus to enable unit-testing of lpc nuvoton and later |
| 7 | * other pieces. |
| 8 | */ |
| 9 | |
Patrick Venture | f9ee95f | 2021-02-12 12:33:31 -0800 | [diff] [blame^] | 10 | #include "sys_interface.hpp" |
| 11 | |
Patrick Venture | 123b5c0 | 2019-03-05 14:01:00 -0800 | [diff] [blame] | 12 | #include <poll.h> |
| 13 | #include <sys/mman.h> |
| 14 | |
| 15 | #include <cinttypes> |
| 16 | #include <cstddef> |
| 17 | |
Patrick Venture | 6844833 | 2019-03-07 09:08:04 -0800 | [diff] [blame] | 18 | namespace ipmiblob |
| 19 | { |
Patrick Venture | 123b5c0 | 2019-03-05 14:01:00 -0800 | [diff] [blame] | 20 | namespace internal |
| 21 | { |
| 22 | |
| 23 | /** |
Patrick Venture | 123b5c0 | 2019-03-05 14:01:00 -0800 | [diff] [blame] | 24 | * @class SysImpl |
| 25 | * @brief syscall concrete implementation |
| 26 | * @details Passes through all calls to the normal linux syscalls |
| 27 | */ |
| 28 | class SysImpl : public Sys |
| 29 | { |
| 30 | public: |
| 31 | int open(const char* pathname, int flags) const override; |
| 32 | int read(int fd, void* buf, std::size_t count) const override; |
| 33 | int close(int fd) const override; |
| 34 | void* mmap(void* addr, std::size_t length, int prot, int flags, int fd, |
| 35 | off_t offset) const override; |
| 36 | int munmap(void* addr, std::size_t length) const override; |
| 37 | int getpagesize() const override; |
| 38 | int ioctl(int fd, unsigned long request, void* param) const override; |
| 39 | int poll(struct pollfd* fds, nfds_t nfds, int timeout) const override; |
| 40 | }; |
| 41 | |
Patrick Venture | 123b5c0 | 2019-03-05 14:01:00 -0800 | [diff] [blame] | 42 | } // namespace internal |
Patrick Venture | 6844833 | 2019-03-07 09:08:04 -0800 | [diff] [blame] | 43 | } // namespace ipmiblob |