5
Last change
on this file since 7075fb11 was
ede1a41,
checked in by Sebastian Huber <sebastian.huber@…>, on 06/21/16 at 11:12:31
|
Make rtems/print.h independent of rtems/bspIo.h
|
-
Property mode set to
100644
|
File size:
956 bytes
|
Rev | Line | |
---|
[e7fade3] | 1 | /* Driver Manager Driver Translate Interface Implementation |
---|
| 2 | * |
---|
[65d1f35] | 3 | * COPYRIGHT (c) 2010 Cobham Gaisler AB. |
---|
[e7fade3] | 4 | * |
---|
| 5 | * The license and distribution terms for this file may be |
---|
| 6 | * found in the file LICENSE in this distribution or at |
---|
[0decc806] | 7 | * http://www.rtems.org/license/LICENSE. |
---|
[e7fade3] | 8 | */ |
---|
| 9 | |
---|
| 10 | #include <drvmgr/drvmgr.h> |
---|
| 11 | |
---|
[ede1a41] | 12 | #include <rtems/bspIo.h> |
---|
| 13 | |
---|
[e7fade3] | 14 | /* Calls drvmgr_translate() to translate an address range and check the result, |
---|
| 15 | * a printout is generated if the check fails. See paramters of |
---|
| 16 | * drvmgr_translate(). |
---|
| 17 | * If size=0 only the starting address is not checked. |
---|
| 18 | */ |
---|
| 19 | int drvmgr_translate_check( |
---|
| 20 | struct drvmgr_dev *dev, |
---|
| 21 | unsigned int options, |
---|
| 22 | void *src_address, |
---|
| 23 | void **dst_address, |
---|
| 24 | unsigned int size) |
---|
| 25 | { |
---|
| 26 | unsigned int max; |
---|
| 27 | |
---|
| 28 | max = drvmgr_translate(dev, options, src_address, dst_address); |
---|
| 29 | if (max == 0 || (max < size && (size != 0))) { |
---|
| 30 | printk(" ### dev %p (%s) failed mapping %p\n", |
---|
| 31 | dev, dev->name ? dev->name : "unnamed", src_address); |
---|
| 32 | return -1; |
---|
| 33 | } |
---|
| 34 | |
---|
| 35 | return 0; |
---|
| 36 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.