Also document BGE_FAKE_AUTONEG in LINT.
[dragonfly.git] / sys / contrib / dev / acpica / rsirq.c
1 /*******************************************************************************
2  *
3  * Module Name: rsirq - IRQ resource descriptors
4  *              $Revision: 32 $
5  *
6  ******************************************************************************/
7
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
13  * All rights reserved.
14  *
15  * 2. License
16  *
17  * 2.1. This is your license from Intel Corp. under its intellectual property
18  * rights.  You may have additional license terms from the party that provided
19  * you this software, covering your right to use that party's intellectual
20  * property rights.
21  *
22  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23  * copy of the source code appearing in this file ("Covered Code") an
24  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25  * base code distributed originally by Intel ("Original Intel Code") to copy,
26  * make derivatives, distribute, use and display any portion of the Covered
27  * Code in any form, with the right to sublicense such rights; and
28  *
29  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30  * license (with the right to sublicense), under only those claims of Intel
31  * patents that are infringed by the Original Intel Code, to make, use, sell,
32  * offer to sell, and import the Covered Code and derivative works thereof
33  * solely to the minimum extent necessary to exercise the above copyright
34  * license, and in no event shall the patent license extend to any additions
35  * to or modifications of the Original Intel Code.  No other license or right
36  * is granted directly or by implication, estoppel or otherwise;
37  *
38  * The above copyright and patent license is granted only if the following
39  * conditions are met:
40  *
41  * 3. Conditions
42  *
43  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44  * Redistribution of source code of any substantial portion of the Covered
45  * Code or modification with rights to further distribute source must include
46  * the above Copyright Notice, the above License, this list of Conditions,
47  * and the following Disclaimer and Export Compliance provision.  In addition,
48  * Licensee must cause all Covered Code to which Licensee contributes to
49  * contain a file documenting the changes Licensee made to create that Covered
50  * Code and the date of any change.  Licensee must include in that file the
51  * documentation of any changes made by any predecessor Licensee.  Licensee
52  * must include a prominent statement that the modification is derived,
53  * directly or indirectly, from Original Intel Code.
54  *
55  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56  * Redistribution of source code of any substantial portion of the Covered
57  * Code or modification without rights to further distribute source must
58  * include the following Disclaimer and Export Compliance provision in the
59  * documentation and/or other materials provided with distribution.  In
60  * addition, Licensee may not authorize further sublicense of source of any
61  * portion of the Covered Code, and must include terms to the effect that the
62  * license from Licensee to its licensee is limited to the intellectual
63  * property embodied in the software Licensee provides to its licensee, and
64  * not to intellectual property embodied in modifications its licensee may
65  * make.
66  *
67  * 3.3. Redistribution of Executable. Redistribution in executable form of any
68  * substantial portion of the Covered Code or modification must reproduce the
69  * above Copyright Notice, and the following Disclaimer and Export Compliance
70  * provision in the documentation and/or other materials provided with the
71  * distribution.
72  *
73  * 3.4. Intel retains all right, title, and interest in and to the Original
74  * Intel Code.
75  *
76  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77  * Intel shall be used in advertising or otherwise to promote the sale, use or
78  * other dealings in products derived from or relating to the Covered Code
79  * without prior written authorization from Intel.
80  *
81  * 4. Disclaimer and Export Compliance
82  *
83  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89  * PARTICULAR PURPOSE.
90  *
91  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98  * LIMITED REMEDY.
99  *
100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
101  * software or system incorporating such software without first obtaining any
102  * required license or other approval from the U. S. Department of Commerce or
103  * any other agency or department of the United States Government.  In the
104  * event Licensee exports any such software from the United States or
105  * re-exports any such software from a foreign destination, Licensee shall
106  * ensure that the distribution and export/re-export of the software is in
107  * compliance with all laws, regulations, orders, or other restrictions of the
108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109  * any of its subsidiaries will export/re-export any technical data, process,
110  * software, or service, directly or indirectly, to any country for which the
111  * United States government or any agency thereof requires an export license,
112  * other governmental approval, or letter of assurance, without first obtaining
113  * such license, approval or letter.
114  *
115  *****************************************************************************/
116 /* $DragonFly: src/sys/contrib/dev/acpica/Attic/rsirq.c,v 1.1 2003/09/24 03:32:16 drhodus Exp $                                                               */
117
118 #define __RSIRQ_C__
119
120 #include "acpi.h"
121 #include "acresrc.h"
122
123 #define _COMPONENT          ACPI_RESOURCES
124         ACPI_MODULE_NAME    ("rsirq")
125
126
127 /*******************************************************************************
128  *
129  * FUNCTION:    AcpiRsIrqResource
130  *
131  * PARAMETERS:  ByteStreamBuffer        - Pointer to the resource input byte
132  *                                        stream
133  *              BytesConsumed           - Pointer to where the number of bytes
134  *                                        consumed the ByteStreamBuffer is
135  *                                        returned
136  *              OutputBuffer            - Pointer to the return data buffer
137  *              StructureSize           - Pointer to where the number of bytes
138  *                                        in the return data struct is returned
139  *
140  * RETURN:      Status
141  *
142  * DESCRIPTION: Take the resource byte stream and fill out the appropriate
143  *              structure pointed to by the OutputBuffer.  Return the
144  *              number of bytes consumed from the byte stream.
145  *
146  ******************************************************************************/
147
148 ACPI_STATUS
149 AcpiRsIrqResource (
150     UINT8                   *ByteStreamBuffer,
151     ACPI_SIZE               *BytesConsumed,
152     UINT8                   **OutputBuffer,
153     ACPI_SIZE               *StructureSize)
154 {
155     UINT8                   *Buffer = ByteStreamBuffer;
156     ACPI_RESOURCE           *OutputStruct = (void *) *OutputBuffer;
157     UINT16                  Temp16 = 0;
158     UINT8                   Temp8 = 0;
159     UINT8                   Index;
160     UINT8                   i;
161     ACPI_SIZE               StructSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_IRQ);
162
163
164     ACPI_FUNCTION_TRACE ("RsIrqResource");
165
166
167     /*
168      * The number of bytes consumed are contained in the descriptor
169      *  (Bits:0-1)
170      */
171     Temp8 = *Buffer;
172     *BytesConsumed = (Temp8 & 0x03) + 1;
173     OutputStruct->Id = ACPI_RSTYPE_IRQ;
174
175     /*
176      * Point to the 16-bits of Bytes 1 and 2
177      */
178     Buffer += 1;
179     ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
180
181     OutputStruct->Data.Irq.NumberOfInterrupts = 0;
182
183     /* Decode the IRQ bits */
184
185     for (i = 0, Index = 0; Index < 16; Index++)
186     {
187         if ((Temp16 >> Index) & 0x01)
188         {
189             OutputStruct->Data.Irq.Interrupts[i] = Index;
190             i++;
191         }
192     }
193
194     /* Zero interrupts is valid */
195
196     OutputStruct->Data.Irq.NumberOfInterrupts = i;
197     if (i > 0)
198     {
199         /*
200          * Calculate the structure size based upon the number of interrupts
201          */
202         StructSize += ((ACPI_SIZE) i - 1) * 4;
203     }
204
205     /*
206      * Point to Byte 3 if it is used
207      */
208     if (4 == *BytesConsumed)
209     {
210         Buffer += 2;
211         Temp8 = *Buffer;
212
213         /*
214          * Check for HE, LL or HL
215          */
216         if (Temp8 & 0x01)
217         {
218             OutputStruct->Data.Irq.EdgeLevel = ACPI_EDGE_SENSITIVE;
219             OutputStruct->Data.Irq.ActiveHighLow = ACPI_ACTIVE_HIGH;
220         }
221         else
222         {
223             if (Temp8 & 0x8)
224             {
225                 OutputStruct->Data.Irq.EdgeLevel = ACPI_LEVEL_SENSITIVE;
226                 OutputStruct->Data.Irq.ActiveHighLow = ACPI_ACTIVE_LOW;
227             }
228             else
229             {
230                 /*
231                  * Only _LL and _HE polarity/trigger interrupts
232                  * are allowed (ACPI spec v1.0b ection 6.4.2.1),
233                  * so an error will occur if we reach this point
234                  */
235                 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid interrupt polarity/trigger in resource list\n"));
236                 return_ACPI_STATUS (AE_BAD_DATA);
237             }
238         }
239
240         /*
241          * Check for sharable
242          */
243         OutputStruct->Data.Irq.SharedExclusive = (Temp8 >> 3) & 0x01;
244     }
245     else
246     {
247         /*
248          * Assume Edge Sensitive, Active High, Non-Sharable
249          * per ACPI Specification
250          */
251         OutputStruct->Data.Irq.EdgeLevel = ACPI_EDGE_SENSITIVE;
252         OutputStruct->Data.Irq.ActiveHighLow = ACPI_ACTIVE_HIGH;
253         OutputStruct->Data.Irq.SharedExclusive = ACPI_EXCLUSIVE;
254     }
255
256     /*
257      * Set the Length parameter
258      */
259     OutputStruct->Length = (UINT32) StructSize;
260
261     /*
262      * Return the final size of the structure
263      */
264     *StructureSize = StructSize;
265     return_ACPI_STATUS (AE_OK);
266 }
267
268
269 /*******************************************************************************
270  *
271  * FUNCTION:    AcpiRsIrqStream
272  *
273  * PARAMETERS:  LinkedList              - Pointer to the resource linked list
274  *              OutputBuffer            - Pointer to the user's return buffer
275  *              BytesConsumed           - Pointer to where the number of bytes
276  *                                        used in the OutputBuffer is returned
277  *
278  * RETURN:      Status
279  *
280  * DESCRIPTION: Take the linked list resource structure and fills in the
281  *              the appropriate bytes in a byte stream
282  *
283  ******************************************************************************/
284
285 ACPI_STATUS
286 AcpiRsIrqStream (
287     ACPI_RESOURCE           *LinkedList,
288     UINT8                   **OutputBuffer,
289     ACPI_SIZE               *BytesConsumed)
290 {
291     UINT8                   *Buffer = *OutputBuffer;
292     UINT16                  Temp16 = 0;
293     UINT8                   Temp8 = 0;
294     UINT8                   Index;
295     BOOLEAN                 IRQInfoByteNeeded;
296
297
298     ACPI_FUNCTION_TRACE ("RsIrqStream");
299
300
301     /*
302      * The descriptor field is set based upon whether a third byte is
303      * needed to contain the IRQ Information.
304      */
305     if (ACPI_EDGE_SENSITIVE == LinkedList->Data.Irq.EdgeLevel &&
306         ACPI_ACTIVE_HIGH == LinkedList->Data.Irq.ActiveHighLow &&
307         ACPI_EXCLUSIVE == LinkedList->Data.Irq.SharedExclusive)
308     {
309         *Buffer = 0x22;
310         IRQInfoByteNeeded = FALSE;
311     }
312     else
313     {
314         *Buffer = 0x23;
315         IRQInfoByteNeeded = TRUE;
316     }
317
318     Buffer += 1;
319     Temp16 = 0;
320
321     /*
322      * Loop through all of the interrupts and set the mask bits
323      */
324     for(Index = 0;
325         Index < LinkedList->Data.Irq.NumberOfInterrupts;
326         Index++)
327     {
328         Temp8 = (UINT8) LinkedList->Data.Irq.Interrupts[Index];
329         Temp16 |= 0x1 << Temp8;
330     }
331
332     ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &Temp16);
333     Buffer += 2;
334
335     /*
336      * Set the IRQ Info byte if needed.
337      */
338     if (IRQInfoByteNeeded)
339     {
340         Temp8 = 0;
341         Temp8 = (UINT8) ((LinkedList->Data.Irq.SharedExclusive &
342                           0x01) << 4);
343
344         if (ACPI_LEVEL_SENSITIVE == LinkedList->Data.Irq.EdgeLevel &&
345             ACPI_ACTIVE_LOW == LinkedList->Data.Irq.ActiveHighLow)
346         {
347             Temp8 |= 0x08;
348         }
349         else
350         {
351             Temp8 |= 0x01;
352         }
353
354         *Buffer = Temp8;
355         Buffer += 1;
356     }
357
358     /*
359      * Return the number of bytes consumed in this operation
360      */
361     *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
362     return_ACPI_STATUS (AE_OK);
363 }
364
365
366 /*******************************************************************************
367  *
368  * FUNCTION:    AcpiRsExtendedIrqResource
369  *
370  * PARAMETERS:  ByteStreamBuffer        - Pointer to the resource input byte
371  *                                        stream
372  *              BytesConsumed           - Pointer to where the number of bytes
373  *                                        consumed the ByteStreamBuffer is
374  *                                        returned
375  *              OutputBuffer            - Pointer to the return data buffer
376  *              StructureSize           - Pointer to where the number of bytes
377  *                                        in the return data struct is returned
378  *
379  * RETURN:      Status
380  *
381  * DESCRIPTION: Take the resource byte stream and fill out the appropriate
382  *              structure pointed to by the OutputBuffer.  Return the
383  *              number of bytes consumed from the byte stream.
384  *
385  ******************************************************************************/
386
387 ACPI_STATUS
388 AcpiRsExtendedIrqResource (
389     UINT8                   *ByteStreamBuffer,
390     ACPI_SIZE               *BytesConsumed,
391     UINT8                   **OutputBuffer,
392     ACPI_SIZE               *StructureSize)
393 {
394     UINT8                   *Buffer = ByteStreamBuffer;
395     ACPI_RESOURCE           *OutputStruct = (void *) *OutputBuffer;
396     UINT16                  Temp16 = 0;
397     UINT8                   Temp8 = 0;
398     UINT8                   *TempPtr;
399     UINT8                   Index;
400     ACPI_SIZE               StructSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_EXT_IRQ);
401
402
403     ACPI_FUNCTION_TRACE ("RsExtendedIrqResource");
404
405
406     /*
407      * Point past the Descriptor to get the number of bytes consumed
408      */
409     Buffer += 1;
410     ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
411
412     *BytesConsumed = Temp16 + 3;
413     OutputStruct->Id = ACPI_RSTYPE_EXT_IRQ;
414
415     /*
416      * Point to the Byte3
417      */
418     Buffer += 2;
419     Temp8 = *Buffer;
420
421     OutputStruct->Data.ExtendedIrq.ProducerConsumer = Temp8 & 0x01;
422
423     /*
424      * Check for Interrupt Mode
425      *
426      * The definition of an Extended IRQ changed between ACPI spec v1.0b
427      * and ACPI spec 2.0 (section 6.4.3.6 in both).
428      *
429      * - Edge/Level are defined opposite in the table vs the headers
430      */
431     OutputStruct->Data.ExtendedIrq.EdgeLevel =
432                         (Temp8 & 0x2) ? ACPI_EDGE_SENSITIVE : ACPI_LEVEL_SENSITIVE;
433
434     /*
435      * Check Interrupt Polarity
436      */
437     OutputStruct->Data.ExtendedIrq.ActiveHighLow = (Temp8 >> 2) & 0x1;
438
439     /*
440      * Check for sharable
441      */
442     OutputStruct->Data.ExtendedIrq.SharedExclusive = (Temp8 >> 3) & 0x01;
443
444     /*
445      * Point to Byte4 (IRQ Table length)
446      */
447     Buffer += 1;
448     Temp8 = *Buffer;
449
450     OutputStruct->Data.ExtendedIrq.NumberOfInterrupts = Temp8;
451
452     /*
453      * Add any additional structure size to properly calculate
454      * the next pointer at the end of this function
455      */
456     StructSize += (Temp8 - 1) * 4;
457
458     /*
459      * Point to Byte5 (First IRQ Number)
460      */
461     Buffer += 1;
462
463     /*
464      * Cycle through every IRQ in the table
465      */
466     for (Index = 0; Index < Temp8; Index++)
467     {
468         ACPI_MOVE_UNALIGNED32_TO_32 (
469             &OutputStruct->Data.ExtendedIrq.Interrupts[Index], Buffer);
470
471         /* Point to the next IRQ */
472
473         Buffer += 4;
474     }
475
476     /*
477      * This will leave us pointing to the Resource Source Index
478      * If it is present, then save it off and calculate the
479      * pointer to where the null terminated string goes:
480      * Each Interrupt takes 32-bits + the 5 bytes of the
481      * stream that are default.
482      */
483     if (*BytesConsumed >
484         ((ACPI_SIZE) OutputStruct->Data.ExtendedIrq.NumberOfInterrupts * 4) + 5)
485     {
486         /* Dereference the Index */
487
488         Temp8 = *Buffer;
489         OutputStruct->Data.ExtendedIrq.ResourceSource.Index = (UINT32) Temp8;
490
491         /* Point to the String */
492
493         Buffer += 1;
494
495         /*
496          * Point the String pointer to the end of this structure.
497          */
498         OutputStruct->Data.ExtendedIrq.ResourceSource.StringPtr =
499                 (char *)(OutputStruct + StructSize);
500
501         TempPtr = (UINT8 *) OutputStruct->Data.ExtendedIrq.ResourceSource.StringPtr;
502
503         /* Copy the string into the buffer */
504
505         Index = 0;
506         while (0x00 != *Buffer)
507         {
508             *TempPtr = *Buffer;
509
510             TempPtr += 1;
511             Buffer += 1;
512             Index += 1;
513         }
514
515         /*
516          * Add the terminating null
517          */
518         *TempPtr = 0x00;
519         OutputStruct->Data.ExtendedIrq.ResourceSource.StringLength = Index + 1;
520
521         /*
522          * In order for the StructSize to fall on a 32-bit boundary,
523          * calculate the length of the string and expand the
524          * StructSize to the next 32-bit boundary.
525          */
526         Temp8 = (UINT8) (Index + 1);
527         StructSize += ACPI_ROUND_UP_TO_32BITS (Temp8);
528     }
529     else
530     {
531         OutputStruct->Data.ExtendedIrq.ResourceSource.Index = 0x00;
532         OutputStruct->Data.ExtendedIrq.ResourceSource.StringLength = 0;
533         OutputStruct->Data.ExtendedIrq.ResourceSource.StringPtr = NULL;
534     }
535
536     /*
537      * Set the Length parameter
538      */
539     OutputStruct->Length = (UINT32) StructSize;
540
541     /*
542      * Return the final size of the structure
543      */
544     *StructureSize = StructSize;
545     return_ACPI_STATUS (AE_OK);
546 }
547
548
549 /*******************************************************************************
550  *
551  * FUNCTION:    AcpiRsExtendedIrqStream
552  *
553  * PARAMETERS:  LinkedList              - Pointer to the resource linked list
554  *              OutputBuffer            - Pointer to the user's return buffer
555  *              BytesConsumed           - Pointer to where the number of bytes
556  *                                        used in the OutputBuffer is returned
557  *
558  * RETURN:      Status
559  *
560  * DESCRIPTION: Take the linked list resource structure and fills in the
561  *              the appropriate bytes in a byte stream
562  *
563  ******************************************************************************/
564
565 ACPI_STATUS
566 AcpiRsExtendedIrqStream (
567     ACPI_RESOURCE           *LinkedList,
568     UINT8                   **OutputBuffer,
569     ACPI_SIZE               *BytesConsumed)
570 {
571     UINT8                   *Buffer = *OutputBuffer;
572     UINT16                  *LengthField;
573     UINT8                   Temp8 = 0;
574     UINT8                   Index;
575     char                    *TempPointer = NULL;
576
577
578     ACPI_FUNCTION_TRACE ("RsExtendedIrqStream");
579
580
581     /*
582      * The descriptor field is static
583      */
584     *Buffer = 0x89;
585     Buffer += 1;
586
587     /*
588      * Set a pointer to the Length field - to be filled in later
589      */
590     LengthField = ACPI_CAST_PTR (UINT16, Buffer);
591     Buffer += 2;
592
593     /*
594      * Set the Interrupt vector flags
595      */
596     Temp8 = (UINT8)(LinkedList->Data.ExtendedIrq.ProducerConsumer & 0x01);
597     Temp8 |= ((LinkedList->Data.ExtendedIrq.SharedExclusive & 0x01) << 3);
598
599     /*
600      * Set the Interrupt Mode
601      *
602      * The definition of an Extended IRQ changed between ACPI spec v1.0b
603      * and ACPI spec 2.0 (section 6.4.3.6 in both).  This code does not
604      * implement the more restrictive definition of 1.0b
605      *
606      * - Edge/Level are defined opposite in the table vs the headers
607      */
608     if (ACPI_EDGE_SENSITIVE == LinkedList->Data.ExtendedIrq.EdgeLevel)
609     {
610         Temp8 |= 0x2;
611     }
612
613     /*
614      * Set the Interrupt Polarity
615      */
616     Temp8 |= ((LinkedList->Data.ExtendedIrq.ActiveHighLow & 0x1) << 2);
617
618     *Buffer = Temp8;
619     Buffer += 1;
620
621     /*
622      * Set the Interrupt table length
623      */
624     Temp8 = (UINT8) LinkedList->Data.ExtendedIrq.NumberOfInterrupts;
625
626     *Buffer = Temp8;
627     Buffer += 1;
628
629     for (Index = 0; Index < LinkedList->Data.ExtendedIrq.NumberOfInterrupts;
630          Index++)
631     {
632         ACPI_MOVE_UNALIGNED32_TO_32 (Buffer,
633                         &LinkedList->Data.ExtendedIrq.Interrupts[Index]);
634         Buffer += 4;
635     }
636
637     /*
638      * Resource Source Index and Resource Source are optional
639      */
640     if (0 != LinkedList->Data.ExtendedIrq.ResourceSource.StringLength)
641     {
642         *Buffer = (UINT8) LinkedList->Data.ExtendedIrq.ResourceSource.Index;
643         Buffer += 1;
644
645         TempPointer = (char *) Buffer;
646
647         /*
648          * Copy the string
649          */
650         ACPI_STRCPY (TempPointer,
651             LinkedList->Data.ExtendedIrq.ResourceSource.StringPtr);
652
653         /*
654          * Buffer needs to be set to the length of the sting + one for the
655          * terminating null
656          */
657         Buffer += (ACPI_STRLEN (LinkedList->Data.ExtendedIrq.ResourceSource.StringPtr) + 1);
658     }
659
660     /*
661      * Return the number of bytes consumed in this operation
662      */
663     *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
664
665     /*
666      * Set the length field to the number of bytes consumed
667      * minus the header size (3 bytes)
668      */
669     *LengthField = (UINT16) (*BytesConsumed - 3);
670     return_ACPI_STATUS (AE_OK);
671 }
672