Make sure we use the correct REGISTER_NODE macro when registering the /memory and /virtual-memory nodes.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- openbios-devel/arch/sparc64/lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/openbios-devel/arch/sparc64/lib.c b/openbios-devel/arch/sparc64/lib.c index e9101af..4709ca8 100644 --- a/openbios-devel/arch/sparc64/lib.c +++ b/openbios-devel/arch/sparc64/lib.c @@ -458,10 +458,10 @@ NODE_METHODS(mmu) = { void ob_mmu_init(const char *cpuname, uint64_t ram_size) { /* memory node */ - REGISTER_NODE_METHODS(memory, "/memory"); + REGISTER_NODE(memory);
/* MMU node */ - REGISTER_NODE_METHODS(mmu, "/virtual-memory"); + REGISTER_NODE(mmu);
ofmem_register(find_dev("/memory"), find_dev("/virtual-memory"));
Remove unused functions from the sbus and obio drivers.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- openbios-devel/drivers/obio.c | 64 ----------------------------------------- openbios-devel/drivers/sbus.c | 25 ---------------- 2 files changed, 89 deletions(-)
diff --git a/openbios-devel/drivers/obio.c b/openbios-devel/drivers/obio.c index 7c135a3..3fd8ece 100644 --- a/openbios-devel/drivers/obio.c +++ b/openbios-devel/drivers/obio.c @@ -397,45 +397,6 @@ ob_smp_init(unsigned long mem_size) }
static void -ob_obio_open(__attribute__((unused))int *idx) -{ - int ret=1; - RET ( -ret ); -} - -static void -ob_obio_close(__attribute__((unused))int *idx) -{ - selfword("close-deblocker"); -} - -static void -ob_obio_initialize(__attribute__((unused))int *idx) -{ - push_str("/"); - fword("find-device"); - fword("new-device"); - - push_str("obio"); - fword("device-name"); - - push_str("hierarchical"); - fword("device-type"); - - PUSH(2); - fword("encode-int"); - push_str("#address-cells"); - fword("property"); - - PUSH(1); - fword("encode-int"); - push_str("#size-cells"); - fword("property"); - - fword("finish-device"); -} - -static void ob_set_obio_ranges(uint64_t base) { push_str("/obio"); @@ -458,27 +419,6 @@ ob_set_obio_ranges(uint64_t base) fword("property"); }
-static void -ob_obio_decodeunit(__attribute__((unused)) int *idx) -{ - fword("decode-unit-sbus"); -} - - -static void -ob_obio_encodeunit(__attribute__((unused)) int *idx) -{ - fword("encode-unit-sbus"); -} - -NODE_METHODS(ob_obio) = { - { NULL, ob_obio_initialize }, - { "open", ob_obio_open }, - { "close", ob_obio_close }, - { "encode-unit", ob_obio_encodeunit }, - { "decode-unit", ob_obio_decodeunit }, -}; -
int ob_obio_init(uint64_t slavio_base, unsigned long fd_offset, @@ -491,10 +431,6 @@ ob_obio_init(uint64_t slavio_base, unsigned long fd_offset, // http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/NCR89C105.tx...
//printk("Initializing OBIO devices...\n"); -#if 0 // XXX - REGISTER_NAMED_NODE(ob_obio, "/obio"); - device_end(); -#endif ob_set_obio_ranges(slavio_base);
// Zilog Z8530 serial ports, see http://www.zilog.com diff --git a/openbios-devel/drivers/sbus.c b/openbios-devel/drivers/sbus.c index a9b26c0..4caa59a 100644 --- a/openbios-devel/drivers/sbus.c +++ b/openbios-devel/drivers/sbus.c @@ -369,31 +369,6 @@ sbus_probe_slot_ss600mp(unsigned int slot, uint64_t base) } }
-static void -ob_sbus_open(void) -{ - int ret=1; - RET ( -ret ); -} - -static void -ob_sbus_close(void) -{ - selfword("close-deblocker"); -} - -static void -ob_sbus_initialize(void) -{ -} - - -NODE_METHODS(ob_sbus_node) = { - { NULL, ob_sbus_initialize }, - { "open", ob_sbus_open }, - { "close", ob_sbus_close }, -}; - struct sbus_offset { int slot, type; uint64_t base;
Explicitly mark the enum types in usbohci_private.h as extern. This prevents them from being allocated as common types in each object file and so avoids "warning: multiple common of... " being emitted by gcc.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- openbios-devel/drivers/usbohci_private.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/openbios-devel/drivers/usbohci_private.h b/openbios-devel/drivers/usbohci_private.h index b3a723e..99c9641 100644 --- a/openbios-devel/drivers/usbohci_private.h +++ b/openbios-devel/drivers/usbohci_private.h @@ -43,7 +43,7 @@ // FIXME: fake typedef enum { CMD} reg;
- enum { + extern enum { NumberDownstreamPorts = 1<<0, PowerSwitchingMode = 1<<8, NoPowerSwitching = 1<<9, @@ -53,17 +53,17 @@ PowerOnToPowerGoodTime = 1<<24 } HcRhDescriptorAReg;
- enum { + extern enum { NumberDownstreamPortsMask = MASK(0, 8), PowerOnToPowerGoodTimeMask = MASK(24, 8) } HcRhDescriptorAMask;
- enum { + extern enum { DeviceRemovable = 1<<0, PortPowerControlMask = 1<<16 } HcRhDescriptorBReg;
- enum { + extern enum { CurrentConnectStatus = 1<<0, PortEnableStatus = 1<<1, PortSuspendStatus = 1<<2, @@ -77,7 +77,7 @@ PortOverCurrentIndicatorChange = 1<<19, PortResetStatusChange = 1<<20 } HcRhPortStatusRead; - enum { + extern enum { ClearPortEnable = 1<<0, SetPortEnable = 1<<1, SetPortSuspend = 1<<2, @@ -87,7 +87,7 @@ ClearPortPower = 1<<9, } HcRhPortStatusSet;
- enum { + extern enum { LocalPowerStatus = 1<<0, OverCurrentIndicator = 1<<1, DeviceRemoteWakeupEnable = 1<<15, @@ -96,18 +96,18 @@ ClearRemoteWakeupEnable = 1<<31 } HcRhStatusReg;
- enum { + extern enum { FrameInterval = 1<<0, FSLargestDataPacket = 1<<16, FrameIntervalToggle = 1<<31 } HcFmIntervalOffset; - enum { + extern enum { FrameIntervalMask = MASK(0, 14), FSLargestDataPacketMask = MASK(16, 15), FrameIntervalToggleMask = MASK(31, 1) } HcFmIntervalMask;
- enum { + extern enum { ControlBulkServiceRatio = 1<<0, PeriodicListEnable = 1<<2, IsochronousEnable = 1<<3, @@ -119,7 +119,7 @@ RemoteWakeupEnable = 1<<10 } HcControlReg;
- enum { + extern enum { ControlBulkServiceRatioMask = MASK(0, 2), HostControllerFunctionalStateMask = MASK(6, 2) } HcControlMask; @@ -131,7 +131,7 @@ USBSuspend = 3*HostControllerFunctionalState };
- enum { + extern enum { HostControllerReset = 1<<0, ControlListFilled = 1<<1, BulkListFilled = 1<<2, @@ -139,16 +139,16 @@ SchedulingOverrunCount = 1<<16 } HcCommandStatusReg;
- enum { + extern enum { SchedulingOverrunCountMask = MASK(16, 2) } HcCommandStatusMask;
- enum { + extern enum { FrameRemaining = 1<<0, FrameRemainingToggle = 1<<31 } HcFmRemainingReg;
- enum { + extern enum { SchedulingOverrung = 1<<0, WritebackDoneHead = 1<<1, StartofFrame = 1<<2,
After these patches there's still an extra warning (besides the string.h bit):
In file included from /builddir/build/BUILD/openbios-1.1/drivers/obio.c:14:0: /builddir/build/BUILD/openbios-1.1/drivers/obio.c:30:23: warning: 'ob_obio_size_' defined but not used [-Wunused-const-variable] DECLARE_UNNAMED_NODE( ob_obio, INSTALL_OPEN, sizeof(int) ); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:132:18: note: in definition of macro 'DECLARE_UNNAMED_NODE' static const int name##_size_ = size; ^~~~ /builddir/build/BUILD/openbios-1.1/drivers/obio.c:30:23: warning: 'ob_obio_flags_' defined but not used [-Wunused-const-variable] DECLARE_UNNAMED_NODE( ob_obio, INSTALL_OPEN, sizeof(int) ); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:131:18: note: in definition of macro 'DECLARE_UNNAMED_NODE' static const int name##_flags_ = flags; \
- Cole
On 03/11/2016 11:25 AM, Mark Cave-Ayland wrote:
Make sure we use the correct REGISTER_NODE macro when registering the /memory and /virtual-memory nodes.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
openbios-devel/arch/sparc64/lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/openbios-devel/arch/sparc64/lib.c b/openbios-devel/arch/sparc64/lib.c index e9101af..4709ca8 100644 --- a/openbios-devel/arch/sparc64/lib.c +++ b/openbios-devel/arch/sparc64/lib.c @@ -458,10 +458,10 @@ NODE_METHODS(mmu) = { void ob_mmu_init(const char *cpuname, uint64_t ram_size) { /* memory node */
- REGISTER_NODE_METHODS(memory, "/memory");
REGISTER_NODE(memory);
/* MMU node */
- REGISTER_NODE_METHODS(mmu, "/virtual-memory");
REGISTER_NODE(mmu);
ofmem_register(find_dev("/memory"), find_dev("/virtual-memory"));
On 11/03/16 19:05, Cole Robinson wrote:
After these patches there's still an extra warning (besides the string.h bit):
In file included from /builddir/build/BUILD/openbios-1.1/drivers/obio.c:14:0: /builddir/build/BUILD/openbios-1.1/drivers/obio.c:30:23: warning: 'ob_obio_size_' defined but not used [-Wunused-const-variable] DECLARE_UNNAMED_NODE( ob_obio, INSTALL_OPEN, sizeof(int) ); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:132:18: note: in definition of macro 'DECLARE_UNNAMED_NODE' static const int name##_size_ = size; ^~~~ /builddir/build/BUILD/openbios-1.1/drivers/obio.c:30:23: warning: 'ob_obio_flags_' defined but not used [-Wunused-const-variable] DECLARE_UNNAMED_NODE( ob_obio, INSTALL_OPEN, sizeof(int) ); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:131:18: note: in definition of macro 'DECLARE_UNNAMED_NODE' static const int name##_flags_ = flags; \
- Cole
Looks like I missed removing the final DECLARE_UNNAMED_NODE define at the top of the file - this should be fixed by the v2 sent out.
The fact that the string.h warning is only present for the PPC build makes me suspicious that this is a compiler bug. With the v2 patchset applied, is that enough for you to get one of the Fedora compiler guys to take a quick look at this?
ATB,
Mark.
On 03/12/2016 06:25 AM, Mark Cave-Ayland wrote:
On 11/03/16 19:05, Cole Robinson wrote:
After these patches there's still an extra warning (besides the string.h bit):
In file included from /builddir/build/BUILD/openbios-1.1/drivers/obio.c:14:0: /builddir/build/BUILD/openbios-1.1/drivers/obio.c:30:23: warning: 'ob_obio_size_' defined but not used [-Wunused-const-variable] DECLARE_UNNAMED_NODE( ob_obio, INSTALL_OPEN, sizeof(int) ); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:132:18: note: in definition of macro 'DECLARE_UNNAMED_NODE' static const int name##_size_ = size; ^~~~ /builddir/build/BUILD/openbios-1.1/drivers/obio.c:30:23: warning: 'ob_obio_flags_' defined but not used [-Wunused-const-variable] DECLARE_UNNAMED_NODE( ob_obio, INSTALL_OPEN, sizeof(int) ); ^ /builddir/build/BUILD/openbios-1.1/include/libopenbios/bindings.h:131:18: note: in definition of macro 'DECLARE_UNNAMED_NODE' static const int name##_flags_ = flags; \
- Cole
Looks like I missed removing the final DECLARE_UNNAMED_NODE define at the top of the file - this should be fixed by the v2 sent out.
Tested, it works. Thanks!
The fact that the string.h warning is only present for the PPC build makes me suspicious that this is a compiler bug. With the v2 patchset applied, is that enough for you to get one of the Fedora compiler guys to take a quick look at this?
Actually I think it _is_ the fixed gcc issue pointed out earlier... I forgot that in fedora, the cross gcc builds are packaged separately from the main gcc package. The main fedora gcc package has the fix backported, but the cross-gcc doesn't have it yet.
- Cole
On 15/03/16 18:19, Cole Robinson wrote:
Looks like I missed removing the final DECLARE_UNNAMED_NODE define at the top of the file - this should be fixed by the v2 sent out.
Tested, it works. Thanks!
The fact that the string.h warning is only present for the PPC build makes me suspicious that this is a compiler bug. With the v2 patchset applied, is that enough for you to get one of the Fedora compiler guys to take a quick look at this?
Actually I think it _is_ the fixed gcc issue pointed out earlier... I forgot that in fedora, the cross gcc builds are packaged separately from the main gcc package. The main fedora gcc package has the fix backported, but the cross-gcc doesn't have it yet.
Great, thanks for testing! I should be able to commit these to SVN trunk over the weekend.
ATB,
Mark.