HalacpiIrqTranslateResourcesIsa

NTSTATUS __stdcall HalacpiIrqTranslateResourcesIsa(
        VOID *Context,
        _CM_PARTIAL_RESOURCE_DESCRIPTOR *Source,
        _RESOURCE_TRANSLATION_DIRECTION Direction,
        _IO_RESOURCE_DESCRIPTOR *Alternatives,
        _IO_RESOURCE_DESCRIPTOR *PhysicalDeviceObject,
        _DEVICE_OBJECT *Target,
        _CM_PARTIAL_RESOURCE_DESCRIPTOR *a7){
  _CM_PARTIAL_RESOURCE_DESCRIPTOR v7; 
  _CM_PARTIAL_RESOURCE_DESCRIPTOR *v8; 
  char v10; 
  unsigned int v11; 
  UINT64 HighPart; 
  char v14; 
  NTSTATUS result; 
  unsigned int v16; 
  unsigned int *p_Alignment; 
  unsigned int v18; 
  LONG v19; 

  v7 = *Source;
  v8 = a7;
  v19 = 0;
  v10 = 0;
  v11 = (unsigned int)Alternatives;
  *a7 = v7;
  *(_DWORD *)&v8[1].Type = *(_DWORD *)&Source[1].Type;
  HighPart = (unsigned int)Source->u.Start.anonymous_0.HighPart;
  if( (unsigned int)(HighPart + 0x100000) <= 0xFFFFE )
    return 0;
  HalpIsInterruptTypeSecondary(0i64, HighPart);
  if( v14 )
    return 0;
  if( Direction == TranslateChildToParent )
  {
    LOWORD(v8->u.Start.anonymous_0.LowPart) = *((_WORD *)HalpPicVectorRedirect
                                              + 2 * LOWORD(Source->u.Start.anonymous_0.LowPart));
    v8->u.Start.anonymous_0.HighPart = *((_DWORD *)HalpPicVectorRedirect
                                       + (unsigned int)Source->u.Start.anonymous_0.HighPart);
    return 0;
  }
  if( Direction != TranslateParentToChild )
    return 0;
  result = TranslateGlobalVectorToIsaVector(LOWORD(Source->u.Start.anonymous_0.LowPart), &v19);
  if( result >= 0 )
  {
    LOWORD(v8->u.Start.anonymous_0.LowPart) = v19;
    result = TranslateGlobalVectorToIsaVector(Source->u.Start.anonymous_0.HighPart, &v19);
    if( result >= 0 )
    {
      v8->u.Start.anonymous_0.HighPart = v19;
      if( LOWORD(v8->u.Start.anonymous_0.LowPart) == 9 )
      {
        v16 = 0;
        if( v11 )
        {
          p_Alignment = &PhysicalDeviceObject->u.Port.Alignment;
          while( 1 )
          {
            v18 = *(p_Alignment - 1);
            if( v18 >= 9 && *p_Alignment <= 9 )
              break;
            if( v18 >= 2 && *p_Alignment <= 2 )
              v10 = 1;
            ++v16;
            p_Alignment += 8;
            if( v16 >= v11 )
              goto LABEL_20;
          }
          v10 = 0;
LABEL_20:
          if( v10 )
          {
            LOWORD(v8->u.Start.anonymous_0.LowPart) = 2;
            v8->u.Start.anonymous_0.HighPart = 2;
          }
        }
      }
      return 0;
    }
  }
  return result;
}

Referenced by:

No references.