Changeset babe786 in mainline for pci/pci.c


Ignore:
Timestamp:
2006-05-15T11:51:28Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
043dcc27
Parents:
52352ec
Message:

Simple registration of services at NS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pci/pci.c

    r52352ec rbabe786  
    1414#include <task.h>
    1515#include <stdlib.h>
     16#include <ipc.h>
     17#include <errno.h>
    1618
    1719#include "libpci/pci.h"
     
    1921#define PCI_CONF1       0xcf8
    2022#define PCI_CONF1_SIZE  8
     23
     24#define NAME            "PCI"
    2125
    2226int main(int argc, char *argv[])
     
    2731        char buf[80];
    2832
    29         printf("HelenOS PCI driver\n");
     33        int ipc_res;
     34        ipcarg_t ns_phone_addr;
     35
     36        printf("%s: HelenOS PCI driver\n", NAME);
    3037
    3138        /*
     
    4855        pci_cleanup(pacc);            /* Close everything */
    4956
     57        printf("%s: registering at naming service.\n", NAME);
     58        if (ipc_connect_to_me(PHONE_NS, 40, 70, &ns_phone_addr) != 0) {
     59                printf("Failed to register %s at naming service.\n", NAME);
     60                return -1;
     61        }
     62       
     63        printf("%s: accepting connections\n", NAME);
     64        while (1) {
     65                ipc_call_t call;
     66                ipc_callid_t callid;
     67               
     68                callid = ipc_wait_for_call(&call, 0);
     69                ipc_answer(callid, EHANGUP, 0, 0);
     70        }
    5071        return 0;
    5172}
Note: See TracChangeset for help on using the changeset viewer.