sys/contrib/dev/acpica-unix/tools/acpiexec/aehandlers.c
ACPI_STATUS
AeRegionHandler (
    UINT32                  Function,
    ACPI_PHYSICAL_ADDRESS   Address,
    UINT32                  BitWidth,
    UINT64                  *Value,
    void                    *HandlerContext,
    void                    *RegionContext)
{

    ACPI_OPERAND_OBJECT     *RegionObject = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, RegionContext);
    UINT8                   *Buffer = ACPI_CAST_PTR (UINT8, Value);
    ACPI_PHYSICAL_ADDRESS   BaseAddress;
    ACPI_SIZE               Length;
    BOOLEAN                 BufferExists;
    AE_REGION               *RegionElement;
    void                    *BufferValue;
    ACPI_STATUS             Status;
    UINT32                  ByteWidth;
    UINT32                  i;
    UINT8                   SpaceId;


    ACPI_FUNCTION_NAME (AeRegionHandler);

    /*
     * If the object is not a region, simply return
     */
    if (RegionObject->Region.Type != ACPI_TYPE_REGION)
    {
        return (AE_OK);
    }

    /*
     * Region support can be disabled with the -r option.
     * We use this to support dynamically loaded tables where we pass a valid
     * address to the AML.
     */
    if (AcpiGbl_DbOpt_NoRegionSupport)
    {
        BufferValue = ACPI_TO_POINTER (Address);
        ByteWidth = (BitWidth / 8);

        if (BitWidth % 8)
        {
            ByteWidth += 1;
        }
        goto DoFunction;
    }

    /*
     * Find the region's address space and length before searching
     * the linked list.
     */
    BaseAddress = RegionObject->Region.Address;
    Length = (ACPI_SIZE) RegionObject->Region.Length;
    SpaceId = RegionObject->Region.SpaceId;

    ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Operation Region request on %s at 0x%X\n",
            AcpiUtGetRegionName (RegionObject->Region.SpaceId),
            (UINT32) Address));

    switch (SpaceId)
    {
    case ACPI_ADR_SPACE_SYSTEM_IO:
        /*
         * For I/O space, exercise the port validation
         */
        switch (Function & ACPI_IO_MASK)
        {
        case ACPI_READ:
            Status = AcpiHwReadPort (Address, (UINT32 *) Value, BitWidth);
            AE_CHECK_OK (AcpiHwReadPort, Status);
            break;

        case ACPI_WRITE:
            Status = AcpiHwWritePort (Address, (UINT32) *Value, BitWidth);
            AE_CHECK_OK (AcpiHwWritePort, Status);
            break;

        default:
            Status = AE_BAD_PARAMETER;
            break;
        }

        if (ACPI_FAILURE (Status))
        {
            return (Status);
        }

        /* Now go ahead and simulate the hardware */
        break;


    case ACPI_ADR_SPACE_SMBUS:

        Length = 0;

        switch (Function & ACPI_IO_MASK)
        {
        case ACPI_READ:
            switch (Function >> 16)
            {
            case AML_FIELD_ATTRIB_SMB_QUICK:
            case AML_FIELD_ATTRIB_SMB_SEND_RCV:
            case AML_FIELD_ATTRIB_SMB_BYTE:
                Length = 1;
                break;

            case AML_FIELD_ATTRIB_SMB_WORD:
            case AML_FIELD_ATTRIB_SMB_WORD_CALL:
                Length = 2;
                break;

            case AML_FIELD_ATTRIB_SMB_BLOCK:
            case AML_FIELD_ATTRIB_SMB_BLOCK_CALL:
                Length = 32;
                break;

            default:
                break;
            }
            break;

        case ACPI_WRITE:
            switch (Function >> 16)
            {
            case AML_FIELD_ATTRIB_SMB_QUICK:
            case AML_FIELD_ATTRIB_SMB_SEND_RCV:
            case AML_FIELD_ATTRIB_SMB_BYTE:
            case AML_FIELD_ATTRIB_SMB_WORD:
            case AML_FIELD_ATTRIB_SMB_BLOCK:
                Length = 0;
                break;

            case AML_FIELD_ATTRIB_SMB_WORD_CALL:
                Length = 2;
                break;

            case AML_FIELD_ATTRIB_SMB_BLOCK_CALL:
                Length = 32;
                break;

            default:
                break;
            }
            break;

        default:
            break;
        }

        for (i = 0; i < Length; i++)
        {
            Buffer[i+2] = (UINT8) (0xA0 + i);
        }

        Buffer[0] = 0x7A;
        Buffer[1] = (UINT8) Length;
        return (AE_OK);


    case ACPI_ADR_SPACE_IPMI: /* ACPI 4.0 */

        AcpiOsPrintf ("AcpiExec: Received IPMI request: "
            "Address %X BaseAddress %X Length %X Width %X BufferLength %u\n",
            (UINT32) Address, (UINT32) BaseAddress,
            Length, BitWidth, Buffer[1]);

        /*
         * Regardless of a READ or WRITE, this handler is passed a 66-byte
         * buffer in which to return the IPMI status/length/data.
         *
         * Return some example data to show use of the bidirectional buffer
         */
        Buffer[0] = 0;       /* Status byte */
        Buffer[1] = 64;      /* Return buffer data length */
        Buffer[2] = 0;       /* Completion code */
        Buffer[3] = 0x34;    /* Power measurement */
        Buffer[4] = 0x12;    /* Power measurement */
        Buffer[65] = 0xEE;   /* last buffer byte */
        return (AE_OK);

    default:
        break;
    }

    /*
     * Search through the linked list for this region's buffer
     */
    BufferExists = FALSE;
    RegionElement = AeRegions.RegionList;

    if (AeRegions.NumberOfRegions)
    {
        while (!BufferExists && RegionElement)
        {
            if (RegionElement->Address == BaseAddress &&
                RegionElement->Length == Length &&
                RegionElement->SpaceId == SpaceId)
            {
                BufferExists = TRUE;
            }
            else
            {
                RegionElement = RegionElement->NextRegion;
            }
        }
    }

    /*
     * If the Region buffer does not exist, create it now
     */
    if (!BufferExists)
    {
        /*
         * Do the memory allocations first
         */
        RegionElement = AcpiOsAllocate (sizeof (AE_REGION));
        if (!RegionElement)
        {
            return (AE_NO_MEMORY);
        }

        RegionElement->Buffer = AcpiOsAllocate (Length);
        if (!RegionElement->Buffer)
        {
            AcpiOsFree (RegionElement);
            return (AE_NO_MEMORY);
        }

        /* Initialize the region with the default fill value */

        ACPI_MEMSET (RegionElement->Buffer, AcpiGbl_RegionFillValue, Length);

        RegionElement->Address      = BaseAddress;
        RegionElement->Length       = Length;
        RegionElement->SpaceId      = SpaceId;
        RegionElement->NextRegion   = NULL;

        /*
         * Increment the number of regions and put this one
         *  at the head of the list as it will probably get accessed
         *  more often anyway.
         */
        AeRegions.NumberOfRegions += 1;

        if (AeRegions.RegionList)
        {
            RegionElement->NextRegion = AeRegions.RegionList;
        }

        AeRegions.RegionList = RegionElement;
    }

    /*
     * Calculate the size of the memory copy
     */
    ByteWidth = (BitWidth / 8);

    if (BitWidth % 8)
    {
        ByteWidth += 1;
    }

    /*
     * The buffer exists and is pointed to by RegionElement.
     * We now need to verify the request is valid and perform the operation.
     *
     * NOTE: RegionElement->Length is in bytes, therefore it we compare against
     * ByteWidth (see above)
     */
    if (((UINT64) Address + ByteWidth) >
        ((UINT64)(RegionElement->Address) + RegionElement->Length))
    {
        ACPI_WARNING ((AE_INFO,
            "Request on [%4.4s] is beyond region limit Req-0x%X+0x%X, Base=0x%X, Len-0x%X",
            (RegionObject->Region.Node)->Name.Ascii, (UINT32) Address,
            ByteWidth, (UINT32)(RegionElement->Address),
            RegionElement->Length));

        return (AE_AML_REGION_LIMIT);
    }

    /*
     * Get BufferValue to point to the "address" in the buffer
     */
    BufferValue = ((UINT8 *) RegionElement->Buffer +
                    ((UINT64) Address - (UINT64) RegionElement->Address));

DoFunction:

    /*
     * Perform a read or write to the buffer space
     */
    switch (Function)
    {
    case ACPI_READ:
        /*
         * Set the pointer Value to whatever is in the buffer
         */
        ACPI_MEMCPY (Value, BufferValue, ByteWidth);
        break;

    case ACPI_WRITE:
        /*
         * Write the contents of Value to the buffer
         */
        ACPI_MEMCPY (BufferValue, Value, ByteWidth);
        break;

    default:
        return (AE_BAD_PARAMETER);
    }

    return (AE_OK);
}
/******************************************************************************
 *
 * FUNCTION:    AeRegionHandler
 *
 * PARAMETERS:  Standard region handler parameters
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Test handler - Handles some dummy regions via memory that can
 *              be manipulated in Ring 3. Simulates actual reads and writes.
 *
 *****************************************************************************/
AeRegionHandler
PARAMETERS:  Standard region handler parameters

Status

Test handler - Handles some dummy regions via memory that can
be manipulated in Ring 3. Simulates actual reads and writes.
AeRegionHandler PARAMETERS : Standard region handler parameters Status Test handler - Handles some dummy regions via memory that can be manipulated in Ring 3 . Simulates actual reads and writes .
ACPI_STATUS
AeRegionHandler (
    UINT32                  Function,
    ACPI_PHYSICAL_ADDRESS   Address,
    UINT32                  BitWidth,
    UINT64                  *Value,
    void                    *HandlerContext,
    void                    *RegionContext)
{
    ACPI_OPERAND_OBJECT     *RegionObject = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, RegionContext);
    UINT8                   *Buffer = ACPI_CAST_PTR (UINT8, Value);
    ACPI_PHYSICAL_ADDRESS   BaseAddress;
    ACPI_SIZE               Length;
    BOOLEAN                 BufferExists;
    AE_REGION               *RegionElement;
    void                    *BufferValue;
    ACPI_STATUS             Status;
    UINT32                  ByteWidth;
    UINT32                  i;
    UINT8                   SpaceId;
    ACPI_FUNCTION_NAME (AeRegionHandler);
    if (RegionObject->Region.Type != ACPI_TYPE_REGION)
    {
        return (AE_OK);
    }
    if (AcpiGbl_DbOpt_NoRegionSupport)
    {
        BufferValue = ACPI_TO_POINTER (Address);
        ByteWidth = (BitWidth / 8);
        if (BitWidth % 8)
        {
            ByteWidth += 1;
        }
        goto DoFunction;
    }
    BaseAddress = RegionObject->Region.Address;
    Length = (ACPI_SIZE) RegionObject->Region.Length;
    SpaceId = RegionObject->Region.SpaceId;
    ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Operation Region request on %s at 0x%X\n",
            AcpiUtGetRegionName (RegionObject->Region.SpaceId),
            (UINT32) Address));
    switch (SpaceId)
    {
    case ACPI_ADR_SPACE_SYSTEM_IO:
        switch (Function & ACPI_IO_MASK)
        {
        case ACPI_READ:
            Status = AcpiHwReadPort (Address, (UINT32 *) Value, BitWidth);
            AE_CHECK_OK (AcpiHwReadPort, Status);
            break;
        case ACPI_WRITE:
            Status = AcpiHwWritePort (Address, (UINT32) *Value, BitWidth);
            AE_CHECK_OK (AcpiHwWritePort, Status);
            break;
        default:
            Status = AE_BAD_PARAMETER;
            break;
        }
        if (ACPI_FAILURE (Status))
        {
            return (Status);
        }
        break;
    case ACPI_ADR_SPACE_SMBUS:
        Length = 0;
        switch (Function & ACPI_IO_MASK)
        {
        case ACPI_READ:
            switch (Function >> 16)
            {
            case AML_FIELD_ATTRIB_SMB_QUICK:
            case AML_FIELD_ATTRIB_SMB_SEND_RCV:
            case AML_FIELD_ATTRIB_SMB_BYTE:
                Length = 1;
                break;
            case AML_FIELD_ATTRIB_SMB_WORD:
            case AML_FIELD_ATTRIB_SMB_WORD_CALL:
                Length = 2;
                break;
            case AML_FIELD_ATTRIB_SMB_BLOCK:
            case AML_FIELD_ATTRIB_SMB_BLOCK_CALL:
                Length = 32;
                break;
            default:
                break;
            }
            break;
        case ACPI_WRITE:
            switch (Function >> 16)
            {
            case AML_FIELD_ATTRIB_SMB_QUICK:
            case AML_FIELD_ATTRIB_SMB_SEND_RCV:
            case AML_FIELD_ATTRIB_SMB_BYTE:
            case AML_FIELD_ATTRIB_SMB_WORD:
            case AML_FIELD_ATTRIB_SMB_BLOCK:
                Length = 0;
                break;
            case AML_FIELD_ATTRIB_SMB_WORD_CALL:
                Length = 2;
                break;
            case AML_FIELD_ATTRIB_SMB_BLOCK_CALL:
                Length = 32;
                break;
            default:
                break;
            }
            break;
        default:
            break;
        }
        for (i = 0; i < Length; i++)
        {
            Buffer[i+2] = (UINT8) (0xA0 + i);
        }
        Buffer[0] = 0x7A;
        Buffer[1] = (UINT8) Length;
        return (AE_OK);
    case ACPI_ADR_SPACE_IPMI: 
        AcpiOsPrintf ("AcpiExec: Received IPMI request: "
            "Address %X BaseAddress %X Length %X Width %X BufferLength %u\n",
            (UINT32) Address, (UINT32) BaseAddress,
            Length, BitWidth, Buffer[1]);
        Buffer[0] = 0;       
        Buffer[1] = 64;      
        Buffer[2] = 0;       
        Buffer[3] = 0x34;    
        Buffer[4] = 0x12;    
        Buffer[65] = 0xEE;   
        return (AE_OK);
    default:
        break;
    }
    BufferExists = FALSE;
    RegionElement = AeRegions.RegionList;
    if (AeRegions.NumberOfRegions)
    {
        while (!BufferExists && RegionElement)
        {
            if (RegionElement->Address == BaseAddress &&
                RegionElement->Length == Length &&
                RegionElement->SpaceId == SpaceId)
            {
                BufferExists = TRUE;
            }
            else
            {
                RegionElement = RegionElement->NextRegion;
            }
        }
    }
    if (!BufferExists)
    {
        RegionElement = AcpiOsAllocate (sizeof (AE_REGION));
        if (!RegionElement)
        {
            return (AE_NO_MEMORY);
        }
        RegionElement->Buffer = AcpiOsAllocate (Length);
        if (!RegionElement->Buffer)
        {
            AcpiOsFree (RegionElement);
            return (AE_NO_MEMORY);
        }
        ACPI_MEMSET (RegionElement->Buffer, AcpiGbl_RegionFillValue, Length);
        RegionElement->Address      = BaseAddress;
        RegionElement->Length       = Length;
        RegionElement->SpaceId      = SpaceId;
        RegionElement->NextRegion   = NULL;
        AeRegions.NumberOfRegions += 1;
        if (AeRegions.RegionList)
        {
            RegionElement->NextRegion = AeRegions.RegionList;
        }
        AeRegions.RegionList = RegionElement;
    }
    ByteWidth = (BitWidth / 8);
    if (BitWidth % 8)
    {
        ByteWidth += 1;
    }
    if (((UINT64) Address + ByteWidth) >
        ((UINT64)(RegionElement->Address) + RegionElement->Length))
    {
        ACPI_WARNING ((AE_INFO,
            "Request on [%4.4s] is beyond region limit Req-0x%X+0x%X, Base=0x%X, Len-0x%X",
            (RegionObject->Region.Node)->Name.Ascii, (UINT32) Address,
            ByteWidth, (UINT32)(RegionElement->Address),
            RegionElement->Length));
        return (AE_AML_REGION_LIMIT);
    }
    BufferValue = ((UINT8 *) RegionElement->Buffer +
                    ((UINT64) Address - (UINT64) RegionElement->Address));
DoFunction:
    switch (Function)
    {
    case ACPI_READ:
        ACPI_MEMCPY (Value, BufferValue, ByteWidth);
        break;
    case ACPI_WRITE:
        ACPI_MEMCPY (BufferValue, Value, ByteWidth);
        break;
    default:
        return (AE_BAD_PARAMETER);
    }
    return (AE_OK);
}
ACPI_STATUS AeRegionHandler ( UINT32 Function , ACPI_PHYSICAL_ADDRESS Address , UINT32 BitWidth , UINT64 * Value , void * HandlerContext , void * RegionContext ) { ACPI_OPERAND_OBJECT * RegionObject = ACPI_CAST_PTR ( ACPI_OPERAND_OBJECT , RegionContext ) ; UINT8 * Buffer = ACPI_CAST_PTR ( UINT8 , Value ) ; ACPI_PHYSICAL_ADDRESS BaseAddress ; ACPI_SIZE Length ; BOOLEAN BufferExists ; AE_REGION * RegionElement ; void * BufferValue ; ACPI_STATUS Status ; UINT32 ByteWidth ; UINT32 i ; UINT8 SpaceId ; ACPI_FUNCTION_NAME ( AeRegionHandler ) ; if ( RegionObject -> Region . Type != ACPI_TYPE_REGION ) { return ( AE_OK ) ; } if ( AcpiGbl_DbOpt_NoRegionSupport ) { BufferValue = ACPI_TO_POINTER ( Address ) ; ByteWidth = ( BitWidth / 8 ) ; if ( BitWidth % 8 ) { ByteWidth += 1 ; } goto DoFunction ; } BaseAddress = RegionObject -> Region . Address ; Length = ( ACPI_SIZE ) RegionObject -> Region . Length ; SpaceId = RegionObject -> Region . SpaceId ; ACPI_DEBUG_PRINT ( ( ACPI_DB_OPREGION , " \n " , AcpiUtGetRegionName ( RegionObject -> Region . SpaceId ) , ( UINT32 ) Address ) ) ; switch ( SpaceId ) { case ACPI_ADR_SPACE_SYSTEM_IO : switch ( Function & ACPI_IO_MASK ) { case ACPI_READ : Status = AcpiHwReadPort ( Address , ( UINT32 * ) Value , BitWidth ) ; AE_CHECK_OK ( AcpiHwReadPort , Status ) ; break ; case ACPI_WRITE : Status = AcpiHwWritePort ( Address , ( UINT32 ) * Value , BitWidth ) ; AE_CHECK_OK ( AcpiHwWritePort , Status ) ; break ; default : Status = AE_BAD_PARAMETER ; break ; } if ( ACPI_FAILURE ( Status ) ) { return ( Status ) ; } break ; case ACPI_ADR_SPACE_SMBUS : Length = 0 ; switch ( Function & ACPI_IO_MASK ) { case ACPI_READ : switch ( Function >> 16 ) { case AML_FIELD_ATTRIB_SMB_QUICK : case AML_FIELD_ATTRIB_SMB_SEND_RCV : case AML_FIELD_ATTRIB_SMB_BYTE : Length = 1 ; break ; case AML_FIELD_ATTRIB_SMB_WORD : case AML_FIELD_ATTRIB_SMB_WORD_CALL : Length = 2 ; break ; case AML_FIELD_ATTRIB_SMB_BLOCK : case AML_FIELD_ATTRIB_SMB_BLOCK_CALL : Length = 32 ; break ; default : break ; } break ; case ACPI_WRITE : switch ( Function >> 16 ) { case AML_FIELD_ATTRIB_SMB_QUICK : case AML_FIELD_ATTRIB_SMB_SEND_RCV : case AML_FIELD_ATTRIB_SMB_BYTE : case AML_FIELD_ATTRIB_SMB_WORD : case AML_FIELD_ATTRIB_SMB_BLOCK : Length = 0 ; break ; case AML_FIELD_ATTRIB_SMB_WORD_CALL : Length = 2 ; break ; case AML_FIELD_ATTRIB_SMB_BLOCK_CALL : Length = 32 ; break ; default : break ; } break ; default : break ; } for ( i = 0 ; i < Length ; i ++ ) { Buffer [ i + 2 ] = ( UINT8 ) ( 0xA0 + i ) ; } Buffer [ 0 ] = 0x7A ; Buffer [ 1 ] = ( UINT8 ) Length ; return ( AE_OK ) ; case ACPI_ADR_SPACE_IPMI : AcpiOsPrintf ( " " " \n " , ( UINT32 ) Address , ( UINT32 ) BaseAddress , Length , BitWidth , Buffer [ 1 ] ) ; Buffer [ 0 ] = 0 ; Buffer [ 1 ] = 64 ; Buffer [ 2 ] = 0 ; Buffer [ 3 ] = 0x34 ; Buffer [ 4 ] = 0x12 ; Buffer [ 65 ] = 0xEE ; return ( AE_OK ) ; default : break ; } BufferExists = FALSE ; RegionElement = AeRegions . RegionList ; if ( AeRegions . NumberOfRegions ) { while ( ! BufferExists && RegionElement ) { if ( RegionElement -> Address == BaseAddress && RegionElement -> Length == Length && RegionElement -> SpaceId == SpaceId ) { BufferExists = TRUE ; } else { RegionElement = RegionElement -> NextRegion ; } } } if ( ! BufferExists ) { RegionElement = AcpiOsAllocate ( sizeof ( AE_REGION ) ) ; if ( ! RegionElement ) { return ( AE_NO_MEMORY ) ; } RegionElement -> Buffer = AcpiOsAllocate ( Length ) ; if ( ! RegionElement -> Buffer ) { AcpiOsFree ( RegionElement ) ; return ( AE_NO_MEMORY ) ; } ACPI_MEMSET ( RegionElement -> Buffer , AcpiGbl_RegionFillValue , Length ) ; RegionElement -> Address = BaseAddress ; RegionElement -> Length = Length ; RegionElement -> SpaceId = SpaceId ; RegionElement -> NextRegion = NULL ; AeRegions . NumberOfRegions += 1 ; if ( AeRegions . RegionList ) { RegionElement -> NextRegion = AeRegions . RegionList ; } AeRegions . RegionList = RegionElement ; } ByteWidth = ( BitWidth / 8 ) ; if ( BitWidth % 8 ) { ByteWidth += 1 ; } if ( ( ( UINT64 ) Address + ByteWidth ) > ( ( UINT64 ) ( RegionElement -> Address ) + RegionElement -> Length ) ) { ACPI_WARNING ( ( AE_INFO , " " , ( RegionObject -> Region . Node ) -> Name . Ascii , ( UINT32 ) Address , ByteWidth , ( UINT32 ) ( RegionElement -> Address ) , RegionElement -> Length ) ) ; return ( AE_AML_REGION_LIMIT ) ; } BufferValue = ( ( UINT8 * ) RegionElement -> Buffer + ( ( UINT64 ) Address - ( UINT64 ) RegionElement -> Address ) ) ; DoFunction : switch ( Function ) { case ACPI_READ : ACPI_MEMCPY ( Value , BufferValue , ByteWidth ) ; break ; case ACPI_WRITE : ACPI_MEMCPY ( BufferValue , Value , ByteWidth ) ; break ; default : return ( AE_BAD_PARAMETER ) ; } return ( AE_OK ) ; }
FUNCTION:    AeRegionHandler
 PARAMETERS:  Standard region handler parameters
FUNCTION : AeRegionHandler PARAMETERS : Standard region handler parameters
/*
     * If the object is not a region, simply return
     */ /*
     * Region support can be disabled with the -r option.
     * We use this to support dynamically loaded tables where we pass a valid
     * address to the AML.
     */ /*
     * Find the region's address space and length before searching
     * the linked list.
     */ /*
         * For I/O space, exercise the port validation
         */ /* Now go ahead and simulate the hardware */ /* ACPI 4.0 */ /*
         * Regardless of a READ or WRITE, this handler is passed a 66-byte
         * buffer in which to return the IPMI status/length/data.
         *
         * Return some example data to show use of the bidirectional buffer
         */ /* Status byte */ /* Return buffer data length */ /* Completion code */ /* Power measurement */ /* Power measurement */ /* last buffer byte */ /*
     * Search through the linked list for this region's buffer
     */ /*
     * If the Region buffer does not exist, create it now
     */ /*
         * Do the memory allocations first
         */ /* Initialize the region with the default fill value */ /*
         * Increment the number of regions and put this one
         *  at the head of the list as it will probably get accessed
         *  more often anyway.
         */ /*
     * Calculate the size of the memory copy
     */ /*
     * The buffer exists and is pointed to by RegionElement.
     * We now need to verify the request is valid and perform the operation.
     *
     * NOTE: RegionElement->Length is in bytes, therefore it we compare against
     * ByteWidth (see above)
     */ /*
     * Get BufferValue to point to the "address" in the buffer
     */ /*
     * Perform a read or write to the buffer space
     */ /*
         * Set the pointer Value to whatever is in the buffer
         */ /*
         * Write the contents of Value to the buffer
         */