The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/compat/ndis/nbcompat.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #ifndef _NBCOMPAT_H_
    2 #define _NBCOMPAT_H_
    3 
    4 #include <sys/systm.h>
    5 #include <sys/lkm.h>
    6 #include <sys/cdefs.h>
    7 #include <sys/queue.h>
    8 #include <sys/mutex.h>
    9 #ifdef _KERNEL
   10 #include <sys/device.h>
   11 #else
   12 typedef struct device *device_t;
   13 #endif
   14 
   15 #define CTLFLAG_RW                      CTLFLAG_READWRITE
   16 
   17 #define mtx                             kmutex
   18 #define mtx_init(mtx, desc, type, opts) mutex_init(mtx, MUTEX_DEFAULT, IPL_NONE)
   19 /*
   20 #define mtx_lock(mtx)           ndis_mtx_ipl = splnet() mutex_enter(mtx)
   21 #define mtx_unlock(mtx)         splx(ndis_mtx_ipl)      mutex_exit(mtx)
   22 */
   23 
   24 void mtx_lock(struct mtx *mutex);
   25 void mtx_unlock(struct mtx *mutex);
   26 
   27 #define mtx_destroy(mtx)                mutex_destroy(mtx)
   28 
   29 /* I don't think this is going to work
   30 struct sysctl_ctx_entry {
   31         struct ctlname  *entry;
   32         TAILQ_ENTRY(sysctl_ctx_entry) link;
   33 };
   34 
   35 TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
   36 */
   37 
   38 #define ETHER_ALIGN 2
   39 #define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFF
   40 #ifdef PAE
   41 #define BUS_SPACE_MAXADDR       0xFFFFFFFFFULL
   42 #else
   43 #define BUS_SPACE_MAXADDR       0xFFFFFFFF
   44 #endif
   45 #define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFF
   46 #define I386_BUS_SPACE_MEM      1
   47 
   48 #define device_get_softc        (struct ndis_softc *)
   49 #define ticks                   hardclock_ticks
   50 #define p_siglist               p_sigctx.ps_siglist
   51 
   52 #ifndef __DECONST
   53 #define __DECONST(type, var)    ((type)(uintptr_t)(const void *)(var))
   54 #endif
   55 
   56 /* 4096 on x86 */
   57 #ifndef PAGE_SIZE
   58 #define PAGE_SIZE               4096
   59 #endif
   60 #define I386_BUS_SPACE_IO       0
   61 
   62 #define device_get_nameunit(dev)        device_xname(dev)
   63 
   64 /* FreeBSD Loadable Kernel Module commands that have NetBSD counterparts */
   65 #define MOD_LOAD        LKM_E_LOAD
   66 #define MOD_UNLOAD      LKM_E_UNLOAD
   67 
   68 /* ethercom/arpcom */
   69 #define ac_if ec_if
   70 
   71 #ifdef __NetBSD__
   72 #define MAX_SYSCTL_LEN 256
   73 #endif
   74 
   75 /* Capabilities that interfaces can advertise. */
   76 /* TODO: is this the correct mapping? */
   77 #define IFCAP_TXCSUM (IFCAP_CSUM_IPv4_Tx|IFCAP_CSUM_TCPv4_Tx|IFCAP_CSUM_UDPv4_Tx|IFCAP_CSUM_TCPv6_Tx|IFCAP_CSUM_UDPv6_Tx)
   78 #define IFCAP_RXCSUM (IFCAP_CSUM_IPv4_Rx|IFCAP_CSUM_TCPv4_Rx|IFCAP_CSUM_UDPv4_Rx|IFCAP_CSUM_TCPv6_Rx|IFCAP_CSUM_UDPv6_Rx)
   79 #define CSUM_IP  M_CSUM_IPv4 /*(IFCAP_CSUM_IPv4_Rx |IFCAP_CSUM_IPv4_Tx)*/
   80 #define CSUM_TCP M_CSUM_TCPv4 /*(IFCAP_CSUM_TCPv4_Rx|IFCAP_CSUM_TCPv4_Tx)*/
   81 #define CSUM_UDP M_CSUM_UDPv4 /*(IFCAP_CSUM_UDPv4_Rx|IFCAP_CSUM_UDPv4_Tx)*/
   82 
   83 typedef vaddr_t                 vm_offset_t;
   84 typedef vsize_t                 vm_size_t;
   85 typedef uint16_t                linker_file_t;
   86 typedef struct lkm_table *      module_t;
   87 
   88 /* Write our own versions of some FreeBSD functions */
   89 struct ndis_resource;
   90 #define SYS_RES_IOPORT 0
   91 #define SYS_RES_MEMORY 1
   92 int     bus_release_resource(device_t dev, int type, int rid,
   93                              struct ndis_resource *r);
   94 int     device_is_attached(device_t dev);
   95 
   96 /* This is the same thing as NetBSD's kthread_create1(), except
   97  * the stack can be specified.
   98  */
   99 int
  100 ndis_kthread_create(void (*func)(void *), void *arg,
  101     struct proc **newpp, void *stack, size_t stacksize, const char *name);
  102 
  103 #endif /* _NBCOMPAT_H_ */

Cache object: de585d6f8ebb06bdd2dafc678384ad40


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.