/* ACPI 1.0b: 16.2.3 Data Objects Encoding: String */ Aml *aml_string(const char *name_format, ...) { Aml *var = aml_opcode(0x0D /* StringPrefix */); va_list ap; char *s; int len; va_start(ap, name_format); len = g_vasprintf(&s, name_format, ap); va_end(ap); g_array_append_vals(var->buf, s, len + 1); g_free(s); return var; }
/* ACPI 1.0b: 16.2.3 Data Objects Encoding: String */ Aml *aml_string(const char *name_format, ...) { Aml *var = aml_opcode(0x0D /* StringPrefix */); va_list ap, va_len; char *s; int len; va_start(ap, name_format); va_copy(va_len, ap); len = vsnprintf(NULL, 0, name_format, va_len); va_end(va_len); len += 1; s = g_new0(typeof(*s), len); len = vsnprintf(s, len, name_format, ap); va_end(ap); g_array_append_vals(var->buf, s, len); build_append_byte(var->buf, 0x0); /* NullChar */ g_free(s); return var; }
/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLNot */ Aml *aml_lnot(Aml *arg) { Aml *var = aml_opcode(0x92 /* LNotOp */); aml_append(var, arg); return var; }
/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefDecrement */ Aml *aml_decrement(Aml *arg) { Aml *var = aml_opcode(0x76 /* DecrementOp */); aml_append(var, arg); return var; }
/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefIncrement */ Aml *aml_increment(Aml *arg) { Aml *var = aml_opcode(0x75 /* IncrementOp */); aml_append(var, arg); return var; }
/* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefReturn */ Aml *aml_return(Aml *val) { Aml *var = aml_opcode(0xA4 /* ReturnOp */); aml_append(var, val); return var; }
/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefObjectType */ Aml *aml_object_type(Aml *object) { Aml *var = aml_opcode(0x8E /* ObjectTypeOp */); aml_append(var, object); return var; }
/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefSizeOf */ Aml *aml_sizeof(Aml *arg) { Aml *var = aml_opcode(0x87 /* SizeOfOp */); aml_append(var, arg); return var; }
/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefDerefOf */ Aml *aml_derefof(Aml *arg) { Aml *var = aml_opcode(0x83 /* DerefOfOp */); aml_append(var, arg); return var; }
/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefRefOf */ Aml *aml_refof(Aml *arg) { Aml *var = aml_opcode(0x71 /* RefOfOp */); aml_append(var, arg); return var; }