mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
libxc: make arch_setup_boot{init/late} xc_dom_arch hooks
This should not introduce any functional change. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com> Acked-by: Wei Liu <wei.liu2@citrix.com> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> Cc: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
1 parent
392478215a
commit
b4ec1faa91
4 files changed
+25
-16
No files matched your search
@@ -220,6 +220,8 @@ struct xc_dom_arch {
|
||||
int (*start_info) (struct xc_dom_image * dom);
|
||||
int (*shared_info) (struct xc_dom_image * dom, void *shared_info);
|
||||
int (*vcpu) (struct xc_dom_image * dom, void *vcpu_ctxt);
|
||||
int (*bootearly) (struct xc_dom_image * dom);
|
||||
int (*bootlate) (struct xc_dom_image * dom);
|
||||
|
||||
/* arch-specific memory initialization. */
|
||||
int (*meminit) (struct xc_dom_image * dom);
|
||||
@@ -399,11 +401,6 @@ static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
|
||||
return dom->p2m_host[pfn - dom->rambase_pfn];
|
||||
}
|
||||
|
||||
/* --- arch bits --------------------------------------------------- */
|
||||
|
||||
int arch_setup_bootearly(struct xc_dom_image *dom);
|
||||
int arch_setup_bootlate(struct xc_dom_image *dom);
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* mode: C
|
||||
|
||||
@@ -489,13 +489,20 @@ static int meminit(struct xc_dom_image *dom)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int arch_setup_bootearly(struct xc_dom_image *dom)
|
||||
int xc_dom_feature_translated(struct xc_dom_image *dom)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
static int bootearly(struct xc_dom_image *dom)
|
||||
{
|
||||
DOMPRINTF("%s: doing nothing", __FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int arch_setup_bootlate(struct xc_dom_image *dom)
|
||||
static int bootlate(struct xc_dom_image *dom)
|
||||
{
|
||||
/* XXX
|
||||
* map shared info
|
||||
@@ -505,11 +512,6 @@ int arch_setup_bootlate(struct xc_dom_image *dom)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int xc_dom_feature_translated(struct xc_dom_image *dom)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
static struct xc_dom_arch xc_dom_32 = {
|
||||
@@ -524,6 +526,8 @@ static struct xc_dom_arch xc_dom_32 = {
|
||||
.shared_info = shared_info_arm,
|
||||
.vcpu = vcpu_arm32,
|
||||
.meminit = meminit,
|
||||
.bootearly = bootearly,
|
||||
.bootlate = bootlate,
|
||||
};
|
||||
|
||||
static struct xc_dom_arch xc_dom_64 = {
|
||||
@@ -538,6 +542,8 @@ static struct xc_dom_arch xc_dom_64 = {
|
||||
.shared_info = shared_info_arm,
|
||||
.vcpu = vcpu_arm64,
|
||||
.meminit = meminit,
|
||||
.bootearly = bootearly,
|
||||
.bootlate = bootlate,
|
||||
};
|
||||
|
||||
static void __init register_arch_hooks(void)
|
||||
|
||||
@@ -208,7 +208,7 @@ int xc_dom_boot_image(struct xc_dom_image *dom)
|
||||
DOMPRINTF_CALLED(dom->xch);
|
||||
|
||||
/* misc stuff*/
|
||||
if ( (rc = arch_setup_bootearly(dom)) != 0 )
|
||||
if ( (rc = dom->arch_hooks->bootearly(dom)) != 0 )
|
||||
return rc;
|
||||
|
||||
/* collect some info */
|
||||
@@ -255,7 +255,7 @@ int xc_dom_boot_image(struct xc_dom_image *dom)
|
||||
xc_dom_log_memory_footprint(dom);
|
||||
|
||||
/* misc x86 stuff */
|
||||
if ( (rc = arch_setup_bootlate(dom)) != 0 )
|
||||
if ( (rc = dom->arch_hooks->bootlate(dom)) != 0 )
|
||||
return rc;
|
||||
|
||||
/* let the vm run */
|
||||
|
||||
@@ -922,7 +922,9 @@ static int meminit_pv(struct xc_dom_image *dom)
|
||||
return rc;
|
||||
}
|
||||
|
||||
int arch_setup_bootearly(struct xc_dom_image *dom)
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
static int bootearly(struct xc_dom_image *dom)
|
||||
{
|
||||
DOMPRINTF("%s: doing nothing", __FUNCTION__);
|
||||
return 0;
|
||||
@@ -961,7 +963,7 @@ static int map_grant_table_frames(struct xc_dom_image *dom)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int arch_setup_bootlate(struct xc_dom_image *dom)
|
||||
static int bootlate_pv(struct xc_dom_image *dom)
|
||||
{
|
||||
static const struct {
|
||||
char *guest;
|
||||
@@ -1057,6 +1059,8 @@ static struct xc_dom_arch xc_dom_32_pae = {
|
||||
.shared_info = shared_info_x86_32,
|
||||
.vcpu = vcpu_x86_32,
|
||||
.meminit = meminit_pv,
|
||||
.bootearly = bootearly,
|
||||
.bootlate = bootlate_pv,
|
||||
};
|
||||
|
||||
static struct xc_dom_arch xc_dom_64 = {
|
||||
@@ -1071,6 +1075,8 @@ static struct xc_dom_arch xc_dom_64 = {
|
||||
.shared_info = shared_info_x86_64,
|
||||
.vcpu = vcpu_x86_64,
|
||||
.meminit = meminit_pv,
|
||||
.bootearly = bootearly,
|
||||
.bootlate = bootlate_pv,
|
||||
};
|
||||
|
||||
static void __init register_arch_hooks(void)
|
||||
|
||||