kernel/acpica/compiler/cvcompiler.c
/*******************************************************************************
 *
 * FUNCTION:    CgWriteAmlDefBlockComment
 *
 * PARAMETERS:  Op              - Current parse op
 *
 * RETURN:      None
 *
 * DESCRIPTION: Write all comments for a particular definition block.
 *              For definition blocks, the comments need to come after the
 *              definition block header. The regular comments above the
 *              definition block would be categorized as
 *              STD_DEFBLK_COMMENT and comments after the closing brace
 *              is categorized as END_DEFBLK_COMMENT.
 *
 ******************************************************************************/
CgWriteAmlDefBlockComment
PARAMETERS:  Op              - Current parse op

None

Write all comments for a particular definition block.
For definition blocks, the comments need to come after the
definition block header. The regular comments above the
definition block would be categorized as
STD_DEFBLK_COMMENT and comments after the closing brace
is categorized as END_DEFBLK_COMMENT.
CgWriteAmlDefBlockComment PARAMETERS : Op - Current parse op None Write all comments for a particular definition block . For definition blocks the comments need to come after the definition block header . The regular comments above the definition block would be categorized as STD_DEFBLK_COMMENT and comments after the closing brace is categorized as END_DEFBLK_COMMENT .
void
CgWriteAmlDefBlockComment(
    ACPI_PARSE_OBJECT       *Op)
{
    UINT8                   CommentOption;
    ACPI_COMMENT_NODE       *Current;
    char                    *NewFilename;
    char                    *Position;
    char                    *DirectoryPosition;
    if (!Gbl_CaptureComments ||
        (Op->Asl.ParseOpcode != PARSEOP_DEFINITION_BLOCK))
    {
        return;
    }
    CvDbgPrint ("Printing comments for a definition block..\n");
    NewFilename = UtStringCacheCalloc (strlen (Op->Asl.Filename));
    strcpy (NewFilename, Op->Asl.Filename);
    DirectoryPosition = strrchr (NewFilename, '/');
    Position = strrchr (NewFilename, '.');
    if (Position && (Position > DirectoryPosition))
    {
        Position++;
        *Position = 0;
        strcat (Position, FILE_SUFFIX_DISASSEMBLY);
    }
    else
    {
        strcat (NewFilename, ".");
        strcat (NewFilename, FILE_SUFFIX_DISASSEMBLY);
    }
    CommentOption = FILENAME_COMMENT;
    CgWriteOneAmlComment(Op, NewFilename, CommentOption);
    Current = Op->Asl.CommentList;
    CommentOption = STD_DEFBLK_COMMENT;
    while (Current)
    {
        CgWriteOneAmlComment(Op, Current->Comment, CommentOption);
        CvDbgPrint ("Printing comment: %s\n", Current->Comment);
        Current = Current->Next;
    }
    Op->Asl.CommentList = NULL;
    if (Op->Asl.CloseBraceComment)
    {
        CommentOption = END_DEFBLK_COMMENT;
        CgWriteOneAmlComment(Op, Op->Asl.CloseBraceComment, CommentOption);
        Op->Asl.CloseBraceComment = NULL;
    }
}
void CgWriteAmlDefBlockComment ( ACPI_PARSE_OBJECT * Op ) { UINT8 CommentOption ; ACPI_COMMENT_NODE * Current ; char * NewFilename ; char * Position ; char * DirectoryPosition ; if ( ! Gbl_CaptureComments || ( Op -> Asl . ParseOpcode != PARSEOP_DEFINITION_BLOCK ) ) { return ; } CvDbgPrint ( " \n " ) ; NewFilename = UtStringCacheCalloc ( strlen ( Op -> Asl . Filename ) ) ; strcpy ( NewFilename , Op -> Asl . Filename ) ; DirectoryPosition = strrchr ( NewFilename , ' ' ) ; Position = strrchr ( NewFilename , ' ' ) ; if ( Position && ( Position > DirectoryPosition ) ) { Position ++ ; * Position = 0 ; strcat ( Position , FILE_SUFFIX_DISASSEMBLY ) ; } else { strcat ( NewFilename , " " ) ; strcat ( NewFilename , FILE_SUFFIX_DISASSEMBLY ) ; } CommentOption = FILENAME_COMMENT ; CgWriteOneAmlComment ( Op , NewFilename , CommentOption ) ; Current = Op -> Asl . CommentList ; CommentOption = STD_DEFBLK_COMMENT ; while ( Current ) { CgWriteOneAmlComment ( Op , Current -> Comment , CommentOption ) ; CvDbgPrint ( " \n " , Current -> Comment ) ; Current = Current -> Next ; } Op -> Asl . CommentList = NULL ; if ( Op -> Asl . CloseBraceComment ) { CommentOption = END_DEFBLK_COMMENT ; CgWriteOneAmlComment ( Op , Op -> Asl . CloseBraceComment , CommentOption ) ; Op -> Asl . CloseBraceComment = NULL ; } }
FUNCTION:    CgWriteAmlDefBlockComment
 PARAMETERS:  Op              - Current parse op
FUNCTION : CgWriteAmlDefBlockComment PARAMETERS : Op - Current parse op
/* First, print the file name comment after changing .asl to .dsl */ /* Tack on the new suffix */ /* No dot, add one and then the suffix */ /* Print any Inline comments associated with this node */