25 #ifndef LIBSWITCHTEC_GAS_H 26 #define LIBSWITCHTEC_GAS_H 56 #ifdef SWITCHTEC_LIB_CORE 57 #error "You should not be using GAS access functions in the core library." 60 #ifdef SWITCHTEC_LIB_LINUX 61 #error "GAS Access functions should not be used on the Linux platform " \ 62 "as they require full root access." 67 void memcpy_to_gas(
struct switchtec_dev *dev,
void __gas *dest,
68 const void *src,
size_t n);
71 const void __gas *src,
size_t n);
74 const void __gas *src,
size_t n);
76 uint8_t
gas_read8(
struct switchtec_dev *dev, uint8_t __gas *addr);
77 uint16_t
gas_read16(
struct switchtec_dev *dev, uint16_t __gas *addr);
78 uint32_t
gas_read32(
struct switchtec_dev *dev, uint32_t __gas *addr);
79 uint64_t
gas_read64(
struct switchtec_dev *dev, uint64_t __gas *addr);
81 void gas_write8(
struct switchtec_dev *dev, uint8_t val, uint8_t __gas *addr);
82 void gas_write16(
struct switchtec_dev *dev, uint16_t val,
83 uint16_t __gas *addr);
84 void gas_write32(
struct switchtec_dev *dev, uint32_t val,
85 uint32_t __gas *addr);
86 void gas_write64(
struct switchtec_dev *dev, uint64_t val,
87 uint64_t __gas *addr);
uint32_t gas_read32(struct switchtec_dev *dev, uint32_t __gas *addr)
Read a uint32_t from the GAS.
void gas_write32(struct switchtec_dev *dev, uint32_t val, uint32_t __gas *addr)
Write a uint32_t to the GAS.
void gas_write8(struct switchtec_dev *dev, uint8_t val, uint8_t __gas *addr)
Write a uint8_t to the GAS.
uint16_t gas_read16(struct switchtec_dev *dev, uint16_t __gas *addr)
Read a uint16_t from the GAS.
uint64_t gas_read64(struct switchtec_dev *dev, uint64_t __gas *addr)
Read a uint64_t from the GAS.
void memcpy_to_gas(struct switchtec_dev *dev, void __gas *dest, const void *src, size_t n)
Copy data to the GAS.
uint8_t gas_read8(struct switchtec_dev *dev, uint8_t __gas *addr)
Read a uint8_t from the GAS.
void gas_write16(struct switchtec_dev *dev, uint16_t val, uint16_t __gas *addr)
Write a uint16_t to the GAS.
void gas_write64(struct switchtec_dev *dev, uint64_t val, uint64_t __gas *addr)
Write a uint64_t to the GAS.
ssize_t write_from_gas(struct switchtec_dev *dev, int fd, const void __gas *src, size_t n)
Call write() with data from the GAS.
void memcpy_from_gas(struct switchtec_dev *dev, void *dest, const void __gas *src, size_t n)
Copy data from the GAS.