Hi Robert,

 

Does pre-processor support the nested #if #else #endif statements?

 

This code

 

DefinitionBlock("DSDT.AML", "DSDT", 0x01, "      ", "        ", 3) {

 

  //

  //  System Bus

  //

  Scope(_SB) {

    // CPUs

    Device(CPU0) {

      Name(_HID, "ACPI0007")

      Name(_UID, Zero)

    }

 

#ifdef CPU_1

    Device(CPU1) {

      Name(_HID, "ACPI0007")

      Name(_UID, One)

    }

#else

#ifdef CPU_2

    Device(CPU2) {

      Name(_HID, "ACPI0007")

      Name(_UID, 2)

    }

#endif

#endif

  

  } // _SB

}

When complied with

iasl.exe -l -D CPU_1 Dsdt.asl

causes the errors below:

Intel ACPI Component Architecture

ASL Optimizing Compiler version 20130517-32 [May 17 2013]

Copyright (c) 2000 - 2013 Intel Corporation

 

Dsdt.asl     37: //

Error    6126 -^ syntax error, unexpected $end, expecting PARSEOP_DEFINITIONBLOCK

 

Dsdt.asl     31: #endif

Error    6142 -  ^ Mismatched #endif (Preprocessor)

 

ASL Input:     Dsdt.asl - 38 lines, 0 bytes, 0 keywords

Listing File:  Dsdt.lst - 199 bytes

 

Compilation complete. 2 Errors, 0 Warnings, 0 Remarks, 0 Optimizations

Dsdt.i (Preprocessor Output file) Could not delete: Permission denied

Dsdt.src (Source Output file) Could not delete: Permission denied

-----Original Message-----
From: Moore, Robert [mailto:robert.moore@intel.com]
Sent: 17 May 2013 22:08
To: Alexei Fedorov
Subject: RE: -D <symbol> Preprocessor Option Doesn't Work

 

We did a new release today, so you can just grab the windows binary from the website.

The fix for -D is in the release.

 

Bob

 

 

> -----Original Message-----

> From: devel-bounces@acpica.org [mailto:devel-bounces@acpica.org] On Behalf

> Of Alexei Fedorov

> Sent: Friday, May 17, 2013 3:16 AM

> To: devel@acpica.org

> Subject: Re: [Devel] -D <symbol> Preprocessor Option Doesn't Work

>

> >Yes, it looks like it has been there a while.

> >You can checkout the patch, or I can send you an updated windows binary.

> Hi Robert,

> Please send me an updated binary.

> Thanks.

> -----Original Message-----

> From: devel-bounces@acpica.org [mailto:devel-bounces@acpica.org] On Behalf

> Of devel-request@acpica.org

> Sent: 16 May 2013 18:09

> To: devel@acpica.org

> Subject: Devel Digest, Vol 38, Issue 5

>

> Send Devel mailing list submissions to

>         devel@acpica.org

>

> To subscribe or unsubscribe via the World Wide Web, visit

>         https://lists.acpica.org/mailman/listinfo/devel

> or, via email, send a message with subject or body 'help' to

>         devel-request@acpica.org

>

> You can reach the person managing the list at

>         devel-owner@acpica.org

>

> When replying, please edit your Subject line so it is more specific than

> "Re: Contents of Devel digest..."

>

>

> Today's Topics:

>

>    1. Re: -D <symbol> Preprocessor Option Doesn't Work (Moore, Robert)

>    2. Re: -D <symbol> Preprocessor Option Doesn't Work (Moore, Robert)

>

>

> ----------------------------------------------------------------------

>

> Message: 1

> Date: Thu, 16 May 2013 15:59:17 +0000

> From: "Moore, Robert" <robert.moore@intel.com>

> To: Alexei Fedorov <Alexei.Fedorov@arm.com>, "devel@acpica.org"

>         <devel@acpica.org>

> Subject: Re: [Devel] -D <symbol> Preprocessor Option Doesn't Work

> Message-ID:

>

> <94F2FBAB4432B54E8AACC7DFDE6C92E36FE6C321@ORSMSX103.amr.corp.intel.com>

>

> Content-Type: text/plain; charset="us-ascii"

>

> The fix for this is checked into our git tree.

> Bob

> From: devel-bounces@acpica.org [mailto:devel-bounces@acpica.org] On Behalf

> Of Moore, Robert

> Sent: Wednesday, May 15, 2013 10:33 AM

> To: Alexei Fedorov; devel@acpica.org

> Subject: Re: [Devel] -D <symbol> Preprocessor Option Doesn't Work

>

> Sorry, we did some code restructuring and broke this. You can go back to

> an earlier version of the compiler, or wait until later this week when

> there will be a new version.

> Bob

> From: devel-bounces@acpica.org<mailto:devel-bounces@acpica.org>

> [mailto:devel-bounces@acpica.org] On Behalf Of Moore, Robert

> Sent: Wednesday, May 15, 2013 8:43 AM

> To: Alexei Fedorov; devel@acpica.org<mailto:devel@acpica.org>

> Subject: Re: [Devel] -D <symbol> Preprocessor Option Doesn't Work

>

> We will check it out.

> Thanks,

> Bob

> From: devel-bounces@acpica.org<mailto:devel-bounces@acpica.org>

> [mailto:devel-bounces@acpica.org] On Behalf Of Alexei Fedorov

> Sent: Tuesday, May 14, 2013 5:27 AM

> To: devel@acpica.org<mailto:devel@acpica.org>

> Subject: [Devel] -D <symbol> Preprocessor Option Doesn't Work

>

> Hi,

>

> ASL User Guide states that #ifdef statements are recognized when a symbol

> is defined in the command line:

>

> "3.3.2.2 #ifdef

> Usage:

> #ifdef symbol

> Conditionally compile a block of text. The block is included in the

> compilation if the symbol is defined, either from a #define or from the -

> D command line option"

>

> but I cannot make ASL Compiler to recognize the following option

>   -D <symbol>       Define symbol for preprocessor use

>

> In the example below

>

> DefinitionBlock("DSDT.AML", "DSDT", 0x01, "      ", "        ", 3) {

>   Scope(_SB) {

>     Device(CPU0) {

>       Name(_HID, "ACPI0007")

>       Name(_UID, Zero)

>     }

> #ifdef CPU_1

>     Device(CPU1) {

>               Name(_HID, "ACPI0007")

>               Name(_UID, One)

>     }

> #endif

>   }

> }

>

> The section between #ifdef CPU_1 ... #endif is not being compiled when ASL

> is invoked as:

> iasl.exe -l -D CPU_1 Dsdt.asl

> Checked with the latest version 20130418-32 [Apr 18 2013].

>

> Any thoughts on what might be going wrong here?

> Thanks.

>

>

>

> -- IMPORTANT NOTICE: The contents of this email and any attachments are

> confidential and may also be privileged. If you are not the intended

> recipient, please notify the sender immediately and do not disclose the

> contents to any other person, use it for any purpose, or store or copy the

> information in any medium. Thank you.

> -------------- next part --------------

> An HTML attachment was scrubbed...

> URL:

> <http://lists.acpica.org/pipermail/devel/attachments/20130516/6cc648cb/att

> achment-0001.html>

>

> ------------------------------

>

> Message: 2

> Date: Thu, 16 May 2013 17:12:44 +0000

> From: "Moore, Robert" <robert.moore@intel.com>

> To: Alexei Fedorov <Alexei.Fedorov@arm.com>, "devel@acpica.org"

>         <devel@acpica.org>

> Subject: Re: [Devel] -D <symbol> Preprocessor Option Doesn't Work

> Message-ID:

>

> <94F2FBAB4432B54E8AACC7DFDE6C92E36FE6C3B5@ORSMSX103.amr.corp.intel.com>

>

> Content-Type: text/plain; charset="us-ascii"

>

> Yes, it looks like it has been there a while.

> You can checkout the patch, or I can send you an updated windows binary.

>

>

> From: Alexei Fedorov [mailto:Alexei.Fedorov@arm.com]

> Sent: Thursday, May 16, 2013 3:17 AM

> To: Moore, Robert; devel@acpica.org

> Subject: RE: -D <symbol> Preprocessor Option Doesn't Work

>

> Hi Robert,

> I tried that with 4 previous versions of compiler & still got the same

> issue.

> Regards.

> Alexei.

>

> From: Moore, Robert [mailto:robert.moore@intel.com]

> Sent: 15 May 2013 18:33

> To: Alexei Fedorov; devel@acpica.org<mailto:devel@acpica.org>

> Subject: RE: -D <symbol> Preprocessor Option Doesn't Work

>

> Sorry, we did some code restructuring and broke this. You can go back to

> an earlier version of the compiler, or wait until later this week when

> there will be a new version.

> Bob

> From: devel-bounces@acpica.org<mailto:devel-bounces@acpica.org>

> [mailto:devel-bounces@acpica.org] On Behalf Of Moore, Robert

> Sent: Wednesday, May 15, 2013 8:43 AM

> To: Alexei Fedorov; devel@acpica.org<mailto:devel@acpica.org>

> Subject: Re: [Devel] -D <symbol> Preprocessor Option Doesn't Work

>

> We will check it out.

> Thanks,

> Bob

> From: devel-bounces@acpica.org<mailto:devel-bounces@acpica.org>

> [mailto:devel-bounces@acpica.org] On Behalf Of Alexei Fedorov

> Sent: Tuesday, May 14, 2013 5:27 AM

> To: devel@acpica.org<mailto:devel@acpica.org>

> Subject: [Devel] -D <symbol> Preprocessor Option Doesn't Work

>

> Hi,

>

> ASL User Guide states that #ifdef statements are recognized when a symbol

> is defined in the command line:

>

> "3.3.2.2 #ifdef

> Usage:

> #ifdef symbol

> Conditionally compile a block of text. The block is included in the

> compilation if the symbol is defined, either from a #define or from the -

> D command line option"

>

> but I cannot make ASL Compiler to recognize the following option

>   -D <symbol>       Define symbol for preprocessor use

>

> In the example below

>

> DefinitionBlock("DSDT.AML", "DSDT", 0x01, "      ", "        ", 3) {

>   Scope(_SB) {

>     Device(CPU0) {

>       Name(_HID, "ACPI0007")

>       Name(_UID, Zero)

>     }

> #ifdef CPU_1

>     Device(CPU1) {

>               Name(_HID, "ACPI0007")

>               Name(_UID, One)

>     }

> #endif

>   }

> }

>

> The section between #ifdef CPU_1 ... #endif is not being compiled when ASL

> is invoked as:

> iasl.exe -l -D CPU_1 Dsdt.asl

> Checked with the latest version 20130418-32 [Apr 18 2013].

>

> Any thoughts on what might be going wrong here?

> Thanks.

>

>

>

> -- IMPORTANT NOTICE: The contents of this email and any attachments are

> confidential and may also be privileged. If you are not the intended

> recipient, please notify the sender immediately and do not disclose the

> contents to any other person, use it for any purpose, or store or copy the

> information in any medium. Thank you.

>

> -- IMPORTANT NOTICE: The contents of this email and any attachments are

> confidential and may also be privileged. If you are not the intended

> recipient, please notify the sender immediately and do not disclose the

> contents to any other person, use it for any purpose, or store or copy the

> information in any medium. Thank you.

> -------------- next part --------------

> An HTML attachment was scrubbed...

> URL:

> <http://lists.acpica.org/pipermail/devel/attachments/20130516/eb8a496a/att

> achment.html>

>

> ------------------------------

>

> _______________________________________________

> Devel mailing list

> Devel@acpica.org

> https://lists.acpica.org/mailman/listinfo/devel

>

> End of Devel Digest, Vol 38, Issue 5

> ************************************

>

>

> -- IMPORTANT NOTICE: The contents of this email and any attachments are

> confidential and may also be privileged. If you are not the intended

> recipient, please notify the sender immediately and do not disclose the

> contents to any other person, use it for any purpose, or store or copy the

> information in any medium.  Thank you.

>

> _______________________________________________

> Devel mailing list

> Devel@acpica.org

> https://lists.acpica.org/mailman/listinfo/devel

 


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.