Fix a complaint about a value return from a void function.
Propagate error codes a bit more. Some code cleanup.
This commit is contained in:
parent
477b616fe8
commit
2fe20e5aaf
1 changed files with 6 additions and 10 deletions
|
@ -1,18 +1,13 @@
|
||||||
|
|
||||||
#define _SYSTEM 1
|
#define _SYSTEM 1
|
||||||
|
|
||||||
#include <minix/com.h>
|
|
||||||
#include <minix/callnr.h>
|
|
||||||
#include <minix/type.h>
|
#include <minix/type.h>
|
||||||
#include <minix/config.h>
|
#include <minix/config.h>
|
||||||
#include <minix/const.h>
|
#include <minix/const.h>
|
||||||
#include <minix/sysutil.h>
|
#include <minix/sysutil.h>
|
||||||
#include <minix/syslib.h>
|
#include <minix/syslib.h>
|
||||||
|
|
||||||
#include <sys/mman.h>
|
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <string.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -134,7 +129,7 @@ PRIVATE void clean_phys_regions(struct vir_region *region,
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
* do_map_memory *
|
* do_map_memory *
|
||||||
*===========================================================================*/
|
*===========================================================================*/
|
||||||
PRIVATE void do_map_memory(struct vmproc *vms, struct vmproc *vmd,
|
PRIVATE int do_map_memory(struct vmproc *vms, struct vmproc *vmd,
|
||||||
struct vir_region *vrs, struct vir_region *vrd,
|
struct vir_region *vrs, struct vir_region *vrd,
|
||||||
vir_bytes offset_s, vir_bytes offset_d,
|
vir_bytes offset_s, vir_bytes offset_d,
|
||||||
vir_bytes length, int flag)
|
vir_bytes length, int flag)
|
||||||
|
@ -215,6 +210,7 @@ PRIVATE void do_map_memory(struct vmproc *vms, struct vmproc *vmd,
|
||||||
offset_d += pb->length;
|
offset_d += pb->length;
|
||||||
offset_s += pb->length;
|
offset_s += pb->length;
|
||||||
}
|
}
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
|
@ -228,10 +224,10 @@ PUBLIC int map_memory(endpoint_t sour, endpoint_t dest,
|
||||||
*/
|
*/
|
||||||
struct vmproc *vms, *vmd;
|
struct vmproc *vms, *vmd;
|
||||||
struct vir_region *vrs, *vrd;
|
struct vir_region *vrs, *vrd;
|
||||||
struct phys_region *prs, *prd;
|
physr_iter iterd;
|
||||||
physr_iter iters, iterd;
|
|
||||||
vir_bytes offset_s, offset_d;
|
vir_bytes offset_s, offset_d;
|
||||||
int p;
|
int p;
|
||||||
|
int r;
|
||||||
|
|
||||||
if(vm_isokendpt(sour, &p) != OK)
|
if(vm_isokendpt(sour, &p) != OK)
|
||||||
vm_panic("handle_memory: endpoint wrong", sour);
|
vm_panic("handle_memory: endpoint wrong", sour);
|
||||||
|
@ -274,13 +270,13 @@ PUBLIC int map_memory(endpoint_t sour, endpoint_t dest,
|
||||||
map_printregion(vmd, vrd);
|
map_printregion(vmd, vrd);
|
||||||
|
|
||||||
/* Map memory. */
|
/* Map memory. */
|
||||||
do_map_memory(vms, vmd, vrs, vrd, offset_s, offset_d, length, flag);
|
r = do_map_memory(vms, vmd, vrs, vrd, offset_s, offset_d, length, flag);
|
||||||
printf("after map (dst) with offset, length: %d, %d\n", offset_d, length);
|
printf("after map (dst) with offset, length: %d, %d\n", offset_d, length);
|
||||||
map_printregion(vmd, vrd);
|
map_printregion(vmd, vrd);
|
||||||
#undef map_printregion
|
#undef map_printregion
|
||||||
#undef printf
|
#undef printf
|
||||||
|
|
||||||
return OK;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
|
|
Loading…
Reference in a new issue