Hi,

continuing where we left off before the hackathon I would like to add
a diff to the 64-bit bus_addr_t discussion.  This diff does not
increase the size of bus_addr_t.  Instead it changes the argument
of the function pointer stored in the bus tag from bus_addr_t to
uint64_t.  This is an arm only change and will not affect any other
architecture.

This is needed to pass virtual addresses retrieved from the device tree
between the different simple-busses in the tree topology.  In the end
every single hardware that we want to speak to is in the 32-bit range,
not outside.  This means the final bus_space_map(9) will work on a
32-bit value.

Opinions? ok?

Patrick

diff --git sys/arch/arm/armv7/armv7_space.c sys/arch/arm/armv7/armv7_space.c
index 4f6c1e0..fbd558a 100644
--- sys/arch/arm/armv7/armv7_space.c
+++ sys/arch/arm/armv7/armv7_space.c
@@ -165,7 +165,7 @@ struct bus_space armv7_bs_tag = {
 };
 
 int
-armv7_bs_map(void *t, bus_addr_t bpa, bus_size_t size,
+armv7_bs_map(void *t, uint64_t bpa, bus_size_t size,
              int flags, bus_space_handle_t *bshp)
 {
        u_long startpa, endpa, pa;
diff --git sys/arch/arm/include/bus.h sys/arch/arm/include/bus.h
index f00c897..c108359 100644
--- sys/arch/arm/include/bus.h
+++ sys/arch/arm/include/bus.h
@@ -93,7 +93,7 @@ struct bus_space {
        void            *bs_cookie;
 
        /* mapping/unmapping */
-       int             (*bs_map) (void *, bus_addr_t, bus_size_t,
+       int             (*bs_map) (void *, uint64_t, bus_size_t,
                            int, bus_space_handle_t *);
        void            (*bs_unmap) (void *, bus_space_handle_t,
                            bus_size_t);
@@ -373,7 +373,7 @@ struct bus_space {
  */
 
 #define bs_map_proto(f)                                                        
\
-int    __bs_c(f,_bs_map) (void *t, bus_addr_t addr,            \
+int    __bs_c(f,_bs_map) (void *t, uint64_t addr,              \
            bus_size_t size, int flags, bus_space_handle_t *bshp);
 
 #define bs_unmap_proto(f)                                              \
diff --git sys/arch/arm/simplebus/simplebus.c sys/arch/arm/simplebus/simplebus.c
index d2f5bfe..325e149 100644
--- sys/arch/arm/simplebus/simplebus.c
+++ sys/arch/arm/simplebus/simplebus.c
@@ -30,7 +30,7 @@ int simplebus_match(struct device *, void *, void *);
 void simplebus_attach(struct device *, struct device *, void *);
 
 void simplebus_attach_node(struct device *, int);
-int simplebus_bs_map(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t 
*);
+int simplebus_bs_map(void *, uint64_t, bus_size_t, int, bus_space_handle_t *);
 
 struct simplebus_softc {
        struct device            sc_dev;
@@ -205,7 +205,7 @@ simplebus_attach_node(struct device *self, int node)
  * Translate memory address if needed.
  */
 int
-simplebus_bs_map(void *t, bus_addr_t bpa, bus_size_t size,
+simplebus_bs_map(void *t, uint64_t bpa, bus_size_t size,
     int flag, bus_space_handle_t *bshp)
 {
        struct simplebus_softc *sc = (struct simplebus_softc *)t;
diff --git sys/arch/armv7/armv7/armv7_machdep.c 
sys/arch/armv7/armv7/armv7_machdep.c
index e869c2c..839e45b 100644
--- sys/arch/armv7/armv7/armv7_machdep.c
+++ sys/arch/armv7/armv7/armv7_machdep.c
@@ -199,7 +199,7 @@ int   safepri = 0;
 /* Prototypes */
 
 char   bootargs[MAX_BOOT_STRING];
-int    bootstrap_bs_map(void *, bus_addr_t, bus_size_t, int,
+int    bootstrap_bs_map(void *, uint64_t, bus_size_t, int,
     bus_space_handle_t *);
 void   process_kernel_args(char *);
 void   consinit(void);
@@ -318,7 +318,7 @@ read_ttb(void)
 static vaddr_t section_free = 0xfd000000; /* XXX - huh */
 
 int
-bootstrap_bs_map(void *t, bus_addr_t bpa, bus_size_t size,
+bootstrap_bs_map(void *t, uint64_t bpa, bus_size_t size,
     int flags, bus_space_handle_t *bshp)
 {
        u_long startpa, pa, endpa;
@@ -393,7 +393,7 @@ initarm(void *arg0, void *arg1, void *arg2, paddr_t 
loadaddr)
 
        /* early bus_space_map support */
        struct bus_space tmp_bs_tag;
-       int     (*map_func_save)(void *, bus_addr_t, bus_size_t, int,
+       int     (*map_func_save)(void *, uint64_t, bus_size_t, int,
            bus_space_handle_t *);
 
        if (arg0)

Reply via email to