Changeset 443695e in mainline for uspace/lib
- Timestamp:
- 2024-05-21T11:33:56Z (18 months ago)
- Branches:
- master
- Children:
- 3526f4f3
- Parents:
- 1801005
- git-author:
- Jiri Svoboda <jiri@…> (2024-05-20 17:33:43)
- git-committer:
- Jiri Svoboda <jiri@…> (2024-05-21 11:33:56)
- Location:
- uspace/lib
- Files:
-
- 4 edited
-
c/generic/device/hw_res.c (modified) (2 diffs)
-
c/include/device/hw_res.h (modified) (4 diffs)
-
drv/generic/remote_hw_res.c (modified) (4 diffs)
-
drv/include/ops/hw_res.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/device/hw_res.c
r1801005 r443695e 1 1 /* 2 * Copyright (c) 2024 Jiri Svoboda 2 3 * Copyright (c) 2010 Lenka Trochtova 3 4 * All rights reserved. … … 161 162 } 162 163 164 /** Get bus flags. 165 * 166 * @param sess HW res session 167 * @param rflags Place to store the flags 168 * 169 * @return Error code. 170 * 171 */ 172 errno_t hw_res_get_flags(async_sess_t *sess, hw_res_flags_t *rflags) 173 { 174 async_exch_t *exch = async_exchange_begin(sess); 175 176 sysarg_t flags; 177 const errno_t ret = async_req_1_1(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE), 178 HW_RES_GET_FLAGS, &flags); 179 180 async_exchange_end(exch); 181 182 if (ret == EOK) 183 *rflags = flags; 184 185 return ret; 186 } 187 163 188 /** @} 164 189 */ -
uspace/lib/c/include/device/hw_res.h
r1801005 r443695e 1 1 /* 2 * Copyright (c) 2024 Jiri Svoboda 2 3 * Copyright (c) 2010 Lenka Trochtova 3 4 * All rights reserved. … … 56 57 HW_RES_DMA_CHANNEL_SETUP, 57 58 HW_RES_DMA_CHANNEL_REMAIN, 59 HW_RES_GET_FLAGS 58 60 } hw_res_method_t; 59 61 … … 116 118 } 117 119 120 typedef enum { 121 /** This is an PCI/ISA bridge, not 'classic' ISA bus */ 122 hwf_isa_bridge = 0x1 123 } hw_res_flags_t; 124 118 125 extern errno_t hw_res_get_resource_list(async_sess_t *, hw_resource_list_t *); 119 126 extern errno_t hw_res_enable_interrupt(async_sess_t *, int); … … 124 131 uint32_t, uint8_t); 125 132 extern errno_t hw_res_dma_channel_remain(async_sess_t *, unsigned, size_t *); 133 extern errno_t hw_res_get_flags(async_sess_t *, hw_res_flags_t *); 126 134 127 135 #endif -
uspace/lib/drv/generic/remote_hw_res.c
r1801005 r443695e 1 1 /* 2 * Copyright (c) 2024 Jiri Svoboda 2 3 * Copyright (c) 2010 Lenka Trochtova 3 4 * Copyright (c) 2011 Jan Vesely … … 47 48 static void remote_hw_res_dma_channel_setup(ddf_fun_t *, void *, ipc_call_t *); 48 49 static void remote_hw_res_dma_channel_remain(ddf_fun_t *, void *, ipc_call_t *); 50 static void remote_hw_res_get_flags(ddf_fun_t *, void *, ipc_call_t *); 49 51 50 52 static const remote_iface_func_ptr_t remote_hw_res_iface_ops [] = { … … 55 57 [HW_RES_DMA_CHANNEL_SETUP] = &remote_hw_res_dma_channel_setup, 56 58 [HW_RES_DMA_CHANNEL_REMAIN] = &remote_hw_res_dma_channel_remain, 59 [HW_RES_GET_FLAGS] = &remote_hw_res_get_flags 57 60 }; 58 61 … … 171 174 } 172 175 176 static void remote_hw_res_get_flags(ddf_fun_t *fun, void *ops, 177 ipc_call_t *call) 178 { 179 hw_res_ops_t *hw_res_ops = ops; 180 181 if (hw_res_ops->get_flags == NULL) { 182 async_answer_0(call, ENOTSUP); 183 return; 184 } 185 186 hw_res_flags_t flags = 0; 187 const errno_t ret = hw_res_ops->get_flags(fun, &flags); 188 async_answer_1(call, ret, flags); 189 } 190 173 191 /** 174 192 * @} -
uspace/lib/drv/include/ops/hw_res.h
r1801005 r443695e 1 1 /* 2 * Copyright (c) 2024 Jiri Svoboda 2 3 * Copyright (c) 2010 Lenka Trochtova 3 4 * Copyright (c) 2011 Jan Vesely … … 49 50 errno_t (*dma_channel_setup)(ddf_fun_t *, unsigned, uint32_t, uint32_t, uint8_t); 50 51 errno_t (*dma_channel_remain)(ddf_fun_t *, unsigned, size_t *); 52 errno_t (*get_flags)(ddf_fun_t *, hw_res_flags_t *); 51 53 } hw_res_ops_t; 52 54
Note:
See TracChangeset
for help on using the changeset viewer.
