Port-macppc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Uninitialized variable heathrow_FCR?



Hi,

src/sys/arch/macppc/dev/if_bm.c function bmac_reset_chip() uses extern
symbol 'heathrow_FCR' to toggle some bits in the FCR (EnetEnable,
ResetEnetCell, etc.).

However such 'heathrow_FCR' symbol does not seem to be initialized
anywhere in arch/macppc/ nor in arch/powerpc/:

$ grep -r heathrow_FCR macppc
macppc/dev/if_bm.c:extern volatile uint32_t *heathrow_FCR;
macppc/dev/if_bm.c:     v = in32rb(heathrow_FCR);
macppc/dev/if_bm.c:     out32rb(heathrow_FCR, v);
macppc/dev/if_bm.c:     out32rb(heathrow_FCR, v);
macppc/dev/if_bm.c:     out32rb(heathrow_FCR, v);
macppc/dev/if_bm.c:     out32rb(heathrow_FCR, v);
macppc/macppc/machdep.c:volatile uint32_t *heathrow_FCR = NULL;
$ grep -r heathrow_FCR powerpc
$ ^D

Previously to ppcoea-renovation, the symbol was initialized on
arch/macppc/macppc/extintr.c.

A simple fix (rather ugly) would be to use 'ca->ca_baseaddr + 0x38',
where 'ca' is the struct confargs passed by obio, and drop the
heathrow_FCR variable.

If obio exported accessor functions for the FCRs, this would be another
candidate to use them.

Regards,
Marco.


Home | Main Index | Thread Index | Old Index