Skip to content

Commit

Permalink
Fixed indentation in xen.cc
Browse files Browse the repository at this point in the history
Signed-off-by: Waldemar Kozaczuk <[email protected]>
  • Loading branch information
wkozaczuk committed Jun 19, 2019
1 parent 414a54c commit e1260d5
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions arch/x64/xen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,37 +169,37 @@ gsi_level_interrupt *xen_set_callback(int irqno)

void xen_init(processor::features_type &features, unsigned base)
{
// Base + 1 would have given us the version number, it is mostly
// uninteresting for us now
auto x = processor::cpuid(base + 2);
processor::wrmsr(x.b, cast_pointer(&hypercall_page));

struct xen_feature_info info;
// To fill up the array used by C code
for (int i = 0; i < XENFEAT_NR_SUBMAPS; i++) {
info.submap_idx = i;
if (version_hypercall(XENVER_get_features, &info) < 0)
assert(0);
for (int j = 0; j < 32; j++)
xen_features[i * 32 + j] = !!(info.submap & 1<<j);
}
features.xen_clocksource = xen_features[9] & 1;
features.xen_vector_callback = xen_features[8] & 1;
if (!features.xen_vector_callback)
evtchn_irq_is_legacy();

struct xen_add_to_physmap map;
map.domid = DOMID_SELF;
map.idx = 0;
map.space = 0;
map.gpfn = cast_pointer(&xen_shared_info) >> 12;

// 7 => add to physmap
if (memory_hypercall(XENMEM_add_to_physmap, &map))
// Base + 1 would have given us the version number, it is mostly
// uninteresting for us now
auto x = processor::cpuid(base + 2);
processor::wrmsr(x.b, cast_pointer(&hypercall_page));

struct xen_feature_info info;
// To fill up the array used by C code
for (int i = 0; i < XENFEAT_NR_SUBMAPS; i++) {
info.submap_idx = i;
if (version_hypercall(XENVER_get_features, &info) < 0)
assert(0);
for (int j = 0; j < 32; j++)
xen_features[i * 32 + j] = !!(info.submap & 1<<j);
}
features.xen_clocksource = xen_features[9] & 1;
features.xen_vector_callback = xen_features[8] & 1;
if (!features.xen_vector_callback)
evtchn_irq_is_legacy();

struct xen_add_to_physmap map;
map.domid = DOMID_SELF;
map.idx = 0;
map.space = 0;
map.gpfn = cast_pointer(&xen_shared_info) >> 12;

// 7 => add to physmap
if (memory_hypercall(XENMEM_add_to_physmap, &map))
assert(0);

features.xen_pci = xen_pci_enabled();
HYPERVISOR_shared_info = reinterpret_cast<shared_info_t *>(&xen_shared_info);
features.xen_pci = xen_pci_enabled();
HYPERVISOR_shared_info = reinterpret_cast<shared_info_t *>(&xen_shared_info);
}

void irq_init()
Expand Down

0 comments on commit e1260d5

Please sign in to comment.