kernel/arch/x86_64/src/sched/ThreadState.h
/**
     * Add an IO port range to the allow list so it can be accessed.
     *
     * @note Once the bitmap is locked, it's not possible to add any new IO ports to the list.
     *
     * @param base First IO port address
     * @param len Number of subsequent IO port addresses to add to list
     *
     * @return Whether the IO port range was successfully added to the allow list
     */
Add an IO port range to the allow list so it can be accessed.
@note Once the bitmap is locked, it's not possible to add any new IO ports to the list.

@param base First IO port address
@param len Number of subsequent IO port addresses to add to list

@return Whether the IO port range was successfully added to the allow list
Add an IO port range to the allow list so it can be accessed . @note Once the bitmap is locked it ' s not possible to add any new IO ports to the list . @param base First IO port address @param len Number of subsequent IO port addresses to add to list @return Whether the IO port range was successfully added to the allow list
bool allowIoRange(const uint16_t base, const uint16_t len) {
        if(!this->ioBitmap || this->ioBitmapLocked) return false;
        else if(!len) return false;
        else if((static_cast<size_t>(base) + static_cast<size_t>(len)) > UINT16_MAX) return false;
        for(size_t i = base; i < (base + len); i++) {
            this->ioBitmap[i / 8] |= (1 << (i % 8));
        }
        return true;
    }
bool allowIoRange ( const uint16_t base , const uint16_t len ) { if ( ! this -> ioBitmap || this -> ioBitmapLocked ) return false ; else if ( ! len ) return false ; else if ( ( static_cast < size_t > ( base ) + static_cast < size_t > ( len ) ) > UINT16_MAX ) return false ; for ( size_t i = base ; i < ( base + len ) ; i ++ ) { this -> ioBitmap [ i / 8 ] |= ( 1 << ( i % 8 ) ) ; } return true ; }
Add an IO port range to the allow list so it can be accessed.
Add an IO port range to the allow list so it can be accessed .
// validate inputs // mark as allowed (set the bit)