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/sys/memrange.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 
    2 /*
    3  * Memory range attribute operations, peformed on /dev/mem
    4  *
    5  * $FreeBSD: src/sys/sys/memrange.h,v 1.4.2.2 2002/09/16 21:58:37 dwmalone Exp $
    6  * $DragonFly: src/sys/sys/memrange.h,v 1.4 2006/12/17 20:07:33 dillon Exp $
    7  */
    8 
    9 #ifndef _SYS_MEMRANGE_H_
   10 #define _SYS_MEMRANGE_H_
   11 
   12 #ifndef _SYS_TYPES_H_
   13 #include <sys/types.h>
   14 #endif
   15 #ifndef _SYS_IOCCOM_H_
   16 #include <sys/ioccom.h>
   17 #endif
   18 
   19 #ifdef _KERNEL
   20 
   21 #ifndef _SYS_MALLOC_H_
   22 #include <sys/malloc.h>
   23 #endif
   24 
   25 #endif
   26 
   27 /* Memory range attributes */
   28 #define MDF_UNCACHEABLE         (1<<0)  /* region not cached */
   29 #define MDF_WRITECOMBINE        (1<<1)  /* region supports "write combine" action */
   30 #define MDF_WRITETHROUGH        (1<<2)  /* write-through cached */
   31 #define MDF_WRITEBACK           (1<<3)  /* write-back cached */
   32 #define MDF_WRITEPROTECT        (1<<4)  /* read-only region */
   33 #define MDF_UNKNOWN             (1<<5)  /* any state we don't understand */
   34 #define MDF_ATTRMASK            (0x00ffffff)
   35 
   36 #define MDF_FIXBASE             (1<<24) /* fixed base */
   37 #define MDF_FIXLEN              (1<<25) /* fixed length */
   38 #define MDF_FIRMWARE            (1<<26) /* set by firmware (XXX not useful?) */
   39 #define MDF_ACTIVE              (1<<27) /* currently active */
   40 #define MDF_BOGUS               (1<<28) /* we don't like it */
   41 #define MDF_FIXACTIVE           (1<<29) /* can't be turned off */
   42 #define MDF_BUSY                (1<<30) /* range is in use */
   43 #define MDF_FORCE               (1<<31) /* force risky changes */
   44 
   45 struct mem_range_desc
   46 {
   47         u_int64_t       mr_base;
   48         u_int64_t       mr_len;
   49         int             mr_flags;
   50         char            mr_owner[8];
   51 };
   52 
   53 struct mem_range_op
   54 {
   55         struct mem_range_desc   *mo_desc;
   56         int                     mo_arg[2];
   57 #define MEMRANGE_SET_UPDATE     0
   58 #define MEMRANGE_SET_REMOVE     1
   59         /* XXX want a flag that says "set and undo when I exit" */
   60 };
   61 
   62 #define MEMRANGE_GET    _IOWR('m', 50, struct mem_range_op)
   63 #define MEMRANGE_SET    _IOW('m', 51, struct mem_range_op)
   64 
   65 #ifdef _KERNEL
   66 
   67 MALLOC_DECLARE(M_MEMDESC);
   68 
   69 struct mem_range_softc;
   70 struct mem_range_ops
   71 {
   72         void    (*init)(struct mem_range_softc *sc);
   73         int     (*set)(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg);
   74         void    (*initAP)(struct mem_range_softc *sc);
   75         void    (*set_iopl)(struct mem_range_softc *sc);
   76         void    (*clr_iopl)(struct mem_range_softc *sc);
   77 };
   78 
   79 struct mem_range_softc 
   80 {
   81         struct mem_range_ops    *mr_op;
   82         int                     mr_cap;
   83         int                     mr_ndesc;
   84         struct mem_range_desc   *mr_desc;
   85 };
   86 
   87 extern struct mem_range_softc mem_range_softc;
   88 
   89 extern int mem_range_attr_get(struct mem_range_desc *mrd, int *arg);
   90 extern int mem_range_attr_set(struct mem_range_desc *mrd, int *arg);
   91 extern void mem_range_AP_init(void);
   92 extern int cpu_set_iopl(void);
   93 extern int cpu_clr_iopl(void);
   94 #endif
   95 
   96 #endif

Cache object: 447d7a5129f6f1818962b4001da1cd20


[ 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.