mdb_rawfile.c (2c687d68) mdb_rawfile.c (9c3024a3)
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:
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:
146 case (uintptr_t)MDB_TGT_AS_PHYS:
147 if (RF_CORE(t->t_data) != NULL)
148 return (rf_read(RF_CORE(t->t_data), buf, len, addr));
149 /*FALLTHRU*/
150 case (uintptr_t)MDB_TGT_AS_FILE:
151 return (rf_read(RF_OBJECT(t->t_data), buf, len, addr));
152 default:
153 return (set_errno(EMDB_NOMAP));
154 }
155}
156
157static ssize_t
158rf_awrite(mdb_tgt_t *t, mdb_tgt_as_t as, const void *buf,
159 size_t len, mdb_tgt_addr_t addr)
160{
161 switch ((uintptr_t)as) {
162 case (uintptr_t)MDB_TGT_AS_VIRT:
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:
163 case (uintptr_t)MDB_TGT_AS_PHYS:
164 if (RF_CORE(t->t_data) != NULL)
165 return (rf_write(RF_CORE(t->t_data), buf, len, addr));
166 /*FALLTHRU*/
167 case (uintptr_t)MDB_TGT_AS_FILE:
168 return (rf_write(RF_OBJECT(t->t_data), buf, len, addr));
169 default:
170 return (set_errno(EMDB_NOMAP));

--- 284 unchanged lines hidden ---
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 ---