diff --git a/include/linux/haven/hh_dbl.h b/include/linux/haven/hh_dbl.h index 1050126648e3..3c092bdea129 100644 --- a/include/linux/haven/hh_dbl.h +++ b/include/linux/haven/hh_dbl.h @@ -19,6 +19,7 @@ enum hh_dbl_label { HH_DBL_LABEL_MAX }; +#if IS_ENABLED(CONFIG_HH_DBL) void *hh_dbl_tx_register(enum hh_dbl_label label); void *hh_dbl_rx_register(enum hh_dbl_label label, dbl_rx_cb_t rx_cb, void *priv); @@ -33,5 +34,56 @@ int hh_dbl_read_and_clean(void *dbl_client_desc, hh_dbl_flags_t *clear_flags); int hh_dbl_reset(void *dbl_client_desc); int hh_dbl_populate_cap_info(enum hh_dbl_label label, u64 cap_id, int direction, int rx_irq); +#else +static inline void *hh_dbl_tx_register(enum hh_dbl_label label) +{ + return ERR_PTR(-ENODEV); +} +static inline void *hh_dbl_rx_register(enum hh_dbl_label label, + dbl_rx_cb_t rx_cb, + void *priv) +{ + return ERR_PTR(-ENODEV); +} + +static inline int hh_dbl_tx_unregister(void *dbl_client_desc) +{ + return ERR_PTR(-ENODEV); +} + +static inline int hh_dbl_rx_unregister(void *dbl_client_desc) +{ + return ERR_PTR(-ENODEV); +} + +static inline int hh_dbl_send(void *dbl_client_desc, uint64_t *newflags) +{ + return -EINVAL; +} + +static inline int hh_dbl_set_mask(void *dbl_client_desc, + hh_dbl_flags_t enable_mask, + hh_dbl_flags_t ack_mask) +{ + return -EINVAL; +} + +static inline int hh_dbl_read_and_clean(void *dbl_client_desc, + hh_dbl_flags_t *clear_flags) +{ + return -EINVAL; +} + +static inline int hh_dbl_reset(void *dbl_client_desc) +{ + return -EINVAL; +} + +static inline int hh_dbl_populate_cap_info(enum hh_dbl_label label, u64 cap_id, + int direction, int rx_irq) +{ + return -EINVAL; +} +#endif #endif diff --git a/include/linux/haven/hh_msgq.h b/include/linux/haven/hh_msgq.h index 59bacd7decc3..16f8c8daa3ef 100644 --- a/include/linux/haven/hh_msgq.h +++ b/include/linux/haven/hh_msgq.h @@ -26,6 +26,7 @@ enum hh_msgq_label { #define HH_MSGQ_TX_PUSH BIT(0) #define HH_MSGQ_NONBLOCK BIT(32) +#if IS_ENABLED(CONFIG_HH_MSGQ) void *hh_msgq_register(enum hh_msgq_label label); int hh_msgq_unregister(void *msgq_client_desc); int hh_msgq_send(void *msgq_client_desc, @@ -36,4 +37,36 @@ int hh_msgq_recv(void *msgq_client_desc, int hh_msgq_populate_cap_info(enum hh_msgq_label label, u64 cap_id, int direction, int irq); +#else +static inline void *hh_msgq_register(enum hh_msgq_label label) +{ + return ERR_PTR(-ENODEV); +} + +static inline int hh_msgq_unregister(void *msgq_client_desc) +{ + return ERR_PTR(-ENODEV); +} + +static inline int hh_msgq_send(void *msgq_client_desc, + void *buff, size_t size, unsigned long flags) +{ + return -EINVAL; +} + +static inline int hh_msgq_recv(void *msgq_client_desc, + void *buff, size_t buff_size, + size_t *recv_size, unsigned long flags) +{ + return -EINVAL; +} + +static inline int hh_msgq_populate_cap_info(enum hh_msgq_label label, + u64 cap_id, + int direction, + int irq) +{ + return -EINVAL; +} +#endif #endif diff --git a/include/linux/haven/hh_rm_drv.h b/include/linux/haven/hh_rm_drv.h index 5a8ed91212e7..37386ca41ed2 100644 --- a/include/linux/haven/hh_rm_drv.h +++ b/include/linux/haven/hh_rm_drv.h @@ -172,8 +172,8 @@ struct hh_rm_notif_vm_console_chars { struct notifier_block; -/* End Notification type APIs */ - +#if IS_ENABLED(CONFIG_HH_RM_DRV) +/* RM client registration APIs */ int hh_rm_register_notifier(struct notifier_block *nb); int hh_rm_unregister_notifier(struct notifier_block *nb); @@ -218,5 +218,133 @@ int hh_rm_mem_lend(u8 mem_type, u8 flags, hh_label_t label, hh_memparcel_handle_t *handle); int hh_rm_mem_notify(hh_memparcel_handle_t handle, u8 flags, struct hh_notify_vmid_desc *vmid_desc); +#else +/* RM client register notifications APIs */ +static inline int hh_rm_register_notifier(struct notifier_block *nb) +{ + return -ENODEV; +} +static inline int hh_rm_unregister_notifier(struct notifier_block *nb) +{ + return -ENODEV; +} + +/* Client APIs for IRQ management */ +static inline int hh_rm_vm_irq_accept(hh_virq_handle_t virq_handle, int virq) +{ + return -EINVAL; +} + +static inline int hh_rm_vm_irq_lend_notify(hh_vmid_t vmid, int virq, int label) +{ + return -EINVAL; +} + +static inline int hh_rm_vm_irq_release_notify(hh_vmid_t vmid, + hh_virq_handle_t virq_handle) +{ + return -EINVAL; +} + +static inline int hh_rm_vm_irq_reclaim(hh_virq_handle_t virq_handle) +{ + return -EINVAL; +} + +/* Client APIs for VM management */ +static inline int hh_rm_vm_alloc_vmid(enum hh_vm_names vm_name) +{ + return -EINVAL; +} + +static inline int hh_rm_get_vmid(enum hh_vm_names vm_name, hh_vmid_t *vmid) +{ + return -EINVAL; +} + +static inline int hh_rm_get_vm_name(hh_vmid_t vmid, enum hh_vm_names *vm_name) +{ + return -EINVAL; +} + +static inline int hh_rm_vm_start(int vmid) +{ + return -EINVAL; +} + +/* Client APIs for VM Services */ +static inline int hh_rm_console_open(hh_vmid_t vmid) +{ + return -EINVAL; +} + +static inline int hh_rm_console_close(hh_vmid_t vmid) +{ + return -EINVAL; +} + +static inline int hh_rm_console_write(hh_vmid_t vmid, const char *buf, + size_t size) +{ + return -EINVAL; +} + +static inline int hh_rm_console_flush(hh_vmid_t vmid) +{ + return -EINVAL; +} + +static inline int hh_rm_mem_qcom_lookup_sgl(u8 mem_type, hh_label_t label, + struct hh_acl_desc *acl_desc, + struct hh_sgl_desc *sgl_desc, + struct hh_mem_attr_desc *mem_attr_desc, + hh_memparcel_handle_t *handle) +{ + return -EINVAL; +} + +static inline int hh_rm_mem_release(hh_memparcel_handle_t handle, u8 flags) +{ + return -EINVAL; +} + +static inline int hh_rm_mem_reclaim(hh_memparcel_handle_t handle, u8 flags) +{ + return -EINVAL; +} + +static inline struct hh_sgl_desc *hh_rm_mem_accept(hh_memparcel_handle_t handle, + u8 mem_type, + u8 trans_type, u8 flags, hh_label_t label, + struct hh_acl_desc *acl_desc, + struct hh_sgl_desc *sgl_desc, + struct hh_mem_attr_desc *mem_attr_desc, + u16 map_vmid) +{ + return ERR_PTR(-EINVAL); +} + +static inline int hh_rm_mem_share(u8 mem_type, u8 flags, hh_label_t label, + struct hh_acl_desc *acl_desc, struct hh_sgl_desc *sgl_desc, + struct hh_mem_attr_desc *mem_attr_desc, + hh_memparcel_handle_t *handle) +{ + return -EINVAL; +} + +static inline int hh_rm_mem_lend(u8 mem_type, u8 flags, hh_label_t label, + struct hh_acl_desc *acl_desc, struct hh_sgl_desc *sgl_desc, + struct hh_mem_attr_desc *mem_attr_desc, + hh_memparcel_handle_t *handle) +{ + return -EINVAL; +} + +static inline int hh_rm_mem_notify(hh_memparcel_handle_t handle, u8 flags, + struct hh_notify_vmid_desc *vmid_desc) +{ + return -EINVAL; +} +#endif #endif