Created
November 11, 2018 14:08
-
-
Save neuthral/4543d3402c8ed4aab07a47666e5c25d7 to your computer and use it in GitHub Desktop.
intx_check #processor #cpu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage $0 <PCI device>, ex: 9:00.0 | |
INTX=$(( 0x400 )) | |
ORIG=$(( 0x$(setpci -s $1 4.w) )) | |
if [ $(( $INTX & $ORIG )) -ne 0 ]; then | |
echo "INTx disable supported and enabled on $1" | |
exit 0 | |
fi | |
NEW=$(printf %04x $(( $INTX | $ORIG ))) | |
setpci -s $1 4.w=$NEW | |
NEW=$(( 0x$(setpci -s $1 4.w) )) | |
if [ $(( $INTX & $NEW )) -ne 0 ]; then | |
echo "INTx disable support available on $1" | |
else | |
echo "INTx disable support NOT available on $1" | |
fi | |
NEW=$(printf %04x $ORIG) | |
setpci -s $1 4.w=$NEW | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment