#ifndef __GRUHANDLES_H__
#define __GRUHANDLES_H__
#include "gru_instructions.h"
#define GRU_GSEG0_BASE …
#define GRU_MCS_BASE …
#define GRU_SIZE …
#define GRU_NUM_CB …
#define GRU_NUM_DSR_BYTES …
#define GRU_NUM_TFM …
#define GRU_NUM_TGH …
#define GRU_NUM_CBE …
#define GRU_NUM_TFH …
#define GRU_NUM_CCH …
#define GRU_NUM_USER_CBR …
#define GRU_NUM_USER_DSR_BYTES …
#define GRU_HANDLE_BYTES …
#define GRU_HANDLE_STRIDE …
#define GRU_TFM_BASE …
#define GRU_TGH_BASE …
#define GRU_CBE_BASE …
#define GRU_TFH_BASE …
#define GRU_CCH_BASE …
#define GRU_GSEG_STRIDE …
#define GSEG_BASE(a) …
#define GRU_DSR_AU_BYTES …
#define GRU_DSR_CL …
#define GRU_DSR_AU_CL …
#define GRU_DSR_AU …
#define GRU_CBR_AU_SIZE …
#define GRU_CBR_AU …
#define GRU_DS_BYTES_TO_AU(n) …
#define GRU_CB_COUNT_TO_AU(n) …
#define GRU_CHIPLETS_PER_HUB …
#define GRU_HUBS_PER_BLADE …
#define GRU_CHIPLETS_PER_BLADE …
#define GRU_CB_BASE …
#define GRU_CB_LIMIT …
#define GRU_DS_BASE …
#define GRU_DS_LIMIT …
#define GSEGPOFF(h) …
#define GRUBASE(h) …
#define TYPE_IS(hn, h) …
static inline void *get_gseg_base_address(void *base, int ctxnum)
{ … }
static inline void *get_gseg_base_address_cb(void *base, int ctxnum, int line)
{ … }
static inline void *get_gseg_base_address_ds(void *base, int ctxnum, int line)
{ … }
static inline struct gru_tlb_fault_map *get_tfm(void *base, int ctxnum)
{ … }
static inline struct gru_tlb_global_handle *get_tgh(void *base, int ctxnum)
{ … }
static inline struct gru_control_block_extended *get_cbe(void *base, int ctxnum)
{ … }
static inline struct gru_tlb_fault_handle *get_tfh(void *base, int ctxnum)
{ … }
static inline struct gru_context_configuration_handle *get_cch(void *base,
int ctxnum)
{ … }
static inline unsigned long get_cb_number(void *cb)
{ … }
static inline unsigned long gru_chiplet_paddr(unsigned long paddr, int pnode,
int chiplet)
{ … }
static inline void *gru_chiplet_vaddr(void *vaddr, int pnode, int chiplet)
{ … }
static inline struct gru_control_block_extended *gru_tfh_to_cbe(
struct gru_tlb_fault_handle *tfh)
{ … }
struct gru_tlb_fault_map { … };
struct gru_tlb_global_handle { … };
enum gru_tgh_cmd { … };
enum gru_tgh_opc { … };
enum gru_tgh_status { … };
enum gru_tgh_state { … };
enum gru_tgh_cause { … };
struct gru_tlb_fault_handle { … };
enum gru_tfh_opc { … };
enum tfh_status { … };
enum tfh_state { … };
enum tfh_cause { … };
#define GAA_RAM …
#define GAA_NCRAM …
#define GAA_MMIO …
#define GAA_REGISTER …
#define GRU_PADDR_SHIFT …
struct gru_context_configuration_handle { … } __attribute__ ((packed));
enum gru_cch_opc { … };
enum gru_cch_status { … };
enum gru_cch_state { … };
enum gru_cch_cause { … };
struct gru_control_block_extended { … };
#define cbe_baddr0 …
#define cbe_baddr1 …
#define cbe_src_cl …
#define cbe_nelemcur …
enum gru_cbr_state { … };
#define GRU_PAGESIZE(sh) …
#define GRU_SIZEAVAIL(sh) …
#define GRUMAXINVAL …
int cch_allocate(struct gru_context_configuration_handle *cch);
int cch_start(struct gru_context_configuration_handle *cch);
int cch_interrupt(struct gru_context_configuration_handle *cch);
int cch_deallocate(struct gru_context_configuration_handle *cch);
int cch_interrupt_sync(struct gru_context_configuration_handle *cch);
int tgh_invalidate(struct gru_tlb_global_handle *tgh, unsigned long vaddr,
unsigned long vaddrmask, int asid, int pagesize, int global, int n,
unsigned short ctxbitmap);
int tfh_write_only(struct gru_tlb_fault_handle *tfh, unsigned long paddr,
int gaa, unsigned long vaddr, int asid, int dirty, int pagesize);
void tfh_write_restart(struct gru_tlb_fault_handle *tfh, unsigned long paddr,
int gaa, unsigned long vaddr, int asid, int dirty, int pagesize);
void tfh_user_polling_mode(struct gru_tlb_fault_handle *tfh);
void tfh_exception(struct gru_tlb_fault_handle *tfh);
#endif