Lines Matching refs:prop
54 void *object_field_prop_ptr(Object *obj, Property *prop) in object_field_prop_ptr() argument
57 ptr += prop->offset; in object_field_prop_ptr()
64 Property *prop = opaque; in field_prop_get() local
65 return prop->info->get(obj, v, name, opaque, errp); in field_prop_get()
81 Property *prop = opaque; in field_prop_set() local
83 if (!qdev_prop_allow_set(obj, name, prop->info, errp)) { in field_prop_set()
87 return prop->info->set(obj, v, name, opaque, errp); in field_prop_set()
103 Property *prop = opaque; in qdev_propinfo_get_enum() local
104 int *ptr = object_field_prop_ptr(obj, prop); in qdev_propinfo_get_enum()
106 visit_type_enum(v, name, ptr, prop->info->enum_table, errp); in qdev_propinfo_get_enum()
112 Property *prop = opaque; in qdev_propinfo_set_enum() local
113 int *ptr = object_field_prop_ptr(obj, prop); in qdev_propinfo_set_enum()
115 visit_type_enum(v, name, ptr, prop->info->enum_table, errp); in qdev_propinfo_set_enum()
119 const Property *prop) in qdev_propinfo_set_default_value_enum() argument
122 qapi_enum_lookup(prop->info->enum_table, prop->defval.i)); in qdev_propinfo_set_default_value_enum()
134 static uint32_t qdev_get_prop_mask(Property *prop) in qdev_get_prop_mask() argument
136 assert(prop->info == &qdev_prop_bit); in qdev_get_prop_mask()
137 return 0x1 << prop->bitnr; in qdev_get_prop_mask()
154 Property *prop = opaque; in prop_get_bit() local
155 uint32_t *p = object_field_prop_ptr(obj, prop); in prop_get_bit()
156 bool value = (*p & qdev_get_prop_mask(prop)) != 0; in prop_get_bit()
164 Property *prop = opaque; in prop_set_bit() local
170 bit_prop_set(obj, prop, value); in prop_set_bit()
173 static void set_default_value_bool(ObjectProperty *op, const Property *prop) in set_default_value_bool() argument
175 object_property_set_default_bool(op, prop->defval.u); in set_default_value_bool()
188 static uint64_t qdev_get_prop_mask64(Property *prop) in qdev_get_prop_mask64() argument
190 assert(prop->info == &qdev_prop_bit64); in qdev_get_prop_mask64()
191 return 0x1ull << prop->bitnr; in qdev_get_prop_mask64()
208 Property *prop = opaque; in prop_get_bit64() local
209 uint64_t *p = object_field_prop_ptr(obj, prop); in prop_get_bit64()
210 bool value = (*p & qdev_get_prop_mask64(prop)) != 0; in prop_get_bit64()
218 Property *prop = opaque; in prop_set_bit64() local
224 bit64_prop_set(obj, prop, value); in prop_set_bit64()
240 Property *prop = opaque; in get_bool() local
241 bool *ptr = object_field_prop_ptr(obj, prop); in get_bool()
249 Property *prop = opaque; in set_bool() local
250 bool *ptr = object_field_prop_ptr(obj, prop); in set_bool()
267 Property *prop = opaque; in get_uint8() local
268 uint8_t *ptr = object_field_prop_ptr(obj, prop); in get_uint8()
276 Property *prop = opaque; in set_uint8() local
277 uint8_t *ptr = object_field_prop_ptr(obj, prop); in set_uint8()
283 const Property *prop) in qdev_propinfo_set_default_value_int() argument
285 object_property_set_default_int(op, prop->defval.i); in qdev_propinfo_set_default_value_int()
289 const Property *prop) in qdev_propinfo_set_default_value_uint() argument
291 object_property_set_default_uint(op, prop->defval.u); in qdev_propinfo_set_default_value_uint()
306 Property *prop = opaque; in get_uint16() local
307 uint16_t *ptr = object_field_prop_ptr(obj, prop); in get_uint16()
315 Property *prop = opaque; in set_uint16() local
316 uint16_t *ptr = object_field_prop_ptr(obj, prop); in set_uint16()
333 Property *prop = opaque; in get_uint32() local
334 uint32_t *ptr = object_field_prop_ptr(obj, prop); in get_uint32()
342 Property *prop = opaque; in set_uint32() local
343 uint32_t *ptr = object_field_prop_ptr(obj, prop); in set_uint32()
351 Property *prop = opaque; in qdev_propinfo_get_int32() local
352 int32_t *ptr = object_field_prop_ptr(obj, prop); in qdev_propinfo_get_int32()
360 Property *prop = opaque; in set_int32() local
361 int32_t *ptr = object_field_prop_ptr(obj, prop); in set_int32()
385 Property *prop = opaque; in get_uint64() local
386 uint64_t *ptr = object_field_prop_ptr(obj, prop); in get_uint64()
394 Property *prop = opaque; in set_uint64() local
395 uint64_t *ptr = object_field_prop_ptr(obj, prop); in set_uint64()
403 Property *prop = opaque; in get_int64() local
404 int64_t *ptr = object_field_prop_ptr(obj, prop); in get_int64()
412 Property *prop = opaque; in set_int64() local
413 int64_t *ptr = object_field_prop_ptr(obj, prop); in set_int64()
435 Property *prop = opaque; in set_uint64_checkmask() local
436 uint64_t *ptr = object_field_prop_ptr(obj, prop); in set_uint64_checkmask()
439 if (*ptr & ~prop->bitmask) { in set_uint64_checkmask()
441 name, prop->bitmask); in set_uint64_checkmask()
455 Property *prop = opaque; in release_string() local
456 g_free(*(char **)object_field_prop_ptr(obj, prop)); in release_string()
462 Property *prop = opaque; in get_string() local
463 char **ptr = object_field_prop_ptr(obj, prop); in get_string()
476 Property *prop = opaque; in set_string() local
477 char **ptr = object_field_prop_ptr(obj, prop); in set_string()
510 Property *prop = opaque; in qdev_propinfo_get_size32() local
511 uint32_t *ptr = object_field_prop_ptr(obj, prop); in qdev_propinfo_get_size32()
520 Property *prop = opaque; in set_size32() local
521 uint32_t *ptr = object_field_prop_ptr(obj, prop); in set_size32()
585 Property *prop = opaque; in release_prop_array() local
586 uint32_t *alenptr = object_field_prop_ptr(obj, prop); in release_prop_array()
587 void **arrayptr = (void *)obj + prop->arrayoffset; in release_prop_array()
591 if (!prop->arrayinfo->release) { in release_prop_array()
596 Property elem_prop = array_elem_prop(obj, prop, name, elem); in release_prop_array()
597 prop->arrayinfo->release(obj, NULL, &elem_prop); in release_prop_array()
598 elem += prop->arrayfieldsize; in release_prop_array()
612 Property *prop = opaque; in set_prop_array() local
613 uint32_t *alenptr = object_field_prop_ptr(obj, prop); in set_prop_array()
614 void **arrayptr = (void *)obj + prop->arrayoffset; in set_prop_array()
635 elem->value = g_malloc0(prop->arrayfieldsize); in set_prop_array()
636 elem_prop = array_elem_prop(obj, prop, name, elem->value); in set_prop_array()
637 prop->arrayinfo->set(obj, v, NULL, &elem_prop, errp); in set_prop_array()
657 Property elem_prop = array_elem_prop(obj, prop, name, in set_prop_array()
659 if (prop->arrayinfo->release) { in set_prop_array()
660 prop->arrayinfo->release(obj, NULL, &elem_prop); in set_prop_array()
673 *arrayptr = g_malloc_n(*alenptr, prop->arrayfieldsize); in set_prop_array()
676 memcpy(elemptr, elem->value, prop->arrayfieldsize); in set_prop_array()
677 elemptr += prop->arrayfieldsize; in set_prop_array()
688 Property *prop = opaque; in get_prop_array() local
689 uint32_t *alenptr = object_field_prop_ptr(obj, prop); in get_prop_array()
690 void **arrayptr = (void *)obj + prop->arrayoffset; in get_prop_array()
702 elemptr += prop->arrayfieldsize; in get_prop_array()
714 Property elem_prop = array_elem_prop(obj, prop, name, elem->value); in get_prop_array()
715 prop->arrayinfo->get(obj, v, NULL, &elem_prop, errp); in get_prop_array()
737 static void default_prop_array(ObjectProperty *op, const Property *prop) in default_prop_array() argument
769 Property *prop; in qdev_prop_find() local
774 prop = qdev_prop_walk(DEVICE_CLASS(class)->props_, name); in qdev_prop_find()
775 if (prop) { in qdev_prop_find()
776 return prop; in qdev_prop_find()
843 Property *prop; in qdev_prop_set_enum() local
845 prop = qdev_prop_find(dev, name); in qdev_prop_set_enum()
847 qapi_enum_lookup(prop->info->enum_table, value), in qdev_prop_set_enum()
869 void qdev_prop_register_global(GlobalProperty *prop) in qdev_prop_register_global() argument
871 g_ptr_array_add(global_props(), prop); in qdev_prop_register_global()
896 GlobalProperty *prop; in qdev_prop_check_globals() local
900 prop = g_ptr_array_index(global_props(), i); in qdev_prop_check_globals()
901 if (prop->used) { in qdev_prop_check_globals()
904 oc = object_class_by_name(prop->driver); in qdev_prop_check_globals()
908 prop->driver, prop->property); in qdev_prop_check_globals()
913 if (!dc->hotpluggable && !prop->used) { in qdev_prop_check_globals()
915 prop->driver, prop->property, prop->value); in qdev_prop_check_globals()
934 Property *prop = opaque; in get_size() local
935 uint64_t *ptr = object_field_prop_ptr(obj, prop); in get_size()
943 Property *prop = opaque; in set_size() local
944 uint64_t *ptr = object_field_prop_ptr(obj, prop); in set_size()
959 Property *prop) in create_link_property() argument
961 return object_class_property_add_link(oc, name, prop->link_type, in create_link_property()
962 prop->offset, in create_link_property()
972 void qdev_property_add_static(DeviceState *dev, Property *prop) in qdev_property_add_static() argument
977 assert(!prop->info->create); in qdev_property_add_static()
979 op = object_property_add(obj, prop->name, prop->info->name, in qdev_property_add_static()
980 field_prop_getter(prop->info), in qdev_property_add_static()
981 field_prop_setter(prop->info), in qdev_property_add_static()
982 prop->info->release, in qdev_property_add_static()
983 prop); in qdev_property_add_static()
985 object_property_set_description(obj, prop->name, in qdev_property_add_static()
986 prop->info->description); in qdev_property_add_static()
988 if (prop->set_default) { in qdev_property_add_static()
989 prop->info->set_default_value(op, prop); in qdev_property_add_static()
997 Property *prop) in qdev_class_add_property() argument
1002 if (prop->info->create) { in qdev_class_add_property()
1003 op = prop->info->create(oc, name, prop); in qdev_class_add_property()
1006 name, prop->info->name, in qdev_class_add_property()
1007 field_prop_getter(prop->info), in qdev_class_add_property()
1008 field_prop_setter(prop->info), in qdev_class_add_property()
1009 prop->info->release, in qdev_class_add_property()
1010 prop); in qdev_class_add_property()
1012 if (prop->set_default) { in qdev_class_add_property()
1013 prop->info->set_default_value(op, prop); in qdev_class_add_property()
1015 object_class_property_set_description(oc, name, prop->info->description); in qdev_class_add_property()
1026 Property *prop = opaque; in qdev_get_legacy_property() local
1031 prop->info->print(obj, prop, buffer, sizeof(buffer)); in qdev_get_legacy_property()
1049 static void qdev_class_add_legacy_property(DeviceClass *dc, Property *prop) in qdev_class_add_legacy_property() argument
1054 if (!prop->info->print && prop->info->get) { in qdev_class_add_legacy_property()
1058 name = g_strdup_printf("legacy-%s", prop->name); in qdev_class_add_legacy_property()
1060 prop->info->print ? qdev_get_legacy_property : prop->info->get, in qdev_class_add_legacy_property()
1061 NULL, NULL, prop); in qdev_class_add_legacy_property()
1066 Property *prop; in device_class_set_props() local
1069 for (prop = props; prop && prop->name; prop++) { in device_class_set_props()
1070 qdev_class_add_legacy_property(dc, prop); in device_class_set_props()
1071 qdev_class_add_property(dc, prop->name, prop); in device_class_set_props()
1079 ObjectProperty *prop; in qdev_alias_all_properties() local
1084 while ((prop = object_property_iter_next(&iter))) { in qdev_alias_all_properties()
1085 if (object_property_find(source, prop->name)) { in qdev_alias_all_properties()
1089 object_property_add_alias(source, prop->name, in qdev_alias_all_properties()
1090 OBJECT(target), prop->name); in qdev_alias_all_properties()