2 * Memory range attribute operations, peformed on /dev/mem
7 /* Memory range attributes */
8 #define MDF_UNCACHEABLE (1<<0) /* region not cached */
9 #define MDF_WRITECOMBINE (1<<1) /* region supports "write combine" action */
10 #define MDF_WRITETHROUGH (1<<2) /* write-through cached */
11 #define MDF_WRITEBACK (1<<3) /* write-back cached */
12 #define MDF_WRITEPROTECT (1<<4) /* read-only region */
13 #define MDF_UNKNOWN (1<<5) /* any state we don't understand */
14 #define MDF_ATTRMASK (0x00ffffff)
16 #define MDF_FIXBASE (1<<24) /* fixed base */
17 #define MDF_FIXLEN (1<<25) /* fixed length */
18 #define MDF_FIRMWARE (1<<26) /* set by firmware (XXX not useful?) */
19 #define MDF_ACTIVE (1<<27) /* currently active */
20 #define MDF_BOGUS (1<<28) /* we don't like it */
21 #define MDF_FIXACTIVE (1<<29) /* can't be turned off */
22 #define MDF_BUSY (1<<30) /* range is in use */
34 struct mem_range_desc *mo_desc;
36 #define MEMRANGE_SET_UPDATE 0
37 #define MEMRANGE_SET_REMOVE 1
38 /* XXX want a flag that says "set and undo when I exit" */
41 #define MEMRANGE_GET _IOWR('m', 50, struct mem_range_op)
42 #define MEMRANGE_SET _IOW('m', 51, struct mem_range_op)
46 MALLOC_DECLARE(M_MEMDESC);
48 struct mem_range_softc;
51 void (*init)(struct mem_range_softc *sc);
52 int (*set)(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg);
53 void (*initAP)(struct mem_range_softc *sc);
56 struct mem_range_softc
58 struct mem_range_ops *mr_op;
61 struct mem_range_desc *mr_desc;
64 extern struct mem_range_softc mem_range_softc;
66 extern int mem_range_attr_get(struct mem_range_desc *mrd, int *arg);
67 extern int mem_range_attr_set(struct mem_range_desc *mrd, int *arg);
68 extern void mem_range_AP_init(void);