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."
67void 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))
77int gas_read8(
struct switchtec_dev *dev, uint8_t __gas *addr, uint8_t *val);
78__attribute__((warn_unused_result))
79int gas_read16(
struct switchtec_dev *dev, uint16_t __gas *addr, uint16_t *val);
80__attribute__((warn_unused_result))
81int gas_read32(
struct switchtec_dev *dev, uint32_t __gas *addr, uint32_t *val);
82__attribute__((warn_unused_result))
83int gas_read64(
struct switchtec_dev *dev, uint64_t __gas *addr, uint64_t *val);
85void gas_write8(
struct switchtec_dev *dev, uint8_t val, uint8_t __gas *addr);
86void gas_write16(
struct switchtec_dev *dev, uint16_t val,
87 uint16_t __gas *addr);
88void gas_write32(
struct switchtec_dev *dev, uint32_t val,
89 uint32_t __gas *addr);
90void gas_write64(
struct switchtec_dev *dev, uint64_t val,
91 uint64_t __gas *addr);
void memcpy_to_gas(struct switchtec_dev *dev, void __gas *dest, const void *src, size_t n)
Copy data 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 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.
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.