From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] tlsf malloc: enable 64bit support on 64bit architectures
Date: Fri, 22 May 2015 09:41:06 +0200 [thread overview]
Message-ID: <1432280466-7055-1-git-send-email-s.hauer@pengutronix.de> (raw)
On 64bit architectures TLSF_64BIT should be defined. Decide that
depending on the CONFIG_64BIT symbol. When 64bit support is enabled
all allocations will be aligned to 8 byte boundaries which is necessary
for architectures that do not support unaligned accesses or have
a performance penalty for unaligned accesses.
Also changes the undefined tlsf_decl to 'static'.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
common/tlsfbits.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/common/tlsfbits.h b/common/tlsfbits.h
index 93466e4..edbac80 100644
--- a/common/tlsfbits.h
+++ b/common/tlsfbits.h
@@ -3,6 +3,10 @@
#include <linux/bitops.h>
+#ifdef CONFIG_64BIT
+#define TLSF_64BIT
+#endif
+
/*
** Architecture-specific bit manipulation routines.
**
@@ -33,7 +37,7 @@ static int tlsf_fls(unsigned int word)
/* Possibly 64-bit version of tlsf_fls. */
#if defined (TLSF_64BIT)
-tlsf_decl int tlsf_fls_sizet(size_t size)
+static int tlsf_fls_sizet(size_t size)
{
int high = (int)(size >> 32);
int bits = 0;
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
reply other threads:[~2015-05-22 7:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1432280466-7055-1-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox