#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include "pcioDrv.h"
Include dependency graph for pciotest.c:
Go to the source code of this file.
Functions | |
int | main () |
|
Definition at line 18 of file pciotest.c. 00019 { 00020 int data; 00021 int port; 00022 char cmd[10]; 00023 00024 signal( SIGINT, exit ); 00025 00026 while (1) 00027 { 00028 printf("\n>> "); 00029 scanf("%9s", cmd); 00030 if( 0 == strcmp(cmd, "in") ) 00031 { 00032 scanf("%x", &port); 00033 data = inputb( port ); 00034 printf("\tport %x = %x\n", port, data); 00035 } 00036 else if ( 0 == strcmp(cmd, "out") ) 00037 { 00038 scanf("%x %x", &port, &data); 00039 outputb( port, data ); 00040 } 00041 else 00042 printf("Commands are: \n\tin <port>\n\tout <port> <data>\n"); 00043 } 00044 00045 return 0; 00046 } |