debuggers.hg
changeset 10890:4a669bd50657
[MINI-OS] Add a function mapping grant table error codes to strings.
Signed-off-by: John D. Ramsdell <ramsdell@mitre.org>
Signed-off-by: Steven Smith <sos22@cam.ac.uk>
Signed-off-by: John D. Ramsdell <ramsdell@mitre.org>
Signed-off-by: Steven Smith <sos22@cam.ac.uk>
author | sos22@douglas.cl.cam.ac.uk |
---|---|
date | Fri Jul 28 14:06:27 2006 +0100 (2006-07-28) |
parents | cbfced5fcdb3 |
children | fc0040fd13d8 |
files | extras/mini-os/gnttab.c extras/mini-os/include/gnttab.h |
line diff
1.1 --- a/extras/mini-os/gnttab.c Fri Jul 28 14:05:02 2006 +0100 1.2 +++ b/extras/mini-os/gnttab.c Fri Jul 28 14:06:27 2006 +0100 1.3 @@ -137,6 +137,18 @@ gnttab_alloc_and_grant(void **map) 1.4 return gref; 1.5 } 1.6 1.7 +static const char *gnttabop_error_msgs[] = GNTTABOP_error_msgs; 1.8 + 1.9 +const char * 1.10 +gnttabop_error(int16_t status) 1.11 +{ 1.12 + status = -status; 1.13 + if (status < 0 || status >= ARRAY_SIZE(gnttabop_error_msgs)) 1.14 + return "bad status"; 1.15 + else 1.16 + return gnttabop_error_msgs[status]; 1.17 +} 1.18 + 1.19 void 1.20 init_gnttab(void) 1.21 {
2.1 --- a/extras/mini-os/include/gnttab.h Fri Jul 28 14:05:02 2006 +0100 2.2 +++ b/extras/mini-os/include/gnttab.h Fri Jul 28 14:06:27 2006 +0100 2.3 @@ -10,5 +10,6 @@ grant_ref_t gnttab_grant_access(domid_t 2.4 grant_ref_t gnttab_grant_transfer(domid_t domid, unsigned long pfn); 2.5 unsigned long gnttab_end_transfer(grant_ref_t gref); 2.6 int gnttab_end_access(grant_ref_t ref); 2.7 +const char *gnttabop_error(int16_t status); 2.8 2.9 #endif /* !__GNTTAB_H__ */