..., and at once constify the data items among them.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
struct domain *d;
/* Interface types to internal p2m types */
- p2m_type_t memtype[] = {
- p2m_ram_rw, /* HVMMEM_ram_rw */
- p2m_ram_ro, /* HVMMEM_ram_ro */
- p2m_mmio_dm /* HVMMEM_mmio_dm */
+ static const p2m_type_t memtype[] = {
+ [HVMMEM_ram_rw] = p2m_ram_rw,
+ [HVMMEM_ram_ro] = p2m_ram_ro,
+ [HVMMEM_mmio_dm] = p2m_mmio_dm
};
if ( copy_from_guest(&a, arg, 1) )
}
int __get_instruction_length_from_list(struct vcpu *v,
- enum instruction_index *list, unsigned int list_count)
+ const enum instruction_index *list, unsigned int list_count)
{
struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
unsigned int i, j, inst_len = 0;
static void svm_vmexit_do_invalidate_cache(struct cpu_user_regs *regs)
{
- enum instruction_index list[] = { INSTR_INVD, INSTR_WBINVD };
+ static const enum instruction_index list[] = { INSTR_INVD, INSTR_WBINVD };
int inst_len;
inst_len = __get_instruction_length_from_list(
vmx_update_cpu_exec_control(v);
break;
case EXIT_REASON_TASK_SWITCH: {
- const enum hvm_task_switch_reason reasons[] = {
- TSW_call_or_int, TSW_iret, TSW_jmp, TSW_call_or_int };
+ static const enum hvm_task_switch_reason reasons[] = {
+ TSW_call_or_int, TSW_iret, TSW_jmp, TSW_call_or_int
+ };
int32_t ecode = -1, source;
+
exit_qualification = __vmread(EXIT_QUALIFICATION);
source = (exit_qualification >> 30) & 3;
/* Vectored event should fill in interrupt information. */
/* Flags that are needed in a pagetable entry, with the sense of NX inverted */
static uint32_t mandatory_flags(struct vcpu *v, uint32_t pfec)
{
- static uint32_t flags[] = {
+ static const uint32_t flags[] = {
/* I/F - Usr Wr */
/* 0 0 0 0 */ _PAGE_PRESENT,
/* 0 0 0 1 */ _PAGE_PRESENT|_PAGE_RW,
}
}
-void smp_callin(void)
+static void smp_callin(void)
{
unsigned int cpu = smp_processor_id();
int i, rc;
* The Linux original version of this function is
* Copyright (c) 2006, Red Hat, Inc., Ingo Molnar
*/
-void check_tsc_warp(unsigned long tsc_khz, unsigned long *max_warp)
+static void check_tsc_warp(unsigned long tsc_khz, unsigned long *max_warp)
{
#define rdtsc_barrier() mb()
static DEFINE_SPINLOCK(sync_lock);
const struct cpu_user_regs *regs, unsigned long crs[8],
enum context context, const struct vcpu *v)
{
- const static char *context_names[] = {
+ static const char *const context_names[] = {
[CTXT_hypervisor] = "hypervisor",
[CTXT_pv_guest] = "pv guest",
[CTXT_hvm_guest] = "hvm guest"
struct vcpu;
int __get_instruction_length_from_list(
- struct vcpu *v, enum instruction_index *list, unsigned int list_count);
+ struct vcpu *, const enum instruction_index *, unsigned int list_count);
static inline int __get_instruction_length(
struct vcpu *v, enum instruction_index instr)