cpu.c (55afdac3b29e672aad51e953412364127e54268b) cpu.c (64a7b8de42aff54dce4d82585f25060a741531d1)
1/*
2 * QEMU ARM CPU
3 *
4 * Copyright (c) 2012 SUSE LINUX Products GmbH
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2

--- 1139 unchanged lines hidden (view full) ---

1148 }
1149 set_feature(&cpu->env, ARM_FEATURE_PMU);
1150 } else {
1151 unset_feature(&cpu->env, ARM_FEATURE_PMU);
1152 }
1153 cpu->has_pmu = value;
1154}
1155
1/*
2 * QEMU ARM CPU
3 *
4 * Copyright (c) 2012 SUSE LINUX Products GmbH
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2

--- 1139 unchanged lines hidden (view full) ---

1148 }
1149 set_feature(&cpu->env, ARM_FEATURE_PMU);
1150 } else {
1151 unset_feature(&cpu->env, ARM_FEATURE_PMU);
1152 }
1153 cpu->has_pmu = value;
1154}
1155
1156static void arm_get_init_svtor(Object *obj, Visitor *v, const char *name,
1157 void *opaque, Error **errp)
1158{
1159 ARMCPU *cpu = ARM_CPU(obj);
1160
1161 visit_type_uint32(v, name, &cpu->init_svtor, errp);
1162}
1163
1164static void arm_set_init_svtor(Object *obj, Visitor *v, const char *name,
1165 void *opaque, Error **errp)
1166{
1167 ARMCPU *cpu = ARM_CPU(obj);
1168
1169 visit_type_uint32(v, name, &cpu->init_svtor, errp);
1170}
1171
1172unsigned int gt_cntfrq_period_ns(ARMCPU *cpu)
1173{
1174 /*
1175 * The exact approach to calculating guest ticks is:
1176 *
1177 * muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), cpu->gt_cntfrq_hz,
1178 * NANOSECONDS_PER_SECOND);
1179 *

--- 103 unchanged lines hidden (view full) ---

1283 qdev_prop_allow_set_link_before_realize,
1284 OBJ_PROP_LINK_STRONG,
1285 &error_abort);
1286 /*
1287 * M profile: initial value of the Secure VTOR. We can't just use
1288 * a simple DEFINE_PROP_UINT32 for this because we want to permit
1289 * the property to be set after realize.
1290 */
1156unsigned int gt_cntfrq_period_ns(ARMCPU *cpu)
1157{
1158 /*
1159 * The exact approach to calculating guest ticks is:
1160 *
1161 * muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), cpu->gt_cntfrq_hz,
1162 * NANOSECONDS_PER_SECOND);
1163 *

--- 103 unchanged lines hidden (view full) ---

1267 qdev_prop_allow_set_link_before_realize,
1268 OBJ_PROP_LINK_STRONG,
1269 &error_abort);
1270 /*
1271 * M profile: initial value of the Secure VTOR. We can't just use
1272 * a simple DEFINE_PROP_UINT32 for this because we want to permit
1273 * the property to be set after realize.
1274 */
1291 object_property_add(obj, "init-svtor", "uint32",
1292 arm_get_init_svtor, arm_set_init_svtor,
1293 NULL, NULL, &error_abort);
1275 object_property_add_uint32_ptr(obj, "init-svtor",
1276 &cpu->init_svtor,
1277 OBJ_PROP_FLAG_READWRITE, &error_abort);
1294 }
1295
1296 qdev_property_add_static(DEVICE(obj), &arm_cpu_cfgend_property);
1297
1298 if (arm_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER)) {
1299 qdev_property_add_static(DEVICE(cpu), &arm_cpu_gt_cntfrq_property);
1300 }
1301}

--- 1631 unchanged lines hidden ---
1278 }
1279
1280 qdev_property_add_static(DEVICE(obj), &arm_cpu_cfgend_property);
1281
1282 if (arm_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER)) {
1283 qdev_property_add_static(DEVICE(cpu), &arm_cpu_gt_cntfrq_property);
1284 }
1285}

--- 1631 unchanged lines hidden ---