Go to the documentation of this file.
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);
69 __attribute__((warn_unused_result))
71 const void __gas *src,
size_t n);
74 const void __gas *src,
size_t n);
76 __attribute__((warn_unused_result))
77 int gas_read8(
struct switchtec_dev *dev, uint8_t __gas *addr, uint8_t *val);
78 __attribute__((warn_unused_result))
79 int gas_read16(
struct switchtec_dev *dev, uint16_t __gas *addr, uint16_t *val);
80 __attribute__((warn_unused_result))
81 int gas_read32(
struct switchtec_dev *dev, uint32_t __gas *addr, uint32_t *val);
82 __attribute__((warn_unused_result))
83 int gas_read64(
struct switchtec_dev *dev, uint64_t __gas *addr, uint64_t *val);
85 void gas_write8(
struct switchtec_dev *dev, uint8_t val, uint8_t __gas *addr);
86 void gas_write16(
struct switchtec_dev *dev, uint16_t val,
87 uint16_t __gas *addr);
88 void gas_write32(
struct switchtec_dev *dev, uint32_t val,
89 uint32_t __gas *addr);
90 void gas_write64(
struct switchtec_dev *dev, uint64_t val,
91 uint64_t __gas *addr);
void gas_write32(struct switchtec_dev *dev, uint32_t val, uint32_t __gas *addr)
Write a uint32_t to the GAS.
void memcpy_to_gas(struct switchtec_dev *dev, void __gas *dest, const void *src, size_t n)
Copy data to the GAS.
void gas_write8(struct switchtec_dev *dev, uint8_t val, uint8_t __gas *addr)
Write a uint8_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.
void gas_write16(struct switchtec_dev *dev, uint16_t val, uint16_t __gas *addr)
Write a uint16_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.