5,10 → 5,6 |
* Giorgio Buttazzo <giorgio@sssup.it> |
* Paolo Gai <pj@gandalf.sssup.it> |
* |
* Authors : |
* Paolo Gai <pj@gandalf.sssup.it> |
* (see the web pages for full authors list) |
* |
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
* |
* http://www.sssup.it |
33,54 → 29,45 |
* along with this program; if not, write to the Free Software |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* |
* |
* CVS : $Id: pcidemo.c,v 1.1 2002-11-11 08:22:46 pj Exp $ |
|
This is the pcitest Hartik's example. |
|
*/ |
|
#include "kernel/kern.h" |
#include "drivers/keyb.h" |
|
#include "drivers/llpci.h" |
#include "drivers/pci.h" |
#include "drivers/shark_linuxc26.h" |
#include "drivers/shark_pci26.h" |
|
void scan() |
{ |
BYTE bus, dev; |
int device_drivers_init() { |
|
LINUXC26_register_module(); |
|
PCI26_init(); |
|
/* Scan the devices connected to the PCI bus */ |
if (pci_init() == 1) { |
clear(); |
pci_show(); |
bus = 0; dev = 0; |
if (pcibios_find_device(0x8086, 0x7000, 0, &bus, &dev) == NULL) |
cprintf("Not found... %d %d\n", bus, dev); |
else cprintf("Found: %d \t %d\n", bus, dev); |
|
if (pcibios_find_class(0x300, 0, &bus, &dev) == NULL) |
cprintf("Not found... %d %d\n", bus, dev); |
else cprintf("Found: %d \t %d\n", bus, dev); |
} else cprintf("PCI not found!!!\n"); |
return 0; |
|
} |
|
void endfun(KEY_EVT *k) |
{ |
sys_end(); |
int device_drivers_close() { |
|
return 0; |
|
} |
|
|
int main (int argc, char *argv[]) |
{ |
KEY_EVT k; |
|
k.flag = CNTR_BIT; |
k.scan = KEY_C; |
k.ascii = 'c'; |
keyb_hook(k,endfun); |
|
scan(); |
|
sys_end(); |
return 0; |
unsigned long long i; |
|
device_drivers_init(); |
|
cprintf("Init Done...\n"); |
|
for (i=0;i<100000000;i++); |
|
device_drivers_close(); |
|
sys_end(); |
|
return 0; |
|
} |