ReactOS  0.4.15-dev-5496-g599ba9c
rsmisc.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
Include dependency graph for rsmisc.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_RESOURCES
 
#define INIT_RESOURCE_TYPE(i)   i->ResourceOffset
 
#define INIT_RESOURCE_LENGTH(i)   i->AmlOffset
 
#define INIT_TABLE_LENGTH(i)   i->Value
 
#define COMPARE_OPCODE(i)   i->ResourceOffset
 
#define COMPARE_TARGET(i)   i->AmlOffset
 
#define COMPARE_VALUE(i)   i->Value
 

Functions

ACPI_STATUS AcpiRsConvertAmlToResource (ACPI_RESOURCE *Resource, AML_RESOURCE *Aml, ACPI_RSCONVERT_INFO *Info)
 
ACPI_STATUS AcpiRsConvertResourceToAml (ACPI_RESOURCE *Resource, AML_RESOURCE *Aml, ACPI_RSCONVERT_INFO *Info)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_RESOURCES

Definition at line 48 of file rsmisc.c.

◆ COMPARE_OPCODE

#define COMPARE_OPCODE (   i)    i->ResourceOffset

Definition at line 56 of file rsmisc.c.

◆ COMPARE_TARGET

#define COMPARE_TARGET (   i)    i->AmlOffset

Definition at line 57 of file rsmisc.c.

◆ COMPARE_VALUE

#define COMPARE_VALUE (   i)    i->Value

Definition at line 58 of file rsmisc.c.

◆ INIT_RESOURCE_LENGTH

#define INIT_RESOURCE_LENGTH (   i)    i->AmlOffset

Definition at line 53 of file rsmisc.c.

◆ INIT_RESOURCE_TYPE

#define INIT_RESOURCE_TYPE (   i)    i->ResourceOffset

Definition at line 52 of file rsmisc.c.

◆ INIT_TABLE_LENGTH

#define INIT_TABLE_LENGTH (   i)    i->Value

Definition at line 54 of file rsmisc.c.

Function Documentation

◆ AcpiRsConvertAmlToResource()

ACPI_STATUS AcpiRsConvertAmlToResource ( ACPI_RESOURCE Resource,
AML_RESOURCE Aml,
ACPI_RSCONVERT_INFO Info 
)

Definition at line 77 of file rsmisc.c.

81 {
82  ACPI_RS_LENGTH AmlResourceLength;
83  void *Source;
84  void *Destination;
85  char *Target;
86  UINT8 Count;
87  UINT8 FlagsMode = FALSE;
88  UINT16 ItemCount = 0;
89  UINT16 Temp16 = 0;
90 
91 
92  ACPI_FUNCTION_TRACE (RsConvertAmlToResource);
93 
94 
95  if (!Info)
96  {
98  }
99 
100  if (((ACPI_SIZE) Resource) & 0x3)
101  {
102  /* Each internal resource struct is expected to be 32-bit aligned */
103 
105  "Misaligned resource pointer (get): %p Type 0x%2.2X Length %u",
106  Resource, Resource->Type, Resource->Length));
107  }
108 
109  /* Extract the resource Length field (does not include header length) */
110 
111  AmlResourceLength = AcpiUtGetResourceLength (Aml);
112 
113  /*
114  * First table entry must be ACPI_RSC_INITxxx and must contain the
115  * table length (# of table entries)
116  */
118  while (Count)
119  {
120  Target = NULL;
121 
122  /*
123  * Source is the external AML byte stream buffer,
124  * destination is the internal resource descriptor
125  */
126  Source = ACPI_ADD_PTR (void, Aml, Info->AmlOffset);
127  Destination = ACPI_ADD_PTR (void, Resource, Info->ResourceOffset);
128 
129  switch (Info->Opcode)
130  {
131  case ACPI_RSC_INITGET:
132  /*
133  * Get the resource type and the initial (minimum) length
134  */
136  Resource->Type = INIT_RESOURCE_TYPE (Info);
137  Resource->Length = INIT_RESOURCE_LENGTH (Info);
138  break;
139 
140  case ACPI_RSC_INITSET:
141  break;
142 
143  case ACPI_RSC_FLAGINIT:
144 
145  FlagsMode = TRUE;
146  break;
147 
148  case ACPI_RSC_1BITFLAG:
149  /*
150  * Mask and shift the flag bit
151  */
153  ((ACPI_GET8 (Source) >> Info->Value) & 0x01));
154  break;
155 
156  case ACPI_RSC_2BITFLAG:
157  /*
158  * Mask and shift the flag bits
159  */
161  ((ACPI_GET8 (Source) >> Info->Value) & 0x03));
162  break;
163 
164  case ACPI_RSC_3BITFLAG:
165  /*
166  * Mask and shift the flag bits
167  */
169  ((ACPI_GET8 (Source) >> Info->Value) & 0x07));
170  break;
171 
172  case ACPI_RSC_6BITFLAG:
173  /*
174  * Mask and shift the flag bits
175  */
177  ((ACPI_GET8 (Source) >> Info->Value) & 0x3F));
178  break;
179 
180  case ACPI_RSC_COUNT:
181 
182  ItemCount = ACPI_GET8 (Source);
183  ACPI_SET8 (Destination, ItemCount);
184 
185  Resource->Length = Resource->Length +
186  (Info->Value * (ItemCount - 1));
187  break;
188 
189  case ACPI_RSC_COUNT16:
190 
191  ItemCount = AmlResourceLength;
192  ACPI_SET16 (Destination, ItemCount);
193 
194  Resource->Length = Resource->Length +
195  (Info->Value * (ItemCount - 1));
196  break;
197 
199 
200  Target = ACPI_ADD_PTR (void, Aml, Info->Value);
201  ItemCount = ACPI_GET16 (Target) - ACPI_GET16 (Source);
202 
203  Resource->Length = Resource->Length + ItemCount;
204  ItemCount = ItemCount / 2;
205  ACPI_SET16 (Destination, ItemCount);
206  break;
207 
209 
210  ItemCount = ACPI_GET8 (Source);
211  ACPI_SET8 (Destination, ItemCount);
212 
213  Resource->Length = Resource->Length + (Info->Value * ItemCount);
214  break;
215 
217  /*
218  * Vendor data is optional (length/offset may both be zero)
219  * Examine vendor data length field first
220  */
221  Target = ACPI_ADD_PTR (void, Aml, (Info->Value + 2));
222  if (ACPI_GET16 (Target))
223  {
224  /* Use vendor offset to get resource source length */
225 
226  Target = ACPI_ADD_PTR (void, Aml, Info->Value);
227  ItemCount = ACPI_GET16 (Target) - ACPI_GET16 (Source);
228  }
229  else
230  {
231  /* No vendor data to worry about */
232 
233  ItemCount = Aml->LargeHeader.ResourceLength +
234  sizeof (AML_RESOURCE_LARGE_HEADER) -
235  ACPI_GET16 (Source);
236  }
237 
238  Resource->Length = Resource->Length + ItemCount;
239  ACPI_SET16 (Destination, ItemCount);
240  break;
241 
243 
244  ItemCount = ACPI_GET16 (Source) - Info->Value;
245 
246  Resource->Length = Resource->Length + ItemCount;
247  ACPI_SET16 (Destination, ItemCount);
248  break;
249 
251 
252  ItemCount = (AmlResourceLength +
253  sizeof (AML_RESOURCE_LARGE_HEADER)) -
254  ACPI_GET16 (Source) - Info->Value;
255 
256  Resource->Length = Resource->Length + ItemCount;
257  ACPI_SET16 (Destination, ItemCount);
258  break;
259 
260  case ACPI_RSC_LENGTH:
261 
262  Resource->Length = Resource->Length + Info->Value;
263  break;
264 
265  case ACPI_RSC_MOVE8:
266  case ACPI_RSC_MOVE16:
267  case ACPI_RSC_MOVE32:
268  case ACPI_RSC_MOVE64:
269  /*
270  * Raw data move. Use the Info value field unless ItemCount has
271  * been previously initialized via a COUNT opcode
272  */
273  if (Info->Value)
274  {
275  ItemCount = Info->Value;
276  }
277  AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode);
278  break;
279 
281 
282  /* Generate and set the PIN data pointer */
283 
284  Target = (char *) ACPI_ADD_PTR (void, Resource,
285  (Resource->Length - ItemCount * 2));
287 
288  /* Copy the PIN data */
289 
290  Source = ACPI_ADD_PTR (void, Aml, ACPI_GET16 (Source));
291  AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode);
292  break;
293 
295 
296  /* Generate and set the ResourceSource string pointer */
297 
298  Target = (char *) ACPI_ADD_PTR (void, Resource,
299  (Resource->Length - ItemCount));
301 
302  /* Copy the ResourceSource string */
303 
304  Source = ACPI_ADD_PTR (void, Aml, ACPI_GET16 (Source));
305  AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode);
306  break;
307 
309 
310  /* Generate and set the Vendor Data pointer */
311 
312  Target = (char *) ACPI_ADD_PTR (void, Resource,
313  (Resource->Length - ItemCount));
315 
316  /* Copy the Vendor Data */
317 
318  Source = ACPI_ADD_PTR (void, Aml, Info->Value);
319  AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode);
320  break;
321 
323 
324  /* Generate and set the ResourceSource string pointer */
325 
326  Target = (char *) ACPI_ADD_PTR (void, Resource,
327  (Resource->Length - ItemCount));
329 
330  /* Copy the ResourceSource string */
331 
332  Source = ACPI_ADD_PTR (
333  void, Aml, (ACPI_GET16 (Source) + Info->Value));
334  AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode);
335  break;
336 
337  case ACPI_RSC_SET8:
338 
339  memset (Destination, Info->AmlOffset, Info->Value);
340  break;
341 
342  case ACPI_RSC_DATA8:
343 
344  Target = ACPI_ADD_PTR (char, Resource, Info->Value);
346  break;
347 
348  case ACPI_RSC_ADDRESS:
349  /*
350  * Common handler for address descriptor flags
351  */
353  {
355  }
356  break;
357 
358  case ACPI_RSC_SOURCE:
359  /*
360  * Optional ResourceSource (Index and String)
361  */
362  Resource->Length +=
363  AcpiRsGetResourceSource (AmlResourceLength, Info->Value,
364  Destination, Aml, NULL);
365  break;
366 
367  case ACPI_RSC_SOURCEX:
368  /*
369  * Optional ResourceSource (Index and String). This is the more
370  * complicated case used by the Interrupt() macro
371  */
372  Target = ACPI_ADD_PTR (char, Resource,
373  Info->AmlOffset + (ItemCount * 4));
374 
375  Resource->Length +=
376  AcpiRsGetResourceSource (AmlResourceLength, (ACPI_RS_LENGTH)
377  (((ItemCount - 1) * sizeof (UINT32)) + Info->Value),
379  break;
380 
381  case ACPI_RSC_BITMASK:
382  /*
383  * 8-bit encoded bitmask (DMA macro)
384  */
386  if (ItemCount)
387  {
388  Resource->Length += (ItemCount - 1);
389  }
390 
391  Target = ACPI_ADD_PTR (char, Resource, Info->Value);
392  ACPI_SET8 (Target, ItemCount);
393  break;
394 
395  case ACPI_RSC_BITMASK16:
396  /*
397  * 16-bit encoded bitmask (IRQ macro)
398  */
399  ACPI_MOVE_16_TO_16 (&Temp16, Source);
400 
401  ItemCount = AcpiRsDecodeBitmask (Temp16, Destination);
402  if (ItemCount)
403  {
404  Resource->Length += (ItemCount - 1);
405  }
406 
407  Target = ACPI_ADD_PTR (char, Resource, Info->Value);
408  ACPI_SET8 (Target, ItemCount);
409  break;
410 
411  case ACPI_RSC_EXIT_NE:
412  /*
413  * Control - Exit conversion if not equal
414  */
415  switch (Info->ResourceOffset)
416  {
418 
419  if (AmlResourceLength != Info->Value)
420  {
421  goto Exit;
422  }
423  break;
424 
426 
427  if (ACPI_GET8 (Source) != Info->Value)
428  {
429  goto Exit;
430  }
431  break;
432 
433  default:
434 
435  ACPI_ERROR ((AE_INFO, "Invalid conversion sub-opcode"));
437  }
438  break;
439 
440  default:
441 
442  ACPI_ERROR ((AE_INFO, "Invalid conversion opcode"));
444  }
445 
446  Count--;
447  Info++;
448  }
449 
450 Exit:
451  if (!FlagsMode)
452  {
453  /* Round the resource struct length up to the next boundary (32 or 64) */
454 
455  Resource->Length = (UINT32)
457  }
459 }
#define ACPI_MOVE_16_TO_16(d, s)
Definition: acmacros.h:141
ACPI_RS_LENGTH AcpiRsGetResourceSource(ACPI_RS_LENGTH ResourceLength, ACPI_RS_LENGTH MinimumLength, ACPI_RESOURCE_SOURCE *ResourceSource, AML_RESOURCE *Aml, char *StringPtr)
Definition: rsutils.c:366
#define INIT_RESOURCE_TYPE(i)
Definition: rsmisc.c:52
#define ACPI_GET16(ptr)
Definition: acmacros.h:58
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
#define ACPI_WARNING(plist)
Definition: acoutput.h:238
#define TRUE
Definition: types.h:120
UINT16 AcpiUtGetResourceLength(void *Aml)
Definition: utresrc.c:527
void AcpiRsMoveData(void *Destination, void *Source, UINT16 ItemCount, UINT8 MoveType)
Definition: rsutils.c:150
struct aml_resource_large_header AML_RESOURCE_LARGE_HEADER
#define ACPI_GET8(ptr)
Definition: acmacros.h:57
#define ACPI_RSC_COMPARE_AML_LENGTH
Definition: acresrc.h:118
BOOLEAN AcpiRsGetAddressCommon(ACPI_RESOURCE *Resource, AML_RESOURCE *Aml)
Definition: rsaddr.c:322
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
Definition: cdprocs.h:843
#define FALSE
Definition: types.h:117
unsigned int UINT32
#define AE_INFO
Definition: acoutput.h:230
int Count
Definition: noreturn.cpp:7
#define ACPI_ROUND_UP_TO_NATIVE_WORD(a)
Definition: acmacros.h:254
static void Exit(void)
Definition: sock.c:1331
UINT8 AcpiRsDecodeBitmask(UINT16 Mask, UINT8 *List)
Definition: rsutils.c:68
#define INIT_RESOURCE_LENGTH(i)
Definition: rsmisc.c:53
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2991
#define INIT_TABLE_LENGTH(i)
Definition: rsmisc.c:54
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ACPI_SET8(ptr, val)
Definition: acmacros.h:61
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_RSC_COMPARE_VALUE
Definition: acresrc.h:119
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
unsigned short UINT16
#define NULL
Definition: types.h:112
UINT16 ACPI_RS_LENGTH
Definition: acrestyp.h:51
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
#define ACPI_ADD_PTR(t, a, b)
Definition: actypes.h:546
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167
#define ACPI_SET16(ptr, val)
Definition: acmacros.h:62
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
unsigned char UINT8
#define memset(x, y, z)
Definition: compat.h:39
#define AE_OK
Definition: acexcep.h:97
#define AE_AML_INVALID_RESOURCE_TYPE
Definition: acexcep.h:202
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 const char BOOLEAN UINT8 * Aml
Definition: acpixf.h:1301

Referenced by AcpiRsConvertAmlToResources(), and AcpiRsGetAddressCommon().

◆ AcpiRsConvertResourceToAml()

ACPI_STATUS AcpiRsConvertResourceToAml ( ACPI_RESOURCE Resource,
AML_RESOURCE Aml,
ACPI_RSCONVERT_INFO Info 
)

Definition at line 478 of file rsmisc.c.

482 {
483  void *Source = NULL;
484  void *Destination;
485  char *Target;
486  ACPI_RSDESC_SIZE AmlLength = 0;
487  UINT8 Count;
488  UINT16 Temp16 = 0;
489  UINT16 ItemCount = 0;
490 
491 
492  ACPI_FUNCTION_TRACE (RsConvertResourceToAml);
493 
494 
495  if (!Info)
496  {
498  }
499 
500  /*
501  * First table entry must be ACPI_RSC_INITxxx and must contain the
502  * table length (# of table entries)
503  */
505 
506  while (Count)
507  {
508  /*
509  * Source is the internal resource descriptor,
510  * destination is the external AML byte stream buffer
511  */
512  Source = ACPI_ADD_PTR (void, Resource, Info->ResourceOffset);
513  Destination = ACPI_ADD_PTR (void, Aml, Info->AmlOffset);
514 
515  switch (Info->Opcode)
516  {
517  case ACPI_RSC_INITSET:
518 
520  AmlLength = INIT_RESOURCE_LENGTH (Info);
522  INIT_RESOURCE_TYPE (Info), AmlLength, Aml);
523  break;
524 
525  case ACPI_RSC_INITGET:
526  break;
527 
528  case ACPI_RSC_FLAGINIT:
529  /*
530  * Clear the flag byte
531  */
532  ACPI_SET8 (Destination, 0);
533  break;
534 
535  case ACPI_RSC_1BITFLAG:
536  /*
537  * Mask and shift the flag bit
538  */
540  ((ACPI_GET8 (Source) & 0x01) << Info->Value));
541  break;
542 
543  case ACPI_RSC_2BITFLAG:
544  /*
545  * Mask and shift the flag bits
546  */
548  ((ACPI_GET8 (Source) & 0x03) << Info->Value));
549  break;
550 
551  case ACPI_RSC_3BITFLAG:
552  /*
553  * Mask and shift the flag bits
554  */
556  ((ACPI_GET8 (Source) & 0x07) << Info->Value));
557  break;
558 
559  case ACPI_RSC_6BITFLAG:
560  /*
561  * Mask and shift the flag bits
562  */
564  ((ACPI_GET8 (Source) & 0x3F) << Info->Value));
565  break;
566 
567  case ACPI_RSC_COUNT:
568 
569  ItemCount = ACPI_GET8 (Source);
570  ACPI_SET8 (Destination, ItemCount);
571 
572  AmlLength = (UINT16)
573  (AmlLength + (Info->Value * (ItemCount - 1)));
574  break;
575 
576  case ACPI_RSC_COUNT16:
577 
578  ItemCount = ACPI_GET16 (Source);
579  AmlLength = (UINT16) (AmlLength + ItemCount);
580  AcpiRsSetResourceLength (AmlLength, Aml);
581  break;
582 
584 
585  ItemCount = ACPI_GET16 (Source);
586  ACPI_SET16 (Destination, AmlLength);
587 
588  AmlLength = (UINT16) (AmlLength + ItemCount * 2);
589  Target = ACPI_ADD_PTR (void, Aml, Info->Value);
590  ACPI_SET16 (Target, AmlLength);
591  AcpiRsSetResourceLength (AmlLength, Aml);
592  break;
593 
595 
596  ItemCount = ACPI_GET16 (Source);
597  ACPI_SET16 (Destination, ItemCount);
598 
599  AmlLength = (UINT16) (
600  AmlLength + (Info->Value * ItemCount));
601  AcpiRsSetResourceLength (AmlLength, Aml);
602  break;
603 
605 
606  /* Set resource source string length */
607 
608  ItemCount = ACPI_GET16 (Source);
609  ACPI_SET16 (Destination, AmlLength);
610 
611  /* Compute offset for the Vendor Data */
612 
613  AmlLength = (UINT16) (AmlLength + ItemCount);
614  Target = ACPI_ADD_PTR (void, Aml, Info->Value);
615 
616  /* Set vendor offset only if there is vendor data */
617 
618  ACPI_SET16 (Target, AmlLength);
619 
620  AcpiRsSetResourceLength (AmlLength, Aml);
621  break;
622 
624 
625  ItemCount = ACPI_GET16 (Source);
626  ACPI_SET16 (Destination, ItemCount + Info->Value);
627  AmlLength = (UINT16) (AmlLength + ItemCount);
628  AcpiRsSetResourceLength (AmlLength, Aml);
629  break;
630 
632 
633  ItemCount = ACPI_GET16 (Source);
634  AmlLength = (UINT16) (AmlLength + ItemCount);
635  AcpiRsSetResourceLength (AmlLength, Aml);
636  break;
637 
638  case ACPI_RSC_LENGTH:
639 
640  AcpiRsSetResourceLength (Info->Value, Aml);
641  break;
642 
643  case ACPI_RSC_MOVE8:
644  case ACPI_RSC_MOVE16:
645  case ACPI_RSC_MOVE32:
646  case ACPI_RSC_MOVE64:
647 
648  if (Info->Value)
649  {
650  ItemCount = Info->Value;
651  }
652  AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode);
653  break;
654 
656 
657  Destination = (char *) ACPI_ADD_PTR (void, Aml,
659  Source = * (UINT16 **) Source;
660  AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode);
661  break;
662 
664 
665  /* Used for both ResourceSource string and VendorData */
666 
667  Destination = (char *) ACPI_ADD_PTR (void, Aml,
669  Source = * (UINT8 **) Source;
670  AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode);
671  break;
672 
674 
675  Destination = (char *) ACPI_ADD_PTR (void, Aml,
676  (AmlLength - ItemCount));
677  Source = * (UINT8 **) Source;
678  AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode);
679  break;
680 
682 
683  Destination = (char *) ACPI_ADD_PTR (void, Aml,
684  (AmlLength - ItemCount));
685  Source = * (UINT8 **) Source;
686  AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode);
687  break;
688 
689  case ACPI_RSC_ADDRESS:
690 
691  /* Set the Resource Type, General Flags, and Type-Specific Flags */
692 
694  break;
695 
696  case ACPI_RSC_SOURCEX:
697  /*
698  * Optional ResourceSource (Index and String)
699  */
700  AmlLength = AcpiRsSetResourceSource (
701  Aml, (ACPI_RS_LENGTH) AmlLength, Source);
702  AcpiRsSetResourceLength (AmlLength, Aml);
703  break;
704 
705  case ACPI_RSC_SOURCE:
706  /*
707  * Optional ResourceSource (Index and String). This is the more
708  * complicated case used by the Interrupt() macro
709  */
710  AmlLength = AcpiRsSetResourceSource (Aml, Info->Value, Source);
711  AcpiRsSetResourceLength (AmlLength, Aml);
712  break;
713 
714  case ACPI_RSC_BITMASK:
715  /*
716  * 8-bit encoded bitmask (DMA macro)
717  */
720  *ACPI_ADD_PTR (UINT8, Resource, Info->Value)));
721  break;
722 
723  case ACPI_RSC_BITMASK16:
724  /*
725  * 16-bit encoded bitmask (IRQ macro)
726  */
727  Temp16 = AcpiRsEncodeBitmask (
728  Source, *ACPI_ADD_PTR (UINT8, Resource, Info->Value));
729  ACPI_MOVE_16_TO_16 (Destination, &Temp16);
730  break;
731 
732  case ACPI_RSC_EXIT_LE:
733  /*
734  * Control - Exit conversion if less than or equal
735  */
736  if (ItemCount <= Info->Value)
737  {
738  goto Exit;
739  }
740  break;
741 
742  case ACPI_RSC_EXIT_NE:
743  /*
744  * Control - Exit conversion if not equal
745  */
746  switch (COMPARE_OPCODE (Info))
747  {
749 
750  if (*ACPI_ADD_PTR (UINT8, Resource,
752  {
753  goto Exit;
754  }
755  break;
756 
757  default:
758 
759  ACPI_ERROR ((AE_INFO, "Invalid conversion sub-opcode"));
761  }
762  break;
763 
764  case ACPI_RSC_EXIT_EQ:
765  /*
766  * Control - Exit conversion if equal
767  */
768  if (*ACPI_ADD_PTR (UINT8, Resource,
770  {
771  goto Exit;
772  }
773  break;
774 
775  default:
776 
777  ACPI_ERROR ((AE_INFO, "Invalid conversion opcode"));
779  }
780 
781  Count--;
782  Info++;
783  }
784 
785 Exit:
787 }
#define ACPI_MOVE_16_TO_16(d, s)
Definition: acmacros.h:141
#define INIT_RESOURCE_TYPE(i)
Definition: rsmisc.c:52
#define ACPI_GET16(ptr)
Definition: acmacros.h:58
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
#define ACPI_SET_BIT(target, bit)
Definition: actypes.h:533
void AcpiRsMoveData(void *Destination, void *Source, UINT16 ItemCount, UINT8 MoveType)
Definition: rsutils.c:150
#define COMPARE_VALUE(i)
Definition: rsmisc.c:58
UINT16 AcpiRsEncodeBitmask(UINT8 *List, UINT8 Count)
Definition: rsutils.c:110
#define ACPI_GET8(ptr)
Definition: acmacros.h:57
void AcpiRsSetAddressCommon(AML_RESOURCE *Aml, ACPI_RESOURCE *Resource)
Definition: rsaddr.c:381
void AcpiRsSetResourceHeader(UINT8 DescriptorType, ACPI_RSDESC_SIZE TotalLength, AML_RESOURCE *Aml)
Definition: rsutils.c:289
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
#define ACPI_CAST8(ptr)
Definition: acmacros.h:53
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
Definition: cdprocs.h:843
ACPI_RSDESC_SIZE AcpiRsSetResourceSource(AML_RESOURCE *Aml, ACPI_RS_LENGTH MinimumLength, ACPI_RESOURCE_SOURCE *ResourceSource)
Definition: rsutils.c:457
#define COMPARE_TARGET(i)
Definition: rsmisc.c:57
#define AE_INFO
Definition: acoutput.h:230
#define COMPARE_OPCODE(i)
Definition: rsmisc.c:56
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
int Count
Definition: noreturn.cpp:7
static void Exit(void)
Definition: sock.c:1331
#define INIT_RESOURCE_LENGTH(i)
Definition: rsmisc.c:53
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2991
#define INIT_TABLE_LENGTH(i)
Definition: rsmisc.c:54
#define ACPI_SET8(ptr, val)
Definition: acmacros.h:61
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_RSC_COMPARE_VALUE
Definition: acresrc.h:119
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
unsigned short UINT16
#define NULL
Definition: types.h:112
UINT32 ACPI_RSDESC_SIZE
Definition: acrestyp.h:52
UINT16 ACPI_RS_LENGTH
Definition: acrestyp.h:51
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
void AcpiRsSetResourceLength(ACPI_RSDESC_SIZE TotalLength, AML_RESOURCE *Aml)
Definition: rsutils.c:233
#define ACPI_ADD_PTR(t, a, b)
Definition: actypes.h:546
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167
#define ACPI_SET16(ptr, val)
Definition: acmacros.h:62
unsigned char UINT8
#define memset(x, y, z)
Definition: compat.h:39
#define AE_OK
Definition: acexcep.h:97
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 const char BOOLEAN UINT8 * Aml
Definition: acpixf.h:1301

Referenced by AcpiRsConvertResourcesToAml(), and AcpiRsSetAddressCommon().