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

Cache object: ea06af30a51b45883538966650bc4311


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