mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
x86: mark certain items static
..., and at once constify the data items among them. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
This commit is contained in:
1 parent
3e7fcd5127
commit
57b4fcf14e
9 files changed
+15
-13
No files matched your search
@@ -4117,10 +4117,10 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
|
||||
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) )
|
||||
|
||||
@@ -152,7 +152,7 @@ static int fetch(struct vcpu *v, u8 *buf, unsigned long addr, int len)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -1931,7 +1931,7 @@ static void svm_wbinvd_intercept(void)
|
||||
|
||||
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(
|
||||
|
||||
@@ -2475,9 +2475,11 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
|
||||
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. */
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
/* 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,
|
||||
|
||||
@@ -179,7 +179,7 @@ static void synchronize_tsc_slave(unsigned int slave)
|
||||
}
|
||||
}
|
||||
|
||||
void smp_callin(void)
|
||||
static void smp_callin(void)
|
||||
{
|
||||
unsigned int cpu = smp_processor_id();
|
||||
int i, rc;
|
||||
|
||||
+1
-1
@@ -1151,7 +1151,7 @@ static void local_time_calibration(void)
|
||||
* 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);
|
||||
|
||||
@@ -45,7 +45,7 @@ static void _show_registers(
|
||||
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"
|
||||
|
||||
@@ -45,7 +45,7 @@ enum instruction_index {
|
||||
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)
|
||||
|
||||