[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] mini-os: added arch_init_gnttab
commit d477221d40f0a0b318300bf225655332861cc0c5 Author: Karim Raslan <karim.allah.ahmed@xxxxxxxxx> AuthorDate: Thu Jun 26 12:28:25 2014 +0100 Commit: Ian Campbell <ian.campbell@xxxxxxxxxx> CommitDate: Fri Jun 27 13:38:34 2014 +0100 mini-os: added arch_init_gnttab Moves some x86-specific code into arch/x86. Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@xxxxxxxxx> [talex5@xxxxxxxxx: split into multiple patches] Signed-off-by: Thomas Leonard <talex5@xxxxxxxxx> Acked-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx> --- extras/mini-os/arch/x86/mm.c | 13 +++++++++++++ extras/mini-os/gnttab.c | 9 +-------- extras/mini-os/include/gnttab.h | 1 + 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/extras/mini-os/arch/x86/mm.c b/extras/mini-os/arch/x86/mm.c index 35df15b..9c6d1b8 100644 --- a/extras/mini-os/arch/x86/mm.c +++ b/extras/mini-os/arch/x86/mm.c @@ -942,3 +942,16 @@ void arch_init_mm(unsigned long* start_pfn_p, unsigned long* max_pfn_p) *start_pfn_p = start_pfn; *max_pfn_p = max_pfn; } + +grant_entry_t *arch_init_gnttab(int nr_grant_frames) +{ + struct gnttab_setup_table setup; + unsigned long frames[nr_grant_frames]; + + setup.dom = DOMID_SELF; + setup.nr_frames = nr_grant_frames; + set_xen_guest_handle(setup.frame_list, frames); + + HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1); + return map_frames(frames, nr_grant_frames); +} diff --git a/extras/mini-os/gnttab.c b/extras/mini-os/gnttab.c index 6f25006..f395d12 100644 --- a/extras/mini-os/gnttab.c +++ b/extras/mini-os/gnttab.c @@ -172,8 +172,6 @@ gnttabop_error(int16_t status) void init_gnttab(void) { - struct gnttab_setup_table setup; - unsigned long frames[NR_GRANT_FRAMES]; int i; #ifdef GNT_DEBUG @@ -182,12 +180,7 @@ init_gnttab(void) for (i = NR_RESERVED_ENTRIES; i < NR_GRANT_ENTRIES; i++) put_free_entry(i); - setup.dom = DOMID_SELF; - setup.nr_frames = NR_GRANT_FRAMES; - set_xen_guest_handle(setup.frame_list, frames); - - HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1); - gnttab_table = map_frames(frames, NR_GRANT_FRAMES); + gnttab_table = arch_init_gnttab(NR_GRANT_FRAMES); printk("gnttab_table mapped at %p.\n", gnttab_table); } diff --git a/extras/mini-os/include/gnttab.h b/extras/mini-os/include/gnttab.h index acd6c39..c43ad42 100644 --- a/extras/mini-os/include/gnttab.h +++ b/extras/mini-os/include/gnttab.h @@ -12,5 +12,6 @@ unsigned long gnttab_end_transfer(grant_ref_t gref); int gnttab_end_access(grant_ref_t ref); const char *gnttabop_error(int16_t status); void fini_gnttab(void); +grant_entry_t *arch_init_gnttab(int nr_grant_frames); #endif /* !__GNTTAB_H__ */ -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |