static void riscv_cpu_list_entry(gpointer data, gpointer user_data) { const char *typename = object_class_get_name(OBJECT_CLASS(data)); int len = strlen(typename) - strlen(RISCV_CPU_TYPE_SUFFIX); qemu_printf("%.*s\n", len, typename); }
PRIVATE void setPropertyAndDestroyActiveWidget (SUIT_object o) { Pointer newVal; SUIT_level level; property *temp; if (SUIT_stringsMatch(OBJECT_CLASS(o), "dialog box")) { o = SUIT_getChild (o, 3); /* get the object we're really interested in */ } temp = si_searchForPropAtLevels (o, CURRENT_VALUE, &level); ASSERT ((level == OBJECT), (mes, "setPropertyAndDestroyActiveWidget could not find property CURRENT_VALUE.\n")); newVal = SUIT_convertType (temp->value, temp->type, peGlobal.propertyBeingEdited->type); if (newVal != NULL) /* set the property to the new value */ SUIT_setProperty (peGlobal.objectBeingEdited, peGlobal.propertyBeingEdited->name, peGlobal.propertyBeingEdited->type, newVal, peGlobal.levelBeingEdited); /* now get rid of the active widget */ SUIT_destroyObject (peGlobal.activeWidget); if (peGlobal.activeWrapper != NULL) SUIT_destroyObject (peGlobal.activeWrapper); peGlobal.activeWidget = NULL; peGlobal.activeWrapper = NULL; peGlobal.propertyBeingEdited = NULL; }
PRIVATE void handleClass (SUIT_object o, property *newProperty, Pointer oldValue) { ASSERT ((o != NULL), (mes, "handleClass called with a NULL object\n")); ENTER (5, (buf, "handleClass(%s,ptr,ptr)\n", OBJECT_NAME(o))); forObjectsInClass (global.root, OBJECT_CLASS(o), newProperty, oldValue); LEAVE (5, (buf, "handleClass(%s,ptr,ptr)\n", OBJECT_NAME(o))); }
PRIVATE void forObjectsInClass (SUIT_object o, char *className, property *newProperty, Pointer oldValue) { int i; ENTER (5, (buf, "forObjectsInClass(%s,%s,ptr,ptr)\n", OBJECT_NAME(o),className)); if (SUIT_stringsMatch (OBJECT_CLASS(o), className) && !SUIT_propertyExists (o, newProperty->name, newProperty->type, OBJECT)) callInterestRoutines(o, newProperty, oldValue); for (i = 0; i < SUIT_numberOfChildren (o); i++) forObjectsInClass (SUIT_getChild (o, i), className, newProperty, oldValue); LEAVE (5, (buf, "forObjectsInClass(%s,%s,ptr,ptr)\n", OBJECT_NAME(o),className)); }
bool ri_allowed(void) { if (kvm_enabled()) { MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); if (object_class_dynamic_cast(OBJECT_CLASS(mc), TYPE_S390_CCW_MACHINE)) { S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc); return s390mc->ri_allowed; } } return 0; }
static int accel_init_machine(AccelClass *acc, MachineState *ms) { ObjectClass *oc = OBJECT_CLASS(acc); const char *cname = object_class_get_name(oc); AccelState *accel = ACCEL(object_new(cname)); int ret; ms->accelerator = accel; *(acc->allowed) = true; ret = acc->init_machine(ms); if (ret < 0) { ms->accelerator = NULL; *(acc->allowed) = false; object_unref(OBJECT(accel)); } return ret; }
int machine_initialize(struct uc_struct *uc) { MachineClass *machine_class; MachineState *current_machine; module_call_init(uc, MODULE_INIT_QOM); register_types_object(uc); machine_register_types(uc); container_register_types(uc); cpu_register_types(uc); qdev_register_types(uc); // Initialize arch specific. uc->init_arch(uc); module_call_init(uc, MODULE_INIT_MACHINE); // this will auto initialize all register objects above. machine_class = find_default_machine(uc, uc->arch); if (machine_class == NULL) { //fprintf(stderr, "No machine specified, and there is no default.\n" // "Use -machine help to list supported machines!\n"); return -2; } current_machine = MACHINE(uc, object_new(uc, object_class_get_name( OBJECT_CLASS(machine_class)))); current_machine->uc = uc; uc->cpu_exec_init_all(uc); machine_class->max_cpus = 1; configure_accelerator(current_machine); qemu_init_cpu_loop(uc); qemu_mutex_lock_iothread(uc); current_machine->cpu_model = NULL; return machine_class->init(uc, current_machine); }
INLINE D object_class (D* instance) { return(OBJECT_CLASS(instance)); }
/** * Lookup a method given object, name and signature. * * @param obj the object where to start search * @param name name of the method being searched * @param sig signature of the method being searched * @param einfo struct errorInfo * * @return struct _jmethodID of the method being searched or 0 in case of an error */ Method* lookupObjectMethod(Hjava_lang_Object* obj, const char* name, const char* sig, errorInfo *einfo) { assert(obj != NULL && name != NULL && sig != NULL); return (lookupClassMethod(OBJECT_CLASS(obj), name, sig, false, einfo)); }
void java_lang_VMSystem_arraycopy0(struct Hjava_lang_Object* src, jint srcpos, struct Hjava_lang_Object* dst, jint dstpos, jint len) { char* in; char* out; int elemsz; Hjava_lang_Class* sclass; Hjava_lang_Class* dclass; sclass = OBJECT_CLASS(src); dclass = OBJECT_CLASS(dst); sclass = Kaffe_get_array_element_type(sclass); dclass = Kaffe_get_array_element_type(dclass); elemsz = TYPE_SIZE(sclass); len *= elemsz; srcpos *= elemsz; dstpos *= elemsz; in = &((char*)ARRAY_DATA(src))[srcpos]; out = &((char*)ARRAY_DATA(dst))[dstpos]; if (sclass == dclass) { #if defined(HAVE_MEMMOVE) memmove((void*)out, (void*)in, (size_t)len); #else /* Do it ourself */ #if defined(HAVE_MEMCPY) if (src != dst) { memcpy((void*)out, (void*)in, (size_t)len); } else #endif if (out < in) { /* Copy forwards */ for (; len > 0; len--) { *out++ = *in++; } } else { /* Copy backwards */ out += len; in += len; for (; len > 0; len--) { *--out = *--in; } } #endif } else { if (CLASS_IS_PRIMITIVE(sclass) || CLASS_IS_PRIMITIVE(dclass)) { Hjava_lang_Throwable* asexc; const char *stype = CLASS_CNAME(sclass); const char *dtype = CLASS_CNAME(dclass); char *b; #define _FORMAT "incompatible array types `%s' and `%s'" b = checkPtr(KMALLOC(strlen(stype)+strlen(dtype)+strlen(_FORMAT))); sprintf(b, _FORMAT, stype, dtype); #undef _FORMAT asexc = ArrayStoreException(b); KFREE(b); throwException(asexc); } for (; len > 0; len -= sizeof(Hjava_lang_Object*)) { Hjava_lang_Object* val = *(Hjava_lang_Object**)in; if (val != 0 && !instanceof(dclass, OBJECT_CLASS(val))) { Hjava_lang_Throwable* asexc; const char *vtype = CLASS_CNAME(OBJECT_CLASS(val)); const char *atype = CLASS_CNAME(dclass); char *b; #define _FORMAT "can't store `%s' in array of type `%s'" b = checkPtr(KMALLOC(strlen(vtype)+strlen(atype)+strlen(_FORMAT))); sprintf(b, _FORMAT, vtype, atype); #undef _FORMAT asexc = ArrayStoreException(b); KFREE(b); throwException(asexc); } *(Hjava_lang_Object**)out = val; in += sizeof(Hjava_lang_Object*); out += sizeof(Hjava_lang_Object*); } } }
D dylan_object_class (D* instance) { return OBJECT_CLASS(instance); }