From patchwork Fri Sep 9 19:51:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 668211 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sW7C81p6Jz9s4n for ; Sat, 10 Sep 2016 05:52:20 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3sW7C810QZzDrvH for ; Sat, 10 Sep 2016 05:52:20 +1000 (AEST) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3sW7C30vlrzDrq8 for ; Sat, 10 Sep 2016 05:52:15 +1000 (AEST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7136E8B975; Fri, 9 Sep 2016 19:52:13 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-63.ams2.redhat.com [10.36.116.63]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u89Jq9Yq006604; Fri, 9 Sep 2016 15:52:12 -0400 From: Thomas Huth To: slof@lists.ozlabs.org Date: Fri, 9 Sep 2016 21:51:59 +0200 Message-Id: <1473450729-19359-2-git-send-email-thuth@redhat.com> In-Reply-To: <1473450729-19359-1-git-send-email-thuth@redhat.com> References: <1473450729-19359-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 09 Sep 2016 19:52:13 +0000 (UTC) Subject: [SLOF] [PATCH 01/11] paflof: Use CFLAGS from make.rules instead of completely redefining them X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" It's cumbersome to change the CFLAGS in multiple places in case they have to be changed. So let's use the global CFLAGS from make.rules for building Paflof, too. Since the global rules use some additional compiler warning flags, fix the now occuring compiler warnings in the Paflof code, too (mostly about missing or wrong prototypes). Signed-off-by: Thomas Huth --- slof/Makefile.inc | 4 +--- slof/allocator.c | 9 +++++---- slof/ppc64.c | 9 +++++---- slof/ppc64.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/slof/Makefile.inc b/slof/Makefile.inc index 8ad3337..d7a6b38 100644 --- a/slof/Makefile.inc +++ b/slof/Makefile.inc @@ -27,9 +27,7 @@ INCLBRDDIR ?= $(TOPBRDDIR)/include CPPFLAGS += -I. -I$(INCLCMNDIR) -I$(INCLBRDDIR) -I$(INCLCMNDIR)/$(CPUARCH) -CFLAGS = -DTARG=$(TARG) -static -Wall -W -std=gnu99 \ - -O2 -fomit-frame-pointer -msoft-float $(FLAG) $(CPUARCHDEF) \ - -fno-stack-protector -fno-strict-aliasing +CFLAGS += -DTARG=$(TARG) -static -std=gnu99 $(FLAG) $(CPUARCHDEF) ASFLAGS = -Wa,-mpower4 -Wa,-mregnames $(FLAG) $(CPUARCHDEF) LDFLAGS += -static -nostdlib -Wl,-q,-n diff --git a/slof/allocator.c b/slof/allocator.c index 279b50b..e8f8858 100644 --- a/slof/allocator.c +++ b/slof/allocator.c @@ -17,6 +17,7 @@ #include #include #include +#include #undef DEBUG //#define DEBUG @@ -45,17 +46,17 @@ struct bitmap { #define BM_WORD_MODULO(n) (n % BM_WORD_BITS) #define BM_NUM_BITS(reqsize, bsize) ((reqsize / bsize) + (reqsize % bsize? 1 : 0)) -void bm_clear_bit(unsigned long *bmw, int n) +static void bm_clear_bit(unsigned long *bmw, int n) { BM_WORD(bmw, n) &= ~BIT(BM_WORD_MODULO(n)); } -void bm_set_bit(unsigned long *bmw, int n) +static void bm_set_bit(unsigned long *bmw, int n) { BM_WORD(bmw, n) |= BIT(BM_WORD_MODULO(n)); } -bool bm_test_bit(unsigned long *bmw, int n) +static bool bm_test_bit(unsigned long *bmw, int n) { #ifdef DEBUG //printf("BMW %x, bitpos %d, value %d\n", &BM_WORD(bmw, n), n, !!(BM_WORD(bmw, n) & BIT(BM_WORD_MODULO(n)))); @@ -64,7 +65,7 @@ bool bm_test_bit(unsigned long *bmw, int n) } /* Improvement: can use FFS routines to get faster results */ -int bm_find_bits(struct bitmap *bm, unsigned int n_bits) +static int bm_find_bits(struct bitmap *bm, unsigned int n_bits) { unsigned int i, j, total_bits; int found = -1; diff --git a/slof/ppc64.c b/slof/ppc64.c index 619d95e..4fc92b9 100644 --- a/slof/ppc64.c +++ b/slof/ppc64.c @@ -10,8 +10,11 @@ * IBM Corporation - initial implementation *****************************************************************************/ +#include #include +void asm_cout(long Character,long UART,long NVRAM); + /* the exception frame should be page aligned * the_exception_frame is used by the handler to store a copy of all * registers after an exception; this copy can then be used by paflof's @@ -45,8 +48,7 @@ extern void io_putchar(unsigned char); extern unsigned long call_c(cell arg0, cell arg1, cell arg2, cell entry); -long -writeLogByte_wrapper(long x, long y) +static long writeLogByte_wrapper(long x, long y) { unsigned long result; @@ -66,8 +68,7 @@ writeLogByte_wrapper(long x, long y) * @param count number of bytes to be written * @return the number of bytes that have been written successfully */ -int -write(int fd, const void *buf, int count) +ssize_t write(int fd, const void *buf, size_t count) { int i; char *ptr = (char *)buf; diff --git a/slof/ppc64.h b/slof/ppc64.h index 59a1b90..e3a2cd2 100644 --- a/slof/ppc64.h +++ b/slof/ppc64.h @@ -34,7 +34,7 @@ extern cell the_mem[]; /* Space for the dictionary / the HERE pointer */ extern cell *restrict dp; extern cell *restrict rp; -void client_entry_point(); +void client_entry_point(void); extern unsigned long call_client(cell); extern long c_romfs_lookup(long, long, void *);