1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 129 unchanged lines hidden (view full) --- 138} 139 140static ssize_t 141rf_aread(mdb_tgt_t *t, mdb_tgt_as_t as, void *buf, 142 size_t len, mdb_tgt_addr_t addr) 143{ 144 switch ((uintptr_t)as) { 145 case (uintptr_t)MDB_TGT_AS_VIRT: |
146 case (uintptr_t)MDB_TGT_AS_VIRT_I: 147 case (uintptr_t)MDB_TGT_AS_VIRT_S: |
148 case (uintptr_t)MDB_TGT_AS_PHYS: 149 if (RF_CORE(t->t_data) != NULL) 150 return (rf_read(RF_CORE(t->t_data), buf, len, addr)); 151 /*FALLTHRU*/ 152 case (uintptr_t)MDB_TGT_AS_FILE: 153 return (rf_read(RF_OBJECT(t->t_data), buf, len, addr)); 154 default: 155 return (set_errno(EMDB_NOMAP)); 156 } 157} 158 159static ssize_t 160rf_awrite(mdb_tgt_t *t, mdb_tgt_as_t as, const void *buf, 161 size_t len, mdb_tgt_addr_t addr) 162{ 163 switch ((uintptr_t)as) { 164 case (uintptr_t)MDB_TGT_AS_VIRT: |
165 case (uintptr_t)MDB_TGT_AS_VIRT_I: 166 case (uintptr_t)MDB_TGT_AS_VIRT_S: |
167 case (uintptr_t)MDB_TGT_AS_PHYS: 168 if (RF_CORE(t->t_data) != NULL) 169 return (rf_write(RF_CORE(t->t_data), buf, len, addr)); 170 /*FALLTHRU*/ 171 case (uintptr_t)MDB_TGT_AS_FILE: 172 return (rf_write(RF_OBJECT(t->t_data), buf, len, addr)); 173 default: 174 return (set_errno(EMDB_NOMAP)); --- 284 unchanged lines hidden --- |