[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 04/32] acpi: add aml_mutex, aml_acquire, aml_
From: |
Igor Mammedov |
Subject: |
Re: [Qemu-devel] [PATCH v3 04/32] acpi: add aml_mutex, aml_acquire, aml_release |
Date: |
Tue, 13 Oct 2015 15:34:09 +0200 |
On Sun, 11 Oct 2015 11:52:36 +0800
Xiao Guangrong <address@hidden> wrote:
> Implement Mutex, Acquire and Release terms which are used by NVDIMM _DSM
> method
> in later patch
>
> Signed-off-by: Xiao Guangrong <address@hidden>
> ---
> hw/acpi/aml-build.c | 32 ++++++++++++++++++++++++++++++++
> include/hw/acpi/aml-build.h | 3 +++
> 2 files changed, 35 insertions(+)
>
> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
> index 9fe5e7b..ab52692 100644
> --- a/hw/acpi/aml-build.c
> +++ b/hw/acpi/aml-build.c
> @@ -1164,6 +1164,38 @@ Aml *aml_create_field(Aml *srcbuf, Aml *index, Aml
> *len, const char *name)
> return var;
> }
>
> +/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefMutex */
> +Aml *aml_mutex(const char *name, uint8_t flags)
s/flags/sync_level/
> +{
> + Aml *var = aml_alloc();
> + build_append_byte(var->buf, 0x5B); /* ExtOpPrefix */
> + build_append_byte(var->buf, 0x01); /* MutexOp */
> + build_append_namestring(var->buf, "%s", name);
add assert here to check that reserved bits are 0
> + build_append_byte(var->buf, flags);
> + return var;
> +}
> +
> +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefAcquire */
> +Aml *aml_acquire(Aml *mutex, uint16_t timeout)
> +{
> + Aml *var = aml_alloc();
> + build_append_byte(var->buf, 0x5B); /* ExtOpPrefix */
> + build_append_byte(var->buf, 0x23); /* AcquireOp */
> + aml_append(var, mutex);
> + build_append_int_noprefix(var->buf, timeout, sizeof(timeout));
> + return var;
> +}
> +
> +/* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefRelease */
> +Aml *aml_release(Aml *mutex)
> +{
> + Aml *var = aml_alloc();
> + build_append_byte(var->buf, 0x5B); /* ExtOpPrefix */
> + build_append_byte(var->buf, 0x27); /* ReleaseOp */
> + aml_append(var, mutex);
> + return var;
> +}
> +
> void
> build_header(GArray *linker, GArray *table_data,
> AcpiTableHeader *h, const char *sig, int len, uint8_t rev)
> diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
> index 7e1c43b..d494c0c 100644
> --- a/include/hw/acpi/aml-build.h
> +++ b/include/hw/acpi/aml-build.h
> @@ -277,6 +277,9 @@ Aml *aml_unicode(const char *str);
> Aml *aml_derefof(Aml *arg);
> Aml *aml_sizeof(Aml *arg);
> Aml *aml_create_field(Aml *srcbuf, Aml *index, Aml *len, const char *name);
> +Aml *aml_mutex(const char *name, uint8_t flags);
> +Aml *aml_acquire(Aml *mutex, uint16_t timeout);
> +Aml *aml_release(Aml *mutex);
>
> void
> build_header(GArray *linker, GArray *table_data,
- Re: [Qemu-devel] [PATCH v3 00/32] implement vNVDIMM, (continued)
[Qemu-devel] [PATCH v3 03/32] acpi: add aml_create_field, Xiao Guangrong, 2015/10/10
[Qemu-devel] [PATCH v3 14/32] pc-dimm: drop the prefix of pc-dimm, Xiao Guangrong, 2015/10/10
[Qemu-devel] [PATCH v3 04/32] acpi: add aml_mutex, aml_acquire, aml_release, Xiao Guangrong, 2015/10/10
- Re: [Qemu-devel] [PATCH v3 04/32] acpi: add aml_mutex, aml_acquire, aml_release,
Igor Mammedov <=
[Qemu-devel] [PATCH v3 10/32] hostmem-file: clean up memory allocation, Xiao Guangrong, 2015/10/10
[Qemu-devel] [PATCH v3 12/32] pc-dimm: remove DEFAULT_PC_DIMMSIZE, Xiao Guangrong, 2015/10/10
[Qemu-devel] [PATCH v3 22/32] nvdimm: init the address region used by NVDIMM ACPI, Xiao Guangrong, 2015/10/10
- Re: [Qemu-devel] [PATCH v3 22/32] nvdimm: init the address region used by NVDIMM ACPI, Michael S. Tsirkin, 2015/10/19
- Re: [Qemu-devel] [PATCH v3 22/32] nvdimm: init the address region used by NVDIMM ACPI, Xiao Guangrong, 2015/10/19
- Re: [Qemu-devel] [PATCH v3 22/32] nvdimm: init the address region used by NVDIMM ACPI, Michael S. Tsirkin, 2015/10/19
- Re: [Qemu-devel] [PATCH v3 22/32] nvdimm: init the address region used by NVDIMM ACPI, Xiao Guangrong, 2015/10/19
- Re: [Qemu-devel] [PATCH v3 22/32] nvdimm: init the address region used by NVDIMM ACPI, Michael S. Tsirkin, 2015/10/19
- Re: [Qemu-devel] [PATCH v3 22/32] nvdimm: init the address region used by NVDIMM ACPI, Igor Mammedov, 2015/10/19