Changeset 2b11c3c in mainline
- Timestamp:
- 2017-10-31T19:17:10Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f834dd81
- Parents:
- 48adf0f
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r48adf0f r2b11c3c 1 #1 x# 2 2 # Copyright (c) 2006 Martin Decky 3 3 # All rights reserved. -
uspace/drv/intctl/obio/obio.c
r48adf0f r2b11c3c 68 68 #define INO_MASK 0x1f 69 69 70 static uintptr_t base_phys;71 static volatile uint64_t *base_virt = (volatile uint64_t *) AS_AREA_ANY;72 73 70 /** Handle one connection to obio. 74 71 * … … 81 78 ipc_callid_t callid; 82 79 ipc_call_t call; 80 obio_t *obio; 83 81 84 82 /* … … 86 84 */ 87 85 async_answer_0(iid, EOK); 86 87 obio = (obio_t *)ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *)arg)); 88 88 89 89 while (1) { … … 94 94 case IRC_ENABLE_INTERRUPT: 95 95 inr = IPC_GET_ARG1(call); 96 base_virt[OBIO_IMR(inr & INO_MASK)] |= (1UL << 31);96 ((volatile uint64_t *)(obio->regs))[OBIO_IMR(inr & INO_MASK)] |= (1UL << 31); 97 97 async_answer_0(callid, EOK); 98 98 break; … … 103 103 case IRC_CLEAR_INTERRUPT: 104 104 inr = IPC_GET_ARG1(call); 105 base_virt[OBIO_CIR(inr & INO_MASK)] = 0;105 ((volatile uint64_t *)(obio->regs))[OBIO_CIR(inr & INO_MASK)] = 0; 106 106 async_answer_0(callid, EOK); 107 107 break; … … 117 117 { 118 118 ddf_fun_t *fun_a = NULL; 119 int flags; 120 int retval; 119 121 int rc; 120 122 121 int flags = AS_AREA_READ | AS_AREA_WRITE; 122 int retval = physmem_map(res->base, 123 flags = AS_AREA_READ | AS_AREA_WRITE; 124 obio->regs = (volatile uint64_t *)AS_AREA_ANY; 125 retval = physmem_map(res->base, 123 126 ALIGN_UP(OBIO_SIZE, PAGE_SIZE) >> PAGE_WIDTH, flags, 124 (void *) & base_virt);127 (void *) &obio->regs); 125 128 126 129 if (retval < 0) { … … 130 133 } 131 134 132 ddf_msg(LVL_NOTE, "OBIO registers with base at 0x%" PRIun, base_phys);135 ddf_msg(LVL_NOTE, "OBIO registers with base at 0x%" PRIun, res->base); 133 136 134 137 fun_a = ddf_fun_create(obio->dev, fun_exposed, "a"); -
uspace/drv/intctl/obio/obio.h
r48adf0f r2b11c3c 47 47 /** OBIO */ 48 48 typedef struct { 49 ioport32_t *regs;49 volatile uint64_t *regs; 50 50 uintptr_t phys_base; 51 51 ddf_dev_t *dev;
Note:
See TracChangeset
for help on using the changeset viewer.