Lines Matching +full:port +full:- +full:base

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
38 HPT_U8 os_inb (void *port) { return inb((unsigned)(HPT_UPTR)port); } in os_inb() argument
39 HPT_U16 os_inw (void *port) { return inw((unsigned)(HPT_UPTR)port); } in os_inw() argument
40 HPT_U32 os_inl (void *port) { return inl((unsigned)(HPT_UPTR)port); } in os_inl() argument
42 void os_outb (void *port, HPT_U8 value) { outb((unsigned)(HPT_UPTR)port, (value)); } in os_outb() argument
43 void os_outw (void *port, HPT_U16 value) { outw((unsigned)(HPT_UPTR)port, (value)); } in os_outw() argument
44 void os_outl (void *port, HPT_U32 value) { outl((unsigned)(HPT_UPTR)port, (value)); } in os_outl() argument
46 void os_insw (void *port, HPT_U16 *buffer, HPT_U32 count) in os_insw() argument
47 { insw((unsigned)(HPT_UPTR)port, (void *)buffer, count); } in os_insw()
49 void os_outsw(void *port, HPT_U16 *buffer, HPT_U32 count) in os_outsw() argument
50 { outsw((unsigned)(HPT_UPTR)port, (void *)buffer, count); } in os_outsw()
57 return pci_read_config(((PHBA)osext)->pcidev, offset, 1); in os_pci_readb()
62 return pci_read_config(((PHBA)osext)->pcidev, offset, 2); in os_pci_readw()
67 return pci_read_config(((PHBA)osext)->pcidev, offset, 4); in os_pci_readl()
72 pci_write_config(((PHBA)osext)->pcidev, offset, value, 1); in os_pci_writeb()
77 pci_write_config(((PHBA)osext)->pcidev, offset, value, 2); in os_pci_writew()
82 pci_write_config(((PHBA)osext)->pcidev, offset, value, 4); in os_pci_writel()
94 hba->pcibar[index].rid = 0x10 + index * 4; in os_map_pci_bar()
96 if (pci_read_config(hba->pcidev, hba->pcibar[index].rid, 4) & 1) in os_map_pci_bar()
97 hba->pcibar[index].type = SYS_RES_IOPORT; in os_map_pci_bar()
99 hba->pcibar[index].type = SYS_RES_MEMORY; in os_map_pci_bar()
101 hba->pcibar[index].res = bus_alloc_resource_any(hba->pcidev, in os_map_pci_bar()
102 hba->pcibar[index].type, &hba->pcibar[index].rid, RF_ACTIVE); in os_map_pci_bar()
104 hba->pcibar[index].base = (char *)rman_get_virtual(hba->pcibar[index].res) + offset; in os_map_pci_bar()
105 return hba->pcibar[index].base; in os_map_pci_bar()
108 void os_unmap_pci_bar(void *osext, void *base) in os_unmap_pci_bar() argument
114 if (hba->pcibar[index].base==base) { in os_unmap_pci_bar()
115 bus_release_resource(hba->pcidev, hba->pcibar[index].type, in os_unmap_pci_bar()
116 hba->pcibar[index].rid, hba->pcibar[index].res); in os_unmap_pci_bar()
117 hba->pcibar[index].base = 0; in os_unmap_pci_bar()
127 if (vbus_ext->ext_type!=EXT_TYPE_VBUS) in freelist_reserve()
128 vbus_ext = ((PHBA)osext)->vbus_ext; in freelist_reserve()
130 list->next = vbus_ext->freelist_head; in freelist_reserve()
131 vbus_ext->freelist_head = list; in freelist_reserve()
132 list->dma = 0; in freelist_reserve()
133 list->size = size; in freelist_reserve()
134 list->head = 0; in freelist_reserve()
136 list->reserved_count = in freelist_reserve()
138 list->count = count; in freelist_reserve()
144 if (list->count) { in freelist_get()
145 HPT_ASSERT(list->head); in freelist_get()
146 result = list->head; in freelist_get()
147 list->head = *(void **)result; in freelist_get()
148 list->count--; in freelist_get()
156 HPT_ASSERT(list->dma==0); in freelist_put()
157 list->count++; in freelist_put()
158 *(void **)p = list->head; in freelist_put()
159 list->head = p; in freelist_put()
166 if (vbus_ext->ext_type!=EXT_TYPE_VBUS) in freelist_reserve_dma()
167 vbus_ext = ((PHBA)osext)->vbus_ext; in freelist_reserve_dma()
169 list->next = vbus_ext->freelist_dma_head; in freelist_reserve_dma()
170 vbus_ext->freelist_dma_head = list; in freelist_reserve_dma()
171 list->dma = 1; in freelist_reserve_dma()
172 list->alignment = alignment; in freelist_reserve_dma()
173 list->size = size; in freelist_reserve_dma()
174 list->head = 0; in freelist_reserve_dma()
176 list->reserved_count = in freelist_reserve_dma()
178 list->count = count; in freelist_reserve_dma()
184 HPT_ASSERT(list->dma); in freelist_get_dma()
193 HPT_ASSERT(list->dma); in freelist_put_dma()
194 list->count++; in freelist_put_dma()
195 *(void **)p = list->head; in freelist_put_dma()
197 list->head = p; in freelist_put_dma()
215 ldm_on_timer((PVBUS)vbus_ext->vbus); in os_timer_for_ldm()
222 HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS); in os_request_timer()
224 callout_reset_sbt(&vbus_ext->timer, SBT_1US * interval, 0, in os_request_timer()
237 HPT_ASSERT(task->next==0); in os_schedule_task()
239 if (vbus_ext->tasks==0) in os_schedule_task()
240 vbus_ext->tasks = task; in os_schedule_task()
242 OSM_TASK *t = vbus_ext->tasks; in os_schedule_task()
243 while (t->next) t = t->next; in os_schedule_task()
244 t->next = task; in os_schedule_task()
247 if (vbus_ext->worker.ta_context) in os_schedule_task()
248 TASK_ENQUEUE(&vbus_ext->worker); in os_schedule_task()
264 return ((PVBUS_EXT)osext)->sim->path_id; in os_get_vbus_seq()