* GET BACK TO ME IMMEDIATELY
From: GET BACK TO ME IMMEDIATELY @ 2011-04-10 19:24 UTC (permalink / raw)
Hello
I wish to ask for your consent for a partnership project that I would want both of us to execute mutually which is beneficial. However my name is Mr. Rodney Smith. Kindly get back to me to confirm the receipt of this massage so that I will give you full details of the project.
Send your reply to my private email at rodney_smith@ibibo.com
I am waiting for your permission.
Warm regards
Mr. Rodney Smith
Email:smithrodney@ibibo.com
^ permalink raw reply
* GET BACK TO ME IMMEDIATELY
From: GET BACK TO ME IMMEDIATELY @ 2011-04-10 19:24 UTC (permalink / raw)
Hello
I wish to ask for your consent for a partnership project that I would want both of us to execute mutually which is beneficial. However my name is Mr. Rodney Smith. Kindly get back to me to confirm the receipt of this massage so that I will give you full details of the project.
Send your reply to my private email at rodney_smith@ibibo.com
I am waiting for your permission.
Warm regards
Mr. Rodney Smith
Email:smithrodney@ibibo.com
^ permalink raw reply
* GET BACK TO ME IMMEDIATELY
From: GET BACK TO ME IMMEDIATELY @ 2011-04-10 19:24 UTC (permalink / raw)
Hello
I wish to ask for your consent for a partnership project that I would want both of us to execute mutually which is beneficial. However my name is Mr. Rodney Smith. Kindly get back to me to confirm the receipt of this massage so that I will give you full details of the project.
Send your reply to my private email at rodney_smith@ibibo.com
I am waiting for your permission.
Warm regards
Mr. Rodney Smith
Email:smithrodney@ibibo.com
^ permalink raw reply
* GET BACK TO ME IMMEDIATELY
From: GET BACK TO ME IMMEDIATELY @ 2011-04-10 19:24 UTC (permalink / raw)
Hello
I wish to ask for your consent for a partnership project that I would want both of us to execute mutually which is beneficial. However my name is Mr. Rodney Smith. Kindly get back to me to confirm the receipt of this massage so that I will give you full details of the project.
Send your reply to my private email at rodney_smith@ibibo.com
I am waiting for your permission.
Warm regards
Mr. Rodney Smith
Email:smithrodney@ibibo.com
^ permalink raw reply
* [U-Boot] [Nios] Pull Request
From: Wolfgang Denk @ 2011-04-10 19:23 UTC (permalink / raw)
To: u-boot
In-Reply-To: <4D9F09EC.70300@psyent.com>
Dear Scott McNutt,
In message <4D9F09EC.70300@psyent.com> you wrote:
> Dear Wolfgang,
>
> The following changes since commit 4db2fa7f9446d0f2fe8db3d62184b1212fe22707:
> Wolfgang Denk (1):
> Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
>
> are available in the git repository at:
>
> git://git.denx.de/u-boot-nios.git next
>
> Thomas Chou (1):
> nios2: reset cfi flash before reading env
>
> board/altera/nios2-generic/nios2-generic.c | 16 ++++++++++++++++
> 1 files changed, 16 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Philosophy is a game with objectives and no rules.
Mathematics is a game with rules and no objectives.
^ permalink raw reply
* [Qemu-devel] Re: [PATCH] target-ppc: remove #ifdef FLOAT128
From: Alexander Graf @ 2011-04-10 19:23 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: Peter Maydell, qemu-devel
In-Reply-To: <1302462766-8560-1-git-send-email-aurelien@aurel32.net>
On 10.04.2011, at 21:12, Aurelien Jarno wrote:
> Now that PPC defaults to softfloat which always provides float128
> support, there is no need to keep two version of the code, depending if
> float128 support is available or not. Suggested by Peter Maydell.
>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Looks good to me, but I'd leave this to Peter's ack.
Alex
^ permalink raw reply
* Re: [Qemu-devel] [PATCH 15/15] tcg: use ext op for deposit
From: Aurelien Jarno @ 2011-04-10 19:23 UTC (permalink / raw)
To: Alexander Graf; +Cc: peter.maydell, QEMU-devel Developers, Richard Henderson
In-Reply-To: <8E544975-03DA-484A-9768-41E2D1643074@suse.de>
On Tue, Apr 05, 2011 at 09:55:09AM +0200, Alexander Graf wrote:
>
> On 05.04.2011, at 06:54, Aurelien Jarno wrote:
>
> > On Mon, Apr 04, 2011 at 04:32:24PM +0200, Alexander Graf wrote:
> >> With the s390x target we use the deposit instruction to store 32bit values
> >> into 64bit registers without clobbering the upper 32 bits.
> >>
> >> This specific operation can be optimized slightly by using the ext operation
> >> instead of an explicit and in the deposit instruction. This patch adds that
> >> special case to the generic deposit implementation.
> >>
> >> Signed-off-by: Alexander Graf <agraf@suse.de>
> >> ---
> >> tcg/tcg-op.h | 6 +++++-
> >> 1 files changed, 5 insertions(+), 1 deletions(-)
> >
> > Have you really measuring a difference here? This should already be
> > handled, at least on x86, by this code:
> >
> > if (TCG_TARGET_REG_BITS == 64) {
> > if (val == 0xffffffffu) {
> > tcg_out_ext32u(s, r0, r0);
> > return;
> > }
> > if (val == (uint32_t)val) {
> > /* AND with no high bits set can use a 32-bit operation. */
> > rexw = 0;
> > }
> > }
>
> I've certainly looked at the -d op logs and seen that instead of creating a const tcg variable plus an AND there was now an extu opcode issued, yes. No idea why the case up there didn't trigger.
>
The question there is looking at -d out_asm. They should be the same at
the end as the code I pasted above is from tcg/i386/tcg-target.c.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply
* Re: [PATCH 03/11] revert: Introduce a struct to parse command-line options into
From: Jonathan Nieder @ 2011-04-10 19:21 UTC (permalink / raw)
To: Ramkumar Ramachandra; +Cc: Git List, Christian Couder, Daniel Barkalow
In-Reply-To: <1302448317-32387-4-git-send-email-artagnon@gmail.com>
Ramkumar Ramachandra wrote:
> [Subject: revert: Introduce a struct to parse command-line options into]
>
> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
This gives a hint of another way to avoid the usage() trouble
mentioned in patch 1: it might be possible to let the caller take care
of parsing arguments.
> --- a/builtin/revert.c
> +++ b/builtin/revert.c
> @@ -35,17 +35,27 @@ static const char * const cherry_pick_usage[] = {
> NULL
> };
>
> -static int edit, no_replay, no_commit, mainline, signoff, allow_ff;
> -static enum { REVERT, CHERRY_PICK } action;
> -static int commit_argc;
> -static const char **commit_argv;
> -static int allow_rerere_auto;
>
> +static struct {
> + enum { REVERT, CHERRY_PICK } action;
That would require giving this struct a name, so it can be passed
around. Not a bad idea anyway imho since then a person reading
top-to-bottom is not left in suspense:
struct cherry_pick_opts {
enum { REVERT, CHERRY_PICK } action;
unsigned edit:1;
unsigned no_replay:1;
...
};
^ permalink raw reply
* [U-Boot] Pull request u-boot-blackfin.git
From: Wolfgang Denk @ 2011-04-10 19:19 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1302238070-32427-1-git-send-email-vapier@gentoo.org>
Dear Mike Frysinger,
In message <1302238070-32427-1-git-send-email-vapier@gentoo.org> you wrote:
> The following changes since commit 4db2fa7f9446d0f2fe8db3d62184b1212fe22707:
>
> Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx (2011-04-05 12:24:20 +0200)
>
> are available in the git repository at:
>
> git://www.denx.de/git/u-boot-blackfin.git master
>
> Andreas Schallenberg (1):
> Blackfin: dnp5370: new board port
>
> Chong Huang (1):
> Blackfin: bf525-ucr2: new board port
>
> Cliff Cai (1):
> Blackfin: bfin_sdh: set all timer bits before transfer
>
> Kyle Moffett (1):
> Blackfin: replace "bfin_reset_or_hang()" with "panic()"
>
> Mike Frysinger (29):
> Blackfin: bf518f-ezbrd: don't require SPI logic all the time
> Blackfin: skip RAM display for 0 mem systems
> Blackfin: drop CONFIG_SYS_TEXT_BASE from boards
> Blackfin: unify bootmode based LDR_FLAGS setup
> Blackfin: move CONFIG_BFIN_CPU back to board config.h
> Blackfin: bf527-sdp: update custom CFLAGS paths
> Blackfin: bf537-pnav/blackstamp/blackvme: drop empty config.mk files
> Blackfin: serial: clean up muxing a bit
> Blackfin: bf537-minotaur/bf537-srv1: undefine nfs when net is disabled
> Blackfin: bf537: fix L1 data defines
> Blackfin: bf561-ezkit/ibf-dsp561: invert env offset/addr logic
> Blackfin: fix bd_t handling
> Blackfin: BF50x: new processor port
> Blackfin: drop duplicate system mmr and L1 scratch defines
> Blackfin: BF52x: unify duplicated headers
> Blackfin: BF537: unify duplicated headers
> Blackfin: only check for os log when we have external memory
> Blackfin: turn off caches when self initializing
> Blackfin: default to L1 bank A when L1 bank B does not exist
> Blackfin: bf506f-ezkit: new board port
> Blackfin: adi boards: drop old ELF define
> Blackfin: bootrom.h: sync with toolchain
> Blackfin: bootldr: use common defines
> Blackfin: ldrinfo: new command
> Blackfin: adi boards: enable ldrinfo
> Blackfin: adi boards: enable CONFIG_MONITOR_IS_IN_RAM
> Blackfin: bf548-ezkit: move env sector
> Blackfin: bf518f-ezbrd: get MAC from flash
> Blackfin: bf526-ezbrd: get MAC from flash
>
> Sonic Zhang (1):
> Blackfin: bfin_sdh: add support for multiblock operations
>
> MAINTAINERS | 10 +
> README | 1 +
> arch/blackfin/config.mk | 15 +-
> arch/blackfin/cpu/cpu.h | 1 -
> arch/blackfin/cpu/gpio.c | 8 +-
> arch/blackfin/cpu/initcode.c | 25 +-
> arch/blackfin/cpu/reset.c | 18 +-
> arch/blackfin/cpu/serial.h | 72 +-
> arch/blackfin/cpu/start.S | 45 +-
> arch/blackfin/cpu/traps.c | 2 +-
> arch/blackfin/include/asm/blackfin_cdef.h | 6 +
> arch/blackfin/include/asm/blackfin_def.h | 10 +
> arch/blackfin/include/asm/config.h | 10 +-
> arch/blackfin/include/asm/mach-bf506/BF504_cdef.h | 1782 ++++++++++++++++++++
> arch/blackfin/include/asm/mach-bf506/BF504_def.h | 944 +++++++++++
> arch/blackfin/include/asm/mach-bf506/BF506_cdef.h | 11 +
> arch/blackfin/include/asm/mach-bf506/BF506_def.h | 11 +
> arch/blackfin/include/asm/mach-bf506/anomaly.h | 128 ++
> arch/blackfin/include/asm/mach-bf506/def_local.h | 5 +
> arch/blackfin/include/asm/mach-bf506/gpio.h | 52 +
> arch/blackfin/include/asm/mach-bf506/portmux.h | 148 ++
> arch/blackfin/include/asm/mach-bf506/ports.h | 59 +
> arch/blackfin/include/asm/mach-bf518/BF512_def.h | 6 -
> .../asm/mach-bf527/ADSP-EDN-BF52x-extended_cdef.h | 994 -----------
> .../asm/mach-bf527/ADSP-EDN-BF52x-extended_def.h | 503 ------
> arch/blackfin/include/asm/mach-bf527/BF522_cdef.h | 986 +++++++++++-
> arch/blackfin/include/asm/mach-bf527/BF522_def.h | 495 ++++++-
> arch/blackfin/include/asm/mach-bf527/BF524_cdef.h | 20 +-
> arch/blackfin/include/asm/mach-bf527/BF524_def.h | 12 +-
> arch/blackfin/include/asm/mach-bf527/BF526_cdef.h | 358 +----
> arch/blackfin/include/asm/mach-bf527/BF526_def.h | 181 +--
> arch/blackfin/include/asm/mach-bf533/BF531_def.h | 6 -
> arch/blackfin/include/asm/mach-bf533/BF532_def.h | 6 -
> arch/blackfin/include/asm/mach-bf533/BF533_def.h | 6 -
> .../asm/mach-bf537/ADSP-EDN-BF534-extended_cdef.h | 1624 ------------------
> .../asm/mach-bf537/ADSP-EDN-BF534-extended_def.h | 819 ---------
> arch/blackfin/include/asm/mach-bf537/BF534_cdef.h | 1614 ++++++++++++++++++-
> arch/blackfin/include/asm/mach-bf537/BF534_def.h | 816 +++++++++-
> arch/blackfin/include/asm/mach-bf538/BF538_def.h | 6 -
> arch/blackfin/include/asm/mach-bf561/BF561_def.h | 7 +-
> .../include/asm/mach-common/bits/bootrom.h | 86 +-
> arch/blackfin/lib/board.c | 21 +-
> arch/blackfin/lib/u-boot.lds.S | 10 +-
> board/bct-brettl2/config.mk | 8 -
> .../config.mk => bf506f-ezkit/Makefile} | 34 +-
> board/bf506f-ezkit/bf506f-ezkit.c | 27 +
> board/bf518f-ezbrd/bf518f-ezbrd.c | 61 +-
> board/bf518f-ezbrd/config.mk | 8 -
> .../{blackstamp/config.mk => bf525-ucr2/Makefile} | 34 +-
> board/bf525-ucr2/bf525-ucr2.c | 16 +
> board/bf526-ezbrd/bf526-ezbrd.c | 29 +-
> board/bf526-ezbrd/config.mk | 8 -
> board/bf527-ad7160-eval/config.mk | 8 -
> board/bf527-ezkit/config.mk | 8 -
> board/bf527-sdp/config.mk | 10 +-
> board/bf533-ezkit/config.mk | 6 -
> board/bf533-stamp/config.mk | 6 -
> board/bf537-minotaur/config.mk | 8 +-
> board/bf537-srv1/config.mk | 8 +-
> board/bf537-stamp/config.mk | 6 -
> board/bf538f-ezkit/config.mk | 6 -
> board/bf548-ezkit/config.mk | 6 -
> board/bf561-acvilon/config.mk | 6 -
> board/bf561-ezkit/config.mk | 6 -
> board/cm-bf527/config.mk | 8 -
> board/cm-bf533/config.mk | 6 -
> board/cm-bf537e/config.mk | 6 -
> board/cm-bf537u/config.mk | 6 -
> board/cm-bf548/config.mk | 6 -
> board/cm-bf561/config.mk | 6 -
> board/{blackvme/config.mk => dnp5370/Makefile} | 36 +-
> board/dnp5370/dnp5370.c | 104 ++
> board/ibf-dsp561/config.mk | 6 -
> board/ip04/config.mk | 6 -
> board/tcm-bf518/config.mk | 8 -
> board/tcm-bf537/config.mk | 6 -
> boards.cfg | 3 +
> common/Makefile | 1 +
> common/cmd_bootldr.c | 21 +-
> common/cmd_ldrinfo.c | 192 +++
> doc/README.dnp5370 | 67 +
> drivers/mmc/bfin_sdh.c | 13 +-
> drivers/spi/bfin_spi.c | 2 +
> include/configs/bct-brettl2.h | 3 +-
> include/configs/bf506f-ezkit.h | 103 ++
> include/configs/bf518f-ezbrd.h | 1 +
> include/configs/bf525-ucr2.h | 102 ++
> include/configs/bf526-ezbrd.h | 1 +
> include/configs/bf527-ad7160-eval.h | 1 +
> include/configs/bf527-ezkit.h | 1 +
> include/configs/bf527-sdp.h | 1 +
> include/configs/bf533-ezkit.h | 1 +
> include/configs/bf533-stamp.h | 1 +
> include/configs/bf537-minotaur.h | 2 +
> include/configs/bf537-pnav.h | 1 +
> include/configs/bf537-srv1.h | 2 +
> include/configs/bf537-stamp.h | 1 +
> include/configs/bf538f-ezkit.h | 1 +
> include/configs/bf548-ezkit.h | 3 +-
> include/configs/bf561-acvilon.h | 3 +-
> include/configs/bf561-ezkit.h | 5 +-
> include/configs/bfin_adi_common.h | 3 +-
> include/configs/blackstamp.h | 1 +
> include/configs/blackvme.h | 3 +-
> include/configs/cm-bf527.h | 1 +
> include/configs/cm-bf533.h | 1 +
> include/configs/cm-bf537e.h | 1 +
> include/configs/cm-bf537u.h | 1 +
> include/configs/cm-bf548.h | 1 +
> include/configs/cm-bf561.h | 1 +
> include/configs/dnp5370.h | 128 ++
> include/configs/ibf-dsp561.h | 5 +-
> include/configs/ip04.h | 1 +
> include/configs/tcm-bf518.h | 1 +
> include/configs/tcm-bf537.h | 1 +
> 115 files changed, 8203 insertions(+), 4930 deletions(-)
> create mode 100644 arch/blackfin/include/asm/mach-bf506/BF504_cdef.h
> create mode 100644 arch/blackfin/include/asm/mach-bf506/BF504_def.h
> create mode 100644 arch/blackfin/include/asm/mach-bf506/BF506_cdef.h
> create mode 100644 arch/blackfin/include/asm/mach-bf506/BF506_def.h
> create mode 100644 arch/blackfin/include/asm/mach-bf506/anomaly.h
> create mode 100644 arch/blackfin/include/asm/mach-bf506/def_local.h
> create mode 100644 arch/blackfin/include/asm/mach-bf506/gpio.h
> create mode 100644 arch/blackfin/include/asm/mach-bf506/portmux.h
> create mode 100644 arch/blackfin/include/asm/mach-bf506/ports.h
> delete mode 100644 arch/blackfin/include/asm/mach-bf527/ADSP-EDN-BF52x-extended_cdef.h
> delete mode 100644 arch/blackfin/include/asm/mach-bf527/ADSP-EDN-BF52x-extended_def.h
> delete mode 100644 arch/blackfin/include/asm/mach-bf537/ADSP-EDN-BF534-extended_cdef.h
> delete mode 100644 arch/blackfin/include/asm/mach-bf537/ADSP-EDN-BF534-extended_def.h
> rename board/{bf537-pnav/config.mk => bf506f-ezkit/Makefile} (57%)
> create mode 100644 board/bf506f-ezkit/bf506f-ezkit.c
> rename board/{blackstamp/config.mk => bf525-ucr2/Makefile} (57%)
> create mode 100644 board/bf525-ucr2/bf525-ucr2.c
> rename board/{blackvme/config.mk => dnp5370/Makefile} (54%)
> create mode 100644 board/dnp5370/dnp5370.c
> create mode 100644 common/cmd_ldrinfo.c
> create mode 100644 doc/README.dnp5370
> create mode 100644 include/configs/bf506f-ezkit.h
> create mode 100644 include/configs/bf525-ucr2.h
> create mode 100644 include/configs/dnp5370.h
Applied, thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Nature is very un-American. Nature never hurries."
- William George Jordan
^ permalink raw reply
* Re: [PATCH 01/11] revert: Avoid calling die; return error instead
From: Jonathan Nieder @ 2011-04-10 19:14 UTC (permalink / raw)
To: Ramkumar Ramachandra; +Cc: Git List, Christian Couder, Daniel Barkalow
In-Reply-To: <1302448317-32387-2-git-send-email-artagnon@gmail.com>
Ramkumar Ramachandra wrote:
> [Subject: revert: Avoid calling die; return error instead]
>
> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Presumably this is because the sequencer is going to pick up after the
error and clean up a little (why doesn't the change description say
so?). Will it be resuming after that or just performing a little
cleanup before the exit?
Might make sense, but:
> --- a/builtin/revert.c
> +++ b/builtin/revert.c
> @@ -265,23 +265,23 @@ static struct tree *empty_tree(void)
> return tree;
> }
>
> -static NORETURN void die_dirty_index(const char *me)
> +static int error_dirty_index(const char *me)
> {
> if (read_cache_unmerged()) {
> die_resolve_conflict(me);
Won't that exit?
> } else {
This "else" could be removed (decreasing the indent of the rest by
one tab stop) since the "if" case has already returned or exited.
Not the subject of this patch, just an idea for earlier or later. ;-)
[...]
> @@ -331,7 +331,7 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
> (write_cache(index_fd, active_cache, active_nr) ||
> commit_locked_index(&index_lock)))
> /* TRANSLATORS: %s will be "revert" or "cherry-pick" */
> - die(_("%s: Unable to write new index file"), me);
> + return error(_("%s: Unable to write new index file"), me);
> rollback_lock_file(&index_lock);
What happens to index_lock in the error case?
[...]
> @@ -533,34 +533,39 @@ static void prepare_revs(struct rev_info *revs)
> revs->reverse = 1;
>
> argc = setup_revisions(commit_argc, commit_argv, revs, NULL);
> - if (argc > 1)
> - usage(*revert_or_cherry_pick_usage());
> + if (argc > 1) {
> + fprintf(stderr, "usage: %s", _(*revert_or_cherry_pick_usage()));
> + return 129;
> + }
Yuck. Maybe the error can be returned to the caller somehow, but
that seems somehow ambitious given that setup_revisions has all sorts
of ways to die anyway.
So you are bending the assumptions of many existing git functions (in
a good way).
I can think of at least three ways to go:
1) Come up with a convention to give more information about the nature
of returned errors in the functions you are touching. For
example, make sure errno is valid after the relevant functions, or
use multiple negative values to express the nature of the error.
So a caller could do:
if (prepare_revs(...)) {
if (errno == EINVAL)
usage(*revert_or_cherry_pick_usage());
die("BUG: unexpected error from prepare_revs");
}
Or:
2) Use set_die_routine or sigchain_push + atexit to declare what cleanup
has to happen before exiting. Keep using die().
3) Provide a new facility to register cleanup handlers that will free
resources and otherwise return to a consistent state before
unwinding the stack. This way, you'd still have to audit die()
calls to look for missing cleanup handlers, but they could stay as
die() rather than changing to "return error" and the worried
caller could use
set_die_routine(longjmp_to_here);
to keep git alive. I don't suggest doing this. It is a pain to
get right and not obviously cleaner than "return error", and some
errors really are unrecoverable (rather than just being a symptom
of programmers to lazy to write error recovery code :)).
Okay, I'm stopping here. Hope that helps.
Thanks,
Jonathan
^ permalink raw reply
* [Qemu-devel] [PATCH 5/5] target-i386: add floatx_{add, mul, sub} and use them
From: Aurelien Jarno @ 2011-04-10 19:13 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Aurelien Jarno
In-Reply-To: <1302462807-8795-1-git-send-email-aurelien@aurel32.net>
Add floatx_{add,mul,sub} defines, and use them instead of using direct
C operations.
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
target-i386/exec.h | 6 ++++++
target-i386/op_helper.c | 18 ++++++++----------
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/target-i386/exec.h b/target-i386/exec.h
index d6922f3..6ec1a4a 100644
--- a/target-i386/exec.h
+++ b/target-i386/exec.h
@@ -110,6 +110,9 @@ static inline void svm_check_intercept(uint32_t type)
#define float64_to_floatx float64_to_floatx80
#define floatx_to_float32 floatx80_to_float32
#define floatx_to_float64 floatx80_to_float64
+#define floatx_add floatx80_add
+#define floatx_mul floatx80_mul
+#define floatx_sub floatx80_sub
#define floatx_abs floatx80_abs
#define floatx_chs floatx80_chs
#define floatx_round_to_int floatx80_round_to_int
@@ -126,6 +129,9 @@ static inline void svm_check_intercept(uint32_t type)
#define float64_to_floatx(x, e) (x)
#define floatx_to_float32 float64_to_float32
#define floatx_to_float64(x, e) (x)
+#define floatx_add float64_add
+#define floatx_mul float64_mul
+#define floatx_sub float64_sub
#define floatx_abs float64_abs
#define floatx_chs float64_chs
#define floatx_round_to_int float64_round_to_int
diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
index 43fbd0c..a73427f 100644
--- a/target-i386/op_helper.c
+++ b/target-i386/op_helper.c
@@ -3711,22 +3711,22 @@ void helper_fucomi_ST0_FT0(void)
void helper_fadd_ST0_FT0(void)
{
- ST0 += FT0;
+ ST0 = floatx_add(ST0, FT0, &env->fp_status);
}
void helper_fmul_ST0_FT0(void)
{
- ST0 *= FT0;
+ ST0 = floatx_mul(ST0, FT0, &env->fp_status);
}
void helper_fsub_ST0_FT0(void)
{
- ST0 -= FT0;
+ ST0 = floatx_sub(ST0, FT0, &env->fp_status);
}
void helper_fsubr_ST0_FT0(void)
{
- ST0 = FT0 - ST0;
+ ST0 = floatx_sub(FT0, ST0, &env->fp_status);
}
void helper_fdiv_ST0_FT0(void)
@@ -3743,24 +3743,22 @@ void helper_fdivr_ST0_FT0(void)
void helper_fadd_STN_ST0(int st_index)
{
- ST(st_index) += ST0;
+ ST(st_index) = floatx_add(ST(st_index), ST0, &env->fp_status);
}
void helper_fmul_STN_ST0(int st_index)
{
- ST(st_index) *= ST0;
+ ST(st_index) = floatx_mul(ST(st_index), ST0, &env->fp_status);
}
void helper_fsub_STN_ST0(int st_index)
{
- ST(st_index) -= ST0;
+ ST(st_index) = floatx_sub(ST(st_index), ST0, &env->fp_status);
}
void helper_fsubr_STN_ST0(int st_index)
{
- CPU86_LDouble *p;
- p = &ST(st_index);
- *p = ST0 - *p;
+ ST(st_index) = floatx_sub(ST0, ST(st_index), &env->fp_status);
}
void helper_fdiv_STN_ST0(int st_index)
--
1.7.2.3
^ permalink raw reply related
* [Qemu-devel] [PATCH 4/5] softfloat: add float{32, 64, x80, 128}_unordered() functions
From: Aurelien Jarno @ 2011-04-10 19:13 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Aurelien Jarno
In-Reply-To: <1302462807-8795-1-git-send-email-aurelien@aurel32.net>
Add float{32,64,x80,128}_unordered() functions to softfloat, matching
the softfloat-native ones. This allow target-i386/ops_sse.h to be
compiled with softfloat.
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
fpu/softfloat.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
fpu/softfloat.h | 4 ++
2 files changed, 92 insertions(+), 0 deletions(-)
diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index 03fb948..9f94b0e 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -2481,6 +2481,29 @@ int float32_lt_quiet( float32 a, float32 b STATUS_PARAM )
}
/*----------------------------------------------------------------------------
+| Returns 1 if the single-precision floating-point values `a' and `b' cannot
+| be compared, and 0 otherwise. The comparison is performed according to the
+| IEC/IEEE Standard for Binary Floating-Point Arithmetic.
+*----------------------------------------------------------------------------*/
+
+int float32_unordered( float32 a, float32 b STATUS_PARAM )
+{
+ a = float32_squash_input_denormal(a STATUS_VAR);
+ b = float32_squash_input_denormal(b STATUS_VAR);
+
+ if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) )
+ || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) )
+ ) {
+ if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) {
+ float_raise( float_flag_invalid STATUS_VAR);
+ }
+ return 1;
+ }
+
+ return 0;
+}
+
+/*----------------------------------------------------------------------------
| Returns the result of converting the double-precision floating-point value
| `a' to the 32-bit two's complement integer format. The conversion is
| performed according to the IEC/IEEE Standard for Binary Floating-Point
@@ -3704,6 +3727,28 @@ int float64_lt_quiet( float64 a, float64 b STATUS_PARAM )
}
+/*----------------------------------------------------------------------------
+| Returns 1 if the double-precision floating-point values `a' and `b' cannot
+| be compared, and 0 otherwise. The comparison is performed according to the
+| IEC/IEEE Standard for Binary Floating-Point Arithmetic.
+*----------------------------------------------------------------------------*/
+
+int float64_unordered( float64 a, float64 b STATUS_PARAM )
+{
+ a = float64_squash_input_denormal(a STATUS_VAR);
+ b = float64_squash_input_denormal(b STATUS_VAR);
+
+ if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) )
+ || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) )
+ ) {
+ if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) {
+ float_raise( float_flag_invalid STATUS_VAR);
+ }
+ return 0;
+ }
+ return 1;
+}
+
#ifdef FLOATX80
/*----------------------------------------------------------------------------
@@ -4695,6 +4740,27 @@ int floatx80_lt_quiet( floatx80 a, floatx80 b STATUS_PARAM )
}
+/*----------------------------------------------------------------------------
+| Returns 1 if the extended double-precision floating-point values `a' and `b'
+| cannot be compared, and 0 otherwise. The comparison is performed according
+| to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
+*----------------------------------------------------------------------------*/
+int floatx80_unordered( floatx80 a, floatx80 b STATUS_PARAM )
+{
+ if ( ( ( extractFloatx80Exp( a ) == 0x7FFF )
+ && (uint64_t) ( extractFloatx80Frac( a )<<1 ) )
+ || ( ( extractFloatx80Exp( b ) == 0x7FFF )
+ && (uint64_t) ( extractFloatx80Frac( b )<<1 ) )
+ ) {
+ if ( floatx80_is_signaling_nan( a )
+ || floatx80_is_signaling_nan( b ) ) {
+ float_raise( float_flag_invalid STATUS_VAR);
+ }
+ return 1;
+ }
+ return 0;
+}
+
#endif
#ifdef FLOAT128
@@ -5816,6 +5882,28 @@ int float128_lt_quiet( float128 a, float128 b STATUS_PARAM )
}
+ /*----------------------------------------------------------------------------
+| Returns 1 if the quadruple-precision floating-point values `a' and `b' cannot
+| be compared, and 0 otherwise. The comparison is performed according to the
+| IEC/IEEE Standard for Binary Floating-Point Arithmetic.
+*----------------------------------------------------------------------------*/
+
+int float128_unordered( float128 a, float128 b STATUS_PARAM )
+{
+ if ( ( ( extractFloat128Exp( a ) == 0x7FFF )
+ && ( extractFloat128Frac0( a ) | extractFloat128Frac1( a ) ) )
+ || ( ( extractFloat128Exp( b ) == 0x7FFF )
+ && ( extractFloat128Frac0( b ) | extractFloat128Frac1( b ) ) )
+ ) {
+ if ( float128_is_signaling_nan( a )
+ || float128_is_signaling_nan( b ) ) {
+ float_raise( float_flag_invalid STATUS_VAR);
+ }
+ return 1;
+ }
+ return 0;
+}
+
#endif
/* misc functions */
diff --git a/fpu/softfloat.h b/fpu/softfloat.h
index 90f4250..db97be9 100644
--- a/fpu/softfloat.h
+++ b/fpu/softfloat.h
@@ -322,6 +322,7 @@ int float32_lt( float32, float32 STATUS_PARAM );
int float32_eq_signaling( float32, float32 STATUS_PARAM );
int float32_le_quiet( float32, float32 STATUS_PARAM );
int float32_lt_quiet( float32, float32 STATUS_PARAM );
+int float32_unordered( float32, float32 STATUS_PARAM );
int float32_compare( float32, float32 STATUS_PARAM );
int float32_compare_quiet( float32, float32 STATUS_PARAM );
float32 float32_min(float32, float32 STATUS_PARAM);
@@ -436,6 +437,7 @@ int float64_lt( float64, float64 STATUS_PARAM );
int float64_eq_signaling( float64, float64 STATUS_PARAM );
int float64_le_quiet( float64, float64 STATUS_PARAM );
int float64_lt_quiet( float64, float64 STATUS_PARAM );
+int float64_unordered( float64, float64 STATUS_PARAM );
int float64_compare( float64, float64 STATUS_PARAM );
int float64_compare_quiet( float64, float64 STATUS_PARAM );
float64 float64_min(float64, float64 STATUS_PARAM);
@@ -537,6 +539,7 @@ int floatx80_lt( floatx80, floatx80 STATUS_PARAM );
int floatx80_eq_signaling( floatx80, floatx80 STATUS_PARAM );
int floatx80_le_quiet( floatx80, floatx80 STATUS_PARAM );
int floatx80_lt_quiet( floatx80, floatx80 STATUS_PARAM );
+int floatx80_unordered( floatx80, floatx80 STATUS_PARAM );
int floatx80_is_quiet_nan( floatx80 );
int floatx80_is_signaling_nan( floatx80 );
floatx80 floatx80_maybe_silence_nan( floatx80 );
@@ -620,6 +623,7 @@ int float128_lt( float128, float128 STATUS_PARAM );
int float128_eq_signaling( float128, float128 STATUS_PARAM );
int float128_le_quiet( float128, float128 STATUS_PARAM );
int float128_lt_quiet( float128, float128 STATUS_PARAM );
+int float128_unordered( float128, float128 STATUS_PARAM );
int float128_compare( float128, float128 STATUS_PARAM );
int float128_compare_quiet( float128, float128 STATUS_PARAM );
int float128_is_quiet_nan( float128 );
--
1.7.2.3
^ permalink raw reply related
* [Qemu-devel] [PATCH 1/5] cpu-all.h: define CPU_LDoubleU
From: Aurelien Jarno @ 2011-04-10 19:13 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Laurent Vivier, Aurelien Jarno
Add a CPU_LDoubleU type, matching the floatx80 definition and the long
double type on x86 hosts.
Based on a patch from Laurent Vivier <laurent@vivier.eu>.
Cc: Laurent Vivier <laurent@vivier.eu>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-by: Aurelien Jarno <aurelien@aurel32.net>
---
cpu-all.h | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/cpu-all.h b/cpu-all.h
index dc0f2f0..0bae6df 100644
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -138,6 +138,16 @@ typedef union {
uint64_t ll;
} CPU_DoubleU;
+#if defined(FLOATX80)
+typedef union {
+ floatx80 d;
+ struct {
+ uint64_t lower;
+ uint16_t upper;
+ } l;
+} CPU_LDoubleU;
+#endif
+
#if defined(CONFIG_SOFTFLOAT)
typedef union {
float128 q;
--
1.7.2.3
^ permalink raw reply related
* [Qemu-devel] [PATCH 3/5] target-i386: fix cpu-exec.o build with softfloat
From: Aurelien Jarno @ 2011-04-10 19:13 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Aurelien Jarno
In-Reply-To: <1302462807-8795-1-git-send-email-aurelien@aurel32.net>
Fixing the definition of CPU86_LDoubleU allow building cpu-exec.o with
softfloat.
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
target-i386/exec.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/target-i386/exec.h b/target-i386/exec.h
index 6f9f709..d6922f3 100644
--- a/target-i386/exec.h
+++ b/target-i386/exec.h
@@ -145,7 +145,7 @@ static inline void svm_check_intercept(uint32_t type)
/* only for x86 */
typedef union {
- long double d;
+ floatx80 d;
struct {
unsigned long long lower;
unsigned short upper;
@@ -164,7 +164,7 @@ typedef union {
/* NOTE: arm is horrible as double 32 bit words are stored in big endian ! */
typedef union {
- double d;
+ float64 d;
#if !defined(HOST_WORDS_BIGENDIAN) && !defined(__arm__)
struct {
uint32_t lower;
--
1.7.2.3
^ permalink raw reply related
* [Qemu-devel] [PATCH 2/5] target-i386: use CPU_LDoubleU instead of a private union
From: Aurelien Jarno @ 2011-04-10 19:13 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Laurent Vivier, Aurelien Jarno
In-Reply-To: <1302462807-8795-1-git-send-email-aurelien@aurel32.net>
Use CPU_LDoubleU in cpu_dump_state() instead of redefining a union for
doing the conversion.
Based on a patch from Laurent Vivier <laurent@vivier.eu>.
Cc: Laurent Vivier <laurent@vivier.eu>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
target-i386/helper.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/target-i386/helper.c b/target-i386/helper.c
index d15fca5..89df997 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -404,16 +404,10 @@ void cpu_dump_state(CPUState *env, FILE *f, fprintf_function cpu_fprintf,
env->mxcsr);
for(i=0;i<8;i++) {
#if defined(USE_X86LDOUBLE)
- union {
- long double d;
- struct {
- uint64_t lower;
- uint16_t upper;
- } l;
- } tmp;
- tmp.d = env->fpregs[i].d;
+ CPU_LDoubleU u;
+ u.d = env->fpregs[i].d;
cpu_fprintf(f, "FPR%d=%016" PRIx64 " %04x",
- i, tmp.l.lower, tmp.l.upper);
+ i, u.l.lower, u.l.upper);
#else
cpu_fprintf(f, "FPR%d=%016" PRIx64,
i, env->fpregs[i].mmx.q);
--
1.7.2.3
^ permalink raw reply related
* [Qemu-devel] [PATCH] target-sh4: get rid of CPU_{Float,Double}U
From: Aurelien Jarno @ 2011-04-10 19:13 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Nathan Froyd, Aurelien Jarno
SH4 is always using softfloat, so it's possible to have helpers directly
taking float32 or float64 value. This allow to get rid of conversions
through CPU_{Float,Double}U.
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
target-sh4/helper.h | 48 ++++++------
target-sh4/op_helper.c | 202 ++++++++++++++++--------------------------------
2 files changed, 92 insertions(+), 158 deletions(-)
diff --git a/target-sh4/helper.h b/target-sh4/helper.h
index 2e52768..95e3c7c 100644
--- a/target-sh4/helper.h
+++ b/target-sh4/helper.h
@@ -23,31 +23,31 @@ DEF_HELPER_2(macw, void, i32, i32)
DEF_HELPER_1(ld_fpscr, void, i32)
-DEF_HELPER_1(fabs_FT, i32, i32)
-DEF_HELPER_1(fabs_DT, i64, i64)
-DEF_HELPER_2(fadd_FT, i32, i32, i32)
-DEF_HELPER_2(fadd_DT, i64, i64, i64)
-DEF_HELPER_1(fcnvsd_FT_DT, i64, i32)
-DEF_HELPER_1(fcnvds_DT_FT, i32, i64)
+DEF_HELPER_1(fabs_FT, f32, f32)
+DEF_HELPER_1(fabs_DT, f64, f64)
+DEF_HELPER_2(fadd_FT, f32, f32, f32)
+DEF_HELPER_2(fadd_DT, f64, f64, f64)
+DEF_HELPER_1(fcnvsd_FT_DT, f64, f32)
+DEF_HELPER_1(fcnvds_DT_FT, f32, f64)
-DEF_HELPER_2(fcmp_eq_FT, void, i32, i32)
-DEF_HELPER_2(fcmp_eq_DT, void, i64, i64)
-DEF_HELPER_2(fcmp_gt_FT, void, i32, i32)
-DEF_HELPER_2(fcmp_gt_DT, void, i64, i64)
-DEF_HELPER_2(fdiv_FT, i32, i32, i32)
-DEF_HELPER_2(fdiv_DT, i64, i64, i64)
-DEF_HELPER_1(float_FT, i32, i32)
-DEF_HELPER_1(float_DT, i64, i32)
-DEF_HELPER_3(fmac_FT, i32, i32, i32, i32)
-DEF_HELPER_2(fmul_FT, i32, i32, i32)
-DEF_HELPER_2(fmul_DT, i64, i64, i64)
-DEF_HELPER_1(fneg_T, i32, i32)
-DEF_HELPER_2(fsub_FT, i32, i32, i32)
-DEF_HELPER_2(fsub_DT, i64, i64, i64)
-DEF_HELPER_1(fsqrt_FT, i32, i32)
-DEF_HELPER_1(fsqrt_DT, i64, i64)
-DEF_HELPER_1(ftrc_FT, i32, i32)
-DEF_HELPER_1(ftrc_DT, i32, i64)
+DEF_HELPER_2(fcmp_eq_FT, void, f32, f32)
+DEF_HELPER_2(fcmp_eq_DT, void, f64, f64)
+DEF_HELPER_2(fcmp_gt_FT, void, f32, f32)
+DEF_HELPER_2(fcmp_gt_DT, void, f64, f64)
+DEF_HELPER_2(fdiv_FT, f32, f32, f32)
+DEF_HELPER_2(fdiv_DT, f64, f64, f64)
+DEF_HELPER_1(float_FT, f32, i32)
+DEF_HELPER_1(float_DT, f64, i32)
+DEF_HELPER_3(fmac_FT, f32, f32, f32, f32)
+DEF_HELPER_2(fmul_FT, f32, f32, f32)
+DEF_HELPER_2(fmul_DT, f64, f64, f64)
+DEF_HELPER_1(fneg_T, f32, f32)
+DEF_HELPER_2(fsub_FT, f32, f32, f32)
+DEF_HELPER_2(fsub_DT, f64, f64, f64)
+DEF_HELPER_1(fsqrt_FT, f32, f32)
+DEF_HELPER_1(fsqrt_DT, f64, f64)
+DEF_HELPER_1(ftrc_FT, i32, f32)
+DEF_HELPER_1(ftrc_DT, i32, f64)
DEF_HELPER_2(fipr, void, i32, i32)
DEF_HELPER_1(ftrv, void, i32)
diff --git a/target-sh4/op_helper.c b/target-sh4/op_helper.c
index b8f4ca2..c127860 100644
--- a/target-sh4/op_helper.c
+++ b/target-sh4/op_helper.c
@@ -487,53 +487,38 @@ static void update_fpscr(void *retaddr)
}
}
-uint32_t helper_fabs_FT(uint32_t t0)
+float32 helper_fabs_FT(float32 t0)
{
- CPU_FloatU f;
- f.l = t0;
- f.f = float32_abs(f.f);
- return f.l;
+ return float32_abs(t0);
}
-uint64_t helper_fabs_DT(uint64_t t0)
+float64 helper_fabs_DT(float64 t0)
{
- CPU_DoubleU d;
- d.ll = t0;
- d.d = float64_abs(d.d);
- return d.ll;
+ return float64_abs(t0);
}
-uint32_t helper_fadd_FT(uint32_t t0, uint32_t t1)
+float32 helper_fadd_FT(float32 t0, float32 t1)
{
- CPU_FloatU f0, f1;
- f0.l = t0;
- f1.l = t1;
set_float_exception_flags(0, &env->fp_status);
- f0.f = float32_add(f0.f, f1.f, &env->fp_status);
+ t0 = float32_add(t0, t1, &env->fp_status);
update_fpscr(GETPC());
- return f0.l;
+ return t0;
}
-uint64_t helper_fadd_DT(uint64_t t0, uint64_t t1)
+float64 helper_fadd_DT(float64 t0, float64 t1)
{
- CPU_DoubleU d0, d1;
- d0.ll = t0;
- d1.ll = t1;
set_float_exception_flags(0, &env->fp_status);
- d0.d = float64_add(d0.d, d1.d, &env->fp_status);
+ t0 = float64_add(t0, t1, &env->fp_status);
update_fpscr(GETPC());
- return d0.ll;
+ return t0;
}
-void helper_fcmp_eq_FT(uint32_t t0, uint32_t t1)
+void helper_fcmp_eq_FT(float32 t0, float32 t1)
{
- CPU_FloatU f0, f1;
int relation;
- f0.l = t0;
- f1.l = t1;
set_float_exception_flags(0, &env->fp_status);
- relation = float32_compare(f0.f, f1.f, &env->fp_status);
+ relation = float32_compare(t0, t1, &env->fp_status);
if (unlikely(relation == float_relation_unordered)) {
update_fpscr(GETPC());
} else if (relation == float_relation_equal) {
@@ -543,15 +528,12 @@ void helper_fcmp_eq_FT(uint32_t t0, uint32_t t1)
}
}
-void helper_fcmp_eq_DT(uint64_t t0, uint64_t t1)
+void helper_fcmp_eq_DT(float64 t0, float64 t1)
{
- CPU_DoubleU d0, d1;
int relation;
- d0.ll = t0;
- d1.ll = t1;
set_float_exception_flags(0, &env->fp_status);
- relation = float64_compare(d0.d, d1.d, &env->fp_status);
+ relation = float64_compare(t0, t1, &env->fp_status);
if (unlikely(relation == float_relation_unordered)) {
update_fpscr(GETPC());
} else if (relation == float_relation_equal) {
@@ -561,15 +543,12 @@ void helper_fcmp_eq_DT(uint64_t t0, uint64_t t1)
}
}
-void helper_fcmp_gt_FT(uint32_t t0, uint32_t t1)
+void helper_fcmp_gt_FT(float32 t0, float32 t1)
{
- CPU_FloatU f0, f1;
int relation;
- f0.l = t0;
- f1.l = t1;
set_float_exception_flags(0, &env->fp_status);
- relation = float32_compare(f0.f, f1.f, &env->fp_status);
+ relation = float32_compare(t0, t1, &env->fp_status);
if (unlikely(relation == float_relation_unordered)) {
update_fpscr(GETPC());
} else if (relation == float_relation_greater) {
@@ -579,15 +558,12 @@ void helper_fcmp_gt_FT(uint32_t t0, uint32_t t1)
}
}
-void helper_fcmp_gt_DT(uint64_t t0, uint64_t t1)
+void helper_fcmp_gt_DT(float64 t0, float64 t1)
{
- CPU_DoubleU d0, d1;
int relation;
- d0.ll = t0;
- d1.ll = t1;
set_float_exception_flags(0, &env->fp_status);
- relation = float64_compare(d0.d, d1.d, &env->fp_status);
+ relation = float64_compare(t0, t1, &env->fp_status);
if (unlikely(relation == float_relation_unordered)) {
update_fpscr(GETPC());
} else if (relation == float_relation_greater) {
@@ -597,176 +573,134 @@ void helper_fcmp_gt_DT(uint64_t t0, uint64_t t1)
}
}
-uint64_t helper_fcnvsd_FT_DT(uint32_t t0)
+float64 helper_fcnvsd_FT_DT(float32 t0)
{
- CPU_DoubleU d;
- CPU_FloatU f;
- f.l = t0;
+ float64 ret;
set_float_exception_flags(0, &env->fp_status);
- d.d = float32_to_float64(f.f, &env->fp_status);
+ ret = float32_to_float64(t0, &env->fp_status);
update_fpscr(GETPC());
- return d.ll;
+ return ret;
}
-uint32_t helper_fcnvds_DT_FT(uint64_t t0)
+float32 helper_fcnvds_DT_FT(float64 t0)
{
- CPU_DoubleU d;
- CPU_FloatU f;
- d.ll = t0;
+ float32 ret;
set_float_exception_flags(0, &env->fp_status);
- f.f = float64_to_float32(d.d, &env->fp_status);
+ ret = float64_to_float32(t0, &env->fp_status);
update_fpscr(GETPC());
- return f.l;
+ return ret;
}
-uint32_t helper_fdiv_FT(uint32_t t0, uint32_t t1)
+float32 helper_fdiv_FT(float32 t0, float32 t1)
{
- CPU_FloatU f0, f1;
- f0.l = t0;
- f1.l = t1;
set_float_exception_flags(0, &env->fp_status);
- f0.f = float32_div(f0.f, f1.f, &env->fp_status);
+ t0 = float32_div(t0, t1, &env->fp_status);
update_fpscr(GETPC());
- return f0.l;
+ return t0;
}
-uint64_t helper_fdiv_DT(uint64_t t0, uint64_t t1)
+float64 helper_fdiv_DT(float64 t0, float64 t1)
{
- CPU_DoubleU d0, d1;
- d0.ll = t0;
- d1.ll = t1;
set_float_exception_flags(0, &env->fp_status);
- d0.d = float64_div(d0.d, d1.d, &env->fp_status);
+ t0 = float64_div(t0, t1, &env->fp_status);
update_fpscr(GETPC());
- return d0.ll;
+ return t0;
}
-uint32_t helper_float_FT(uint32_t t0)
+float32 helper_float_FT(uint32_t t0)
{
- CPU_FloatU f;
-
+ float32 ret;
set_float_exception_flags(0, &env->fp_status);
- f.f = int32_to_float32(t0, &env->fp_status);
+ ret = int32_to_float32(t0, &env->fp_status);
update_fpscr(GETPC());
-
- return f.l;
+ return ret;
}
-uint64_t helper_float_DT(uint32_t t0)
+float64 helper_float_DT(uint32_t t0)
{
- CPU_DoubleU d;
+ float64 ret;
set_float_exception_flags(0, &env->fp_status);
- d.d = int32_to_float64(t0, &env->fp_status);
+ ret = int32_to_float64(t0, &env->fp_status);
update_fpscr(GETPC());
- return d.ll;
+ return ret;
}
-uint32_t helper_fmac_FT(uint32_t t0, uint32_t t1, uint32_t t2)
+float32 helper_fmac_FT(float32 t0, float32 t1, float32 t2)
{
- CPU_FloatU f0, f1, f2;
- f0.l = t0;
- f1.l = t1;
- f2.l = t2;
set_float_exception_flags(0, &env->fp_status);
- f0.f = float32_mul(f0.f, f1.f, &env->fp_status);
- f0.f = float32_add(f0.f, f2.f, &env->fp_status);
+ t0 = float32_mul(t0, t1, &env->fp_status);
+ t0 = float32_add(t0, t2, &env->fp_status);
update_fpscr(GETPC());
-
- return f0.l;
+ return t0;
}
-uint32_t helper_fmul_FT(uint32_t t0, uint32_t t1)
+float32 helper_fmul_FT(float32 t0, float32 t1)
{
- CPU_FloatU f0, f1;
- f0.l = t0;
- f1.l = t1;
set_float_exception_flags(0, &env->fp_status);
- f0.f = float32_mul(f0.f, f1.f, &env->fp_status);
+ t0 = float32_mul(t0, t1, &env->fp_status);
update_fpscr(GETPC());
- return f0.l;
+ return t0;
}
-uint64_t helper_fmul_DT(uint64_t t0, uint64_t t1)
+float64 helper_fmul_DT(float64 t0, float64 t1)
{
- CPU_DoubleU d0, d1;
- d0.ll = t0;
- d1.ll = t1;
set_float_exception_flags(0, &env->fp_status);
- d0.d = float64_mul(d0.d, d1.d, &env->fp_status);
+ t0 = float64_mul(t0, t1, &env->fp_status);
update_fpscr(GETPC());
-
- return d0.ll;
+ return t0;
}
-uint32_t helper_fneg_T(uint32_t t0)
+float32 helper_fneg_T(float32 t0)
{
- CPU_FloatU f;
- f.l = t0;
- f.f = float32_chs(f.f);
- return f.l;
+ return float32_chs(t0);
}
-uint32_t helper_fsqrt_FT(uint32_t t0)
+float32 helper_fsqrt_FT(float32 t0)
{
- CPU_FloatU f;
- f.l = t0;
set_float_exception_flags(0, &env->fp_status);
- f.f = float32_sqrt(f.f, &env->fp_status);
+ t0 = float32_sqrt(t0, &env->fp_status);
update_fpscr(GETPC());
- return f.l;
+ return t0;
}
-uint64_t helper_fsqrt_DT(uint64_t t0)
+float64 helper_fsqrt_DT(float64 t0)
{
- CPU_DoubleU d;
- d.ll = t0;
set_float_exception_flags(0, &env->fp_status);
- d.d = float64_sqrt(d.d, &env->fp_status);
+ t0 = float64_sqrt(t0, &env->fp_status);
update_fpscr(GETPC());
- return d.ll;
+ return t0;
}
-uint32_t helper_fsub_FT(uint32_t t0, uint32_t t1)
+float32 helper_fsub_FT(float32 t0, float32 t1)
{
- CPU_FloatU f0, f1;
- f0.l = t0;
- f1.l = t1;
set_float_exception_flags(0, &env->fp_status);
- f0.f = float32_sub(f0.f, f1.f, &env->fp_status);
+ t0 = float32_sub(t0, t1, &env->fp_status);
update_fpscr(GETPC());
- return f0.l;
+ return t0;
}
-uint64_t helper_fsub_DT(uint64_t t0, uint64_t t1)
+float64 helper_fsub_DT(float64 t0, float64 t1)
{
- CPU_DoubleU d0, d1;
-
- d0.ll = t0;
- d1.ll = t1;
set_float_exception_flags(0, &env->fp_status);
- d0.d = float64_sub(d0.d, d1.d, &env->fp_status);
+ t0 = float64_sub(t0, t1, &env->fp_status);
update_fpscr(GETPC());
- return d0.ll;
+ return t0;
}
-uint32_t helper_ftrc_FT(uint32_t t0)
+uint32_t helper_ftrc_FT(float32 t0)
{
- CPU_FloatU f;
uint32_t ret;
- f.l = t0;
set_float_exception_flags(0, &env->fp_status);
- ret = float32_to_int32_round_to_zero(f.f, &env->fp_status);
+ ret = float32_to_int32_round_to_zero(t0, &env->fp_status);
update_fpscr(GETPC());
return ret;
}
-uint32_t helper_ftrc_DT(uint64_t t0)
+uint32_t helper_ftrc_DT(float64 t0)
{
- CPU_DoubleU d;
uint32_t ret;
- d.ll = t0;
set_float_exception_flags(0, &env->fp_status);
- ret = float64_to_int32_round_to_zero(d.d, &env->fp_status);
+ ret = float64_to_int32_round_to_zero(t0, &env->fp_status);
update_fpscr(GETPC());
return ret;
}
--
1.7.2.3
^ permalink raw reply related
* Re: [PATCH 3/3] CIFS: Migrate to shared superblock model
From: Pavel Shilovsky @ 2011-04-10 19:13 UTC (permalink / raw)
To: Jeff Layton; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20110410103143.7312409b-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2011/4/10 Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>:
> On Sun, 10 Apr 2011 14:05:54 +0400
> Pavel Shilovsky <piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org> wrote:
>
>> Add cifs_match_super to use in sget to share superblock between mounts
>> that have the same //server/sharename, credentials and mount options.
>> It helps us to improve performance on work with future SMB2.1 leases.
>>
>> Signed-off-by: Pavel Shilovsky <piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
>> ---
>> fs/cifs/cifsfs.c | 6 ++-
>> fs/cifs/connect.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>> 2 files changed, 97 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
>> index c40c1f4..abc8436 100644
>> --- a/fs/cifs/cifsfs.c
>> +++ b/fs/cifs/cifsfs.c
>> @@ -577,14 +577,16 @@ cifs_do_mount(struct file_system_type *fs_type,
>> if (rc)
>> return ERR_PTR(rc);
>>
>> - sb = sget(fs_type, NULL, set_anon_super, NULL);
>> + sb = sget(fs_type, cifs_match_super, set_anon_super, volume_info);
>> if (IS_ERR(sb)) {
>> cifs_cleanup_volume_info(&volume_info);
>> return ERR_CAST(sb);
>> }
>>
>> - if (sb->s_fs_info)
>> + if (sb->s_fs_info) {
>> + cFYI(1, "Use existing superblock");
>> goto out;
>> + }
>>
>> sb->s_flags = flags;
>>
>> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
>> index 53b79e7..7c98c36 100644
>> --- a/fs/cifs/connect.c
>> +++ b/fs/cifs/connect.c
>> @@ -2193,6 +2193,99 @@ cifs_put_tlink(struct tcon_link *tlink)
>> return;
>> }
>>
>> +static void setup_cifs_sb(struct smb_vol *vol, struct cifs_sb_info *sb);
>> +static inline struct tcon_link *
>> +cifs_sb_master_tlink(struct cifs_sb_info *cifs_sb);
>> +
>> +static const u32 ACTUAL_MOUNT_FLAGS = CIFS_MOUNT_NO_PERM | CIFS_MOUNT_SET_UID |
>> + CIFS_MOUNT_SERVER_INUM | CIFS_MOUNT_DIRECT_IO | CIFS_MOUNT_NO_XATTR |
>> + CIFS_MOUNT_MAP_SPECIAL_CHR | CIFS_MOUNT_UNX_EMUL | CIFS_MOUNT_NO_BRL |
>> + CIFS_MOUNT_CIFS_ACL | CIFS_MOUNT_OVERR_UID | CIFS_MOUNT_OVERR_GID |
>> + CIFS_MOUNT_DYNPERM | CIFS_MOUNT_NOPOSIXBRL | CIFS_MOUNT_NOSSYNC |
>> + CIFS_MOUNT_FSCACHE | CIFS_MOUNT_MF_SYMLINKS | CIFS_MOUNT_MULTIUSER |
>> + CIFS_MOUNT_STRICT_IO;
>> +
>> +static int
>> +compare_mount_options(struct super_block *sb, struct smb_vol *vol)
>> +{
>> + struct cifs_sb_info *old = CIFS_SB(sb), new;
>> +
>> + setup_cifs_sb(vol, &new);
>> +
>> + if ((old->mnt_cifs_flags & ACTUAL_MOUNT_FLAGS) !=
>> + (new.mnt_cifs_flags & ACTUAL_MOUNT_FLAGS))
>> + return 0;
>> +
>> + if (old->rsize != new.rsize || old->wsize != new.wsize)
>> + return 0;
>> +
>> + if (old->mnt_uid != new.mnt_uid || old->mnt_gid != new.mnt_gid)
>> + return 0;
>> +
>> + if (old->mnt_file_mode != new.mnt_file_mode ||
>> + old->mnt_dir_mode != new.mnt_dir_mode)
>> + return 0;
>> +
>> + if (old->prepathlen != new.prepathlen ||
>> + strncmp(old->prepath, new.prepath, old->prepathlen))
>> + return 0;
>> +
>
> I don't think this is really what you want...
>
> Suppose I mount the same share twice, but with 2 different prepaths.
> For instance:
>
> //server/share/foo
>
> ...and...
>
> //server/share/foo/bar
>
> ...shouldn't the inodes for files/directories accessable via both
> mounts be shared in that case?
> --
> Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
I understand that sharing superblock in your case is a good idea, but
it can be another task, I think, - we can always add this capability
later.
Now I suggest to discuss mount option list - are you agree with it? or
we can drop/add something?
--
Best regards,
Pavel Shilovsky.
^ permalink raw reply
* [Qemu-devel] [PATCH] softfloat: use GCC builtins to count the leading zeros
From: Aurelien Jarno @ 2011-04-10 19:12 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Aurelien Jarno
Softfloat has its own implementation to count the leading zeros. However
a lot of architectures have either a dedicated instruction or an
optimized to do that. When using GCC >= 3.4, this patch uses GCC builtins
instead of the handcoded implementation.
Note that I amware that QEMU_GNUC_PREREQ is defined in osdep.h and that
clz32() and clz64() are defined in host-utils.h, but I think it is better
to keep the softfloat implemntation self contained.
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
fpu/softfloat-macros.h | 29 +++++++++++++++++++++++++++--
1 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/fpu/softfloat-macros.h b/fpu/softfloat-macros.h
index 3128e60..e82ce23 100644
--- a/fpu/softfloat-macros.h
+++ b/fpu/softfloat-macros.h
@@ -36,6 +36,17 @@ these four paragraphs for those parts of this code that are retained.
=============================================================================*/
/*----------------------------------------------------------------------------
+| This macro tests for minimum version of the GNU C compiler.
+*----------------------------------------------------------------------------*/
+#if defined(__GNUC__) && defined(__GNUC_MINOR__)
+# define SOFTFLOAT_GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#else
+# define SOFTFLOAT_GNUC_PREREQ(maj, min) 0
+#endif
+
+
+/*----------------------------------------------------------------------------
| Shifts `a' right by the number of bits given in `count'. If any nonzero
| bits are shifted off, they are ``jammed'' into the least significant bit of
| the result by setting the least significant bit to 1. The value of `count'
@@ -616,6 +627,13 @@ static uint32_t estimateSqrt32( int16 aExp, uint32_t a )
static int8 countLeadingZeros32( uint32_t a )
{
+#if SOFTFLOAT_GNUC_PREREQ(3, 4)
+ if (a) {
+ return __builtin_clz(a);
+ } else {
+ return 32;
+ }
+#else
static const int8 countLeadingZerosHigh[] = {
8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
@@ -647,7 +665,7 @@ static int8 countLeadingZeros32( uint32_t a )
}
shiftCount += countLeadingZerosHigh[ a>>24 ];
return shiftCount;
-
+#endif
}
/*----------------------------------------------------------------------------
@@ -657,6 +675,13 @@ static int8 countLeadingZeros32( uint32_t a )
static int8 countLeadingZeros64( uint64_t a )
{
+#if SOFTFLOAT_GNUC_PREREQ(3, 4)
+ if (a) {
+ return __builtin_clzll(a);
+ } else {
+ return 64;
+ }
+#else
int8 shiftCount;
shiftCount = 0;
@@ -668,7 +693,7 @@ static int8 countLeadingZeros64( uint64_t a )
}
shiftCount += countLeadingZeros32( a );
return shiftCount;
-
+#endif
}
/*----------------------------------------------------------------------------
--
1.7.2.3
^ permalink raw reply related
* [Qemu-devel] [PATCH] target-ppc: remove #ifdef FLOAT128
From: Aurelien Jarno @ 2011-04-10 19:12 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Alexander Graf, Aurelien Jarno
Now that PPC defaults to softfloat which always provides float128
support, there is no need to keep two version of the code, depending if
float128 support is available or not. Suggested by Peter Maydell.
Cc: Alexander Graf <agraf@suse.de>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
target-ppc/op_helper.c | 20 --------------------
1 files changed, 0 insertions(+), 20 deletions(-)
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index c2a3212..4dae464 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -1287,7 +1287,6 @@ uint64_t helper_fmadd (uint64_t arg1, uint64_t arg2, uint64_t arg3)
/* sNaN operation */
fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN);
}
-#ifdef FLOAT128
/* This is the way the PowerPC specification defines it */
float128 ft0_128, ft1_128;
@@ -1303,10 +1302,6 @@ uint64_t helper_fmadd (uint64_t arg1, uint64_t arg2, uint64_t arg3)
ft0_128 = float128_add(ft0_128, ft1_128, &env->fp_status);
farg1.d = float128_to_float64(ft0_128, &env->fp_status);
}
-#else
- /* This is OK on x86 hosts */
- farg1.d = (farg1.d * farg2.d) + farg3.d;
-#endif
}
return farg1.ll;
@@ -1332,7 +1327,6 @@ uint64_t helper_fmsub (uint64_t arg1, uint64_t arg2, uint64_t arg3)
/* sNaN operation */
fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN);
}
-#ifdef FLOAT128
/* This is the way the PowerPC specification defines it */
float128 ft0_128, ft1_128;
@@ -1348,10 +1342,6 @@ uint64_t helper_fmsub (uint64_t arg1, uint64_t arg2, uint64_t arg3)
ft0_128 = float128_sub(ft0_128, ft1_128, &env->fp_status);
farg1.d = float128_to_float64(ft0_128, &env->fp_status);
}
-#else
- /* This is OK on x86 hosts */
- farg1.d = (farg1.d * farg2.d) - farg3.d;
-#endif
}
return farg1.ll;
}
@@ -1376,7 +1366,6 @@ uint64_t helper_fnmadd (uint64_t arg1, uint64_t arg2, uint64_t arg3)
/* sNaN operation */
fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN);
}
-#ifdef FLOAT128
/* This is the way the PowerPC specification defines it */
float128 ft0_128, ft1_128;
@@ -1392,10 +1381,6 @@ uint64_t helper_fnmadd (uint64_t arg1, uint64_t arg2, uint64_t arg3)
ft0_128 = float128_add(ft0_128, ft1_128, &env->fp_status);
farg1.d = float128_to_float64(ft0_128, &env->fp_status);
}
-#else
- /* This is OK on x86 hosts */
- farg1.d = (farg1.d * farg2.d) + farg3.d;
-#endif
if (likely(!float64_is_any_nan(farg1.d))) {
farg1.d = float64_chs(farg1.d);
}
@@ -1423,7 +1408,6 @@ uint64_t helper_fnmsub (uint64_t arg1, uint64_t arg2, uint64_t arg3)
/* sNaN operation */
fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN);
}
-#ifdef FLOAT128
/* This is the way the PowerPC specification defines it */
float128 ft0_128, ft1_128;
@@ -1439,10 +1423,6 @@ uint64_t helper_fnmsub (uint64_t arg1, uint64_t arg2, uint64_t arg3)
ft0_128 = float128_sub(ft0_128, ft1_128, &env->fp_status);
farg1.d = float128_to_float64(ft0_128, &env->fp_status);
}
-#else
- /* This is OK on x86 hosts */
- farg1.d = (farg1.d * farg2.d) - farg3.d;
-#endif
if (likely(!float64_is_any_nan(farg1.d))) {
farg1.d = float64_chs(farg1.d);
}
--
1.7.2.3
^ permalink raw reply related
* [PATCH 2/2] ath9k: index out of bounds
From: roel @ 2011-04-10 19:09 UTC (permalink / raw)
To: Luis R. Rodriguez, Jouni Malinen, Vasanthakumar Thiagarajan,
Senthil Balasubramanian, linux-wireless, ath9k-devel,
Andrew Morton, LKML
Check whether index is within bounds before testing the element
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
drivers/net/wireless/ath/ath9k/rc.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 4c0d36a..1809409 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1092,8 +1092,7 @@ static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table,
if (!(rate->flags & IEEE80211_TX_RC_MCS))
return rate->idx;
- while (rate->idx > mcs_rix_off[i] &&
- i < ARRAY_SIZE(mcs_rix_off)) {
+ while (i < ARRAY_SIZE(mcs_rix_off) && rate->idx > mcs_rix_off[i]) {
rix++; i++;
}
^ permalink raw reply related
* [Buildroot] external-toolchain with CodeSourcery works well
From: Charles Krinke @ 2011-04-10 19:10 UTC (permalink / raw)
To: buildroot
I was able to take buildroot-2011.02 and select the CodeSourcery
external-toolchain. The CodeSourcery 2010.09.tar.bz2 downloaded and
installed in buildroot-2011.02/output/external-toolchain and created jffs2,
ubifs, cpio and tar root filesystems along with an external application with
a path to the same toolchain. Great job getting this part working in
buildroot.
I do see a powerpc-linux-gnu-gdb and gdbserver, both of which run. The
gdbserver runs on the PowerPC target and does make a connect.
Toolchain is gcc-4.5.1 and it looks like the notion of "target remote
targetIp:port" has now become "target extended-remote targetIp:port". When
the remote debugger disconnects, the target now goes back to waiting for a
connection which is a bit better then previous versions.
Now, I am going to attempt to understand a bit about crosstools-ng. Here, I
am guessing a bit on configuration settings, that is, things like prefixes
and paths. Any suggestions would be gratefully appreciated.
--
Charles Krinke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110410/2f7f001f/attachment.html>
^ permalink raw reply
* Re: [Qemu-devel] QEMU testing methodology & results
From: Roberto Paleari @ 2011-04-10 19:10 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-devel
In-Reply-To: <BANLkTi=RKMCs3GmrkfT9Njq9=z5HB4a7Lw@mail.gmail.com>
On Fri, Apr 8, 2011 at 9:56 PM, Blue Swirl <blauwirbel@gmail.com> wrote:
> Very interesting!
Thank you!
> KEmuFuzzer seems to be more general. The approach of the patch is a
> bit intrusive. But there are similarities with it and GDB interface,
> tracepoints and other instrumentation needs, so it may be possible to
> work out a common solution.
Yes, KEmuFuzzer is more general and more effective than EmuFuzzer, as
it can be also used to test privileged instruction.
> I don't think it is possible to avoid red pills. Even with the fastest
> hardware assisted emulator, it may be possible to make a program to
> detect systematic distortions in the clock speed. Lack of cache
> emulation may be easy to detect. The devices that QEMU provides are so
> old that a machine with those devices can be considered to be QEMU by
> the red pill. And so on.
I agree: it would be really difficult to avoid red pills at all.
However, in EmuFuzzer and KEmuFuzzer we are interested only in
"instruction-level" red pills. I mean, we focused only on possibile
defects in the implementation of the instruction semantics, so we do
not take into account possibile red pills caused by clock skews,
device IDs, and so on.
> I'd vote for full disclosure and open discussion on this list, but I
> suppose the distro people may have business interests to protect.
> Though the papers may already give the black hats enough ideas how to
> find the defects.
I agree: the papers already disclose some details that could allow
"black hats" to re-implement the same approaches and eventualy find
emulation defects. However, we prefered to contact QEMU developers
before disclosing the details of the defects we found.
Thank you!
Roberto
--
Roberto Paleari
http://roberto.greyhats.it/
PGP Key Fingerprint: F94C 1933 F61C 3948 7CDD 2C61 38C7 6116 833D D6A0
^ permalink raw reply
* Horizontal boot menu
From: Endres Puschner @ 2011-04-10 19:09 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 1447 bytes --]
Hi, grub-developers,
I implemented a complete horizontal extension to the boot menu and some
other little features and fixes for extending the gfxmenu boot menu.
I would just describe my added theme parameters for the boot_menu control:
- item_width: Optionally specifying a width for each item in
horizontal lists, but could also be implemented to work with vertical lists.
- item_icon_padding: Padding between icon and box or between icon and
other item if there is no item_box.
- horizontal: boolean, defining this boot_list as horizontal.
- item_pixmap_style: like selected_item_pixmap_style but for non
selected entries.
- item_pixmap_icon_only: boolean, selected and unselected pixmaps are
only shown around the icons and not around the whole item.
The scrollbars must be manually turned around to be in horizontal mode,
I have uploaded a demo theme as an example:
http://data.e7p.de/grub-horizontal-theme.png
http://data.e7p.de/grub-horizontal-theme.zip
I fixed a bug in the icon-section. The first group in any menuentry was
skipped while looking for icons before, so only icons for the second
class would be searched.
The normal menu is also modified as I wanted to allow to use right/left
keys while navigating through the menu while it is horizontal. At
menu_init, a new environment variable (orientation) can be set by the
used menu module to horizontal for obvious reasons.
Best regards,
Endres
[-- Attachment #2: grub_horizontal1.diff --]
[-- Type: text/x-patch, Size: 20000 bytes --]
=== modified file 'grub-core/gfxmenu/gui_list.c'
--- grub-core/gfxmenu/gui_list.c 2010-10-16 20:16:52 +0000
+++ grub-core/gfxmenu/gui_list.c 2011-04-10 18:20:42 +0000
@@ -23,6 +23,7 @@
#include <grub/gui_string_util.h>
#include <grub/gfxmenu_view.h>
#include <grub/gfxwidgets.h>
+#include <grub/env.h>
struct grub_gui_list_impl
{
@@ -35,9 +36,11 @@
int icon_width;
int icon_height;
+ int item_width;
int item_height;
int item_padding;
int item_icon_space;
+ int item_icon_padding;
int item_spacing;
grub_font_t item_font;
grub_font_t selected_item_font;
@@ -53,14 +56,19 @@
grub_gfxmenu_box_t scrollbar_thumb;
int scrollbar_width;
+ int horizontal;
+
int first_shown_index;
int need_to_recreate_boxes;
char *theme_dir;
char *menu_box_pattern;
char *selected_item_box_pattern;
+ char *item_box_pattern;
grub_gfxmenu_box_t menu_box;
grub_gfxmenu_box_t selected_item_box;
+ grub_gfxmenu_box_t item_box;
+ int box_icon_only;
grub_gfxmenu_icon_manager_t icon_manager;
@@ -91,15 +99,27 @@
get_num_shown_items (list_impl_t self)
{
int boxpad = self->item_padding;
- int item_vspace = self->item_spacing;
+ int item_space = self->item_spacing;
int item_height = self->item_height;
+ int item_width = self->item_width;
grub_gfxmenu_box_t box = self->menu_box;
int box_top_pad = box->get_top_pad (box);
int box_bottom_pad = box->get_bottom_pad (box);
-
- return (self->bounds.height + item_vspace - 2 * boxpad
- - box_top_pad - box_bottom_pad) / (item_height + item_vspace);
+ int box_left_pad = box->get_left_pad (box);
+ int box_right_pad = box->get_right_pad (box);
+
+ grub_gfxmenu_box_t itembox = self->item_box;
+
+ if(self->horizontal)
+ return (self->bounds.width + item_space - 2 * boxpad
+ - box_left_pad - box_right_pad) / (grub_max(item_width,
+ self->icon_width + 2 * self->item_icon_padding) + item_space
+ + itembox->get_left_pad(itembox) + itembox->get_right_pad(itembox));
+ else
+ return (self->bounds.height + item_space - 2 * boxpad
+ - box_top_pad - box_bottom_pad) / (item_height + item_space
+ + itembox->get_top_pad(itembox) + itembox->get_bottom_pad(itembox));
}
static int
@@ -115,6 +135,10 @@
self->selected_item_box_pattern,
self->theme_dir);
+ grub_gui_recreate_box (&self->item_box,
+ self->item_box_pattern,
+ self->theme_dir);
+
self->need_to_recreate_boxes = 0;
}
@@ -183,29 +207,48 @@
static void
draw_scrollbar (list_impl_t self,
int value, int extent, int min, int max,
- int rightx, int topy, int height)
+ int x1, int y1, int length)
{
+ /* x1 and y1 have now their special meanings:
+ * if vertical: x1 = right, y1 = top
+ * if horizontal: x1 = left, y1 = bottom */
grub_gfxmenu_box_t frame = self->scrollbar_frame;
grub_gfxmenu_box_t thumb = self->scrollbar_thumb;
int frame_vertical_pad = (frame->get_top_pad (frame)
+ frame->get_bottom_pad (frame));
int frame_horizontal_pad = (frame->get_left_pad (frame)
+ frame->get_right_pad (frame));
- int tracktop = topy + frame->get_top_pad (frame);
- int tracklen = height - frame_vertical_pad;
- frame->set_content_size (frame, self->scrollbar_width, tracklen);
- int thumby = tracktop + tracklen * (value - min) / (max - min);
- int thumbheight = tracklen * extent / (max - min) + 1;
- thumb->set_content_size (thumb,
- self->scrollbar_width - frame_horizontal_pad,
- thumbheight - (thumb->get_top_pad (thumb)
- + thumb->get_bottom_pad (thumb)));
- frame->draw (frame,
- rightx - (self->scrollbar_width + frame_horizontal_pad),
- topy);
- thumb->draw (thumb,
- rightx - (self->scrollbar_width - frame->get_right_pad (frame)),
- thumby);
+ if(self->horizontal == 0) {
+ int tracktop = y1 + frame->get_top_pad (frame);
+ int tracklen = length - frame_vertical_pad;
+ frame->set_content_size (frame, self->scrollbar_width, tracklen);
+ int thumby = tracktop + tracklen * (value - min) / (max - min);
+ int thumbheight = tracklen * extent / (max - min) + 1;
+ thumb->set_content_size (thumb,
+ self->scrollbar_width - frame_horizontal_pad,
+ thumbheight - (thumb->get_top_pad (thumb)
+ + thumb->get_bottom_pad (thumb)));
+ frame->draw (frame,
+ x1 - (self->scrollbar_width + frame_horizontal_pad),
+ y1);
+ thumb->draw (thumb,
+ x1 - (self->scrollbar_width - frame->get_right_pad (frame)),
+ thumby);
+ } else {
+ int trackleft = x1 + frame->get_left_pad (frame);
+ int tracklen = length - frame_horizontal_pad;
+ frame->set_content_size (frame, tracklen, self->scrollbar_width);
+ int thumbx = trackleft + tracklen * (value - min) / (max - min);
+ int thumbwidth = tracklen * extent / (max - min) + 1;
+ thumb->set_content_size (thumb,
+ thumbwidth - (thumb->get_left_pad (thumb)
+ + thumb->get_right_pad (thumb)),
+ self->scrollbar_width - frame_vertical_pad);
+ frame->draw (frame, x1,
+ y1 - (self->scrollbar_width + frame_vertical_pad));
+ thumb->draw (thumb, thumbx,
+ y1 - (self->scrollbar_width - frame->get_bottom_pad (frame)));
+ }
}
/* Draw the list of items. */
@@ -217,24 +260,44 @@
int boxpad = self->item_padding;
int icon_text_space = self->item_icon_space;
- int item_vspace = self->item_spacing;
+ int item_space = self->item_spacing;
+
+ int horizontal = self->horizontal;
int ascent = grub_font_get_ascent (self->item_font);
int descent = grub_font_get_descent (self->item_font);
+ int icon_width = self->icon_width + 2 * self->item_icon_padding;
+ int icon_height = self->icon_height + 2 * self->item_icon_padding;
+ int item_width = icon_width; // TODO: for both horizontal and vertical
int item_height = self->item_height;
-
+
make_selected_item_visible (self);
grub_gfxmenu_box_t selbox = self->selected_item_box;
+ grub_gfxmenu_box_t itembox = self->item_box;
int sel_leftpad = selbox->get_left_pad (selbox);
int sel_toppad = selbox->get_top_pad (selbox);
- int item_top = sel_toppad;
+ int item_leftpad = selbox->get_left_pad (itembox);
+ int item_toppad = selbox->get_top_pad (itembox);
+ int max_leftpad = grub_max(sel_leftpad, item_leftpad);
+ int max_toppad = grub_max(sel_toppad, item_toppad);
+
+ int item_left = max_leftpad;
+ int item_top = max_toppad;
+
int menu_index;
int visible_index;
struct grub_video_rect oviewport;
grub_video_get_viewport (&oviewport.x, &oviewport.y,
&oviewport.width, &oviewport.height);
+ if (horizontal) {
+ int new_width = grub_min(num_shown_items, self->view->menu->size)
+ * (grub_max(icon_width,item_width) + 2 * item_leftpad + item_space)
+ - item_space - 1 + 2 * grub_abs(sel_leftpad-item_leftpad) + 2 * boxpad;
+ oviewport.x += grub_max(0, self->bounds.width - new_width) / 2 - grub_abs(sel_leftpad-item_leftpad) / 2;
+ oviewport.width = new_width;
+ }
grub_video_set_viewport (oviewport.x + boxpad,
oviewport.y + boxpad,
oviewport.width - 2 * boxpad,
@@ -246,20 +309,45 @@
{
int is_selected = (menu_index == self->view->selected);
- if (is_selected)
- {
- selbox->set_content_size (selbox, oviewport.width - 2 * boxpad - 2,
- item_height - 1);
- selbox->draw (selbox, 0,
- item_top - sel_toppad);
- }
+ if (is_selected) {
+ if (horizontal == 0)
+ selbox->set_content_size (selbox,
+ (self->box_icon_only?icon_width:
+ (int)(oviewport.width - 2 * boxpad - 2)),
+ item_height - 1);
+ else
+ selbox->set_content_size (selbox, item_width - 1,
+ (self->box_icon_only?icon_height:
+ (int)(oviewport.height - 2 * boxpad - 2)));
+ selbox->draw (selbox, item_left - sel_leftpad, item_top - sel_toppad);
+ } else if (itembox) {
+ if (horizontal == 0)
+ itembox->set_content_size (itembox,
+ (self->box_icon_only?icon_width:
+ (int)(oviewport.width - 2 * boxpad - 2)),
+ item_height - 1);
+ else
+ itembox->set_content_size (itembox, item_width - 1,
+ (self->box_icon_only?icon_height:
+ (int)(oviewport.height - 2 * boxpad - 2)));
+ itembox->draw (itembox, item_left - item_leftpad, item_top - item_toppad);
+ }
struct grub_video_bitmap *icon;
- if ((icon = get_item_icon (self, menu_index)) != 0)
- grub_video_blit_bitmap (icon, GRUB_VIDEO_BLIT_BLEND,
- sel_leftpad,
- item_top + (item_height - self->icon_height) / 2,
- 0, 0, self->icon_width, self->icon_height);
+ if ((icon = get_item_icon (self, menu_index)) != 0) {
+ if (horizontal == 0)
+ grub_video_blit_bitmap (icon, GRUB_VIDEO_BLIT_BLEND,
+ item_left + self->item_icon_padding,
+ item_top + self->item_icon_padding +
+ (item_height - self->icon_height) / 2,
+ 0, 0, self->icon_width, self->icon_height);
+ else
+ grub_video_blit_bitmap (icon, GRUB_VIDEO_BLIT_BLEND,
+ item_left + self->item_icon_padding +
+ (item_width - icon_width) / 2,
+ item_top + self->item_icon_padding,
+ 0, 0, self->icon_width, self->icon_height);
+ }
const char *item_title =
grub_menu_get_entry (self->view->menu, menu_index)->title;
@@ -271,15 +359,24 @@
((is_selected && self->selected_item_color_set)
? self->selected_item_color
: self->item_color);
- grub_font_draw_string (item_title,
- font,
- grub_gui_map_color (text_color),
- sel_leftpad + self->icon_width + icon_text_space,
- (item_top + (item_height - (ascent + descent))
- / 2 + ascent));
-
- item_top += item_height + item_vspace;
+ if (horizontal == 0) {
+ grub_font_draw_string (item_title, font,
+ grub_gui_map_color (text_color),
+ icon_width + icon_text_space,
+ item_top + (item_height - (ascent + descent)) / 2 + ascent);
+
+ item_top += item_height + item_space;
+ } else {
+ grub_font_draw_string (item_title, font,
+ grub_gui_map_color (text_color),
+ (item_left + (item_width -
+ grub_font_get_string_width(font, item_title)) / 2),
+ item_top + item_toppad + icon_height + icon_text_space + ascent);
+
+ item_left += item_width + item_space + 2 * item_leftpad;
+ }
}
+
grub_video_set_viewport (oviewport.x,
oviewport.y,
oviewport.width,
@@ -332,10 +429,13 @@
draw_scrollbar (self,
self->first_shown_index, num_shown_items,
0, self->view->menu->size,
- self->bounds.width - box_right_pad
- + self->scrollbar_width,
- box_top_pad,
- self->bounds.height - box_top_pad - box_bottom_pad);
+ (self->horizontal?box_left_pad:
+ (int)(self->bounds.width - box_right_pad + self->scrollbar_width)),
+ (!self->horizontal?box_top_pad:
+ (int)(self->bounds.height - box_bottom_pad - self->scrollbar_width)),
+ (self->horizontal?
+ (self->bounds.width - box_left_pad - box_right_pad):
+ (self->bounds.height - box_top_pad - box_bottom_pad)));
}
grub_gui_restore_viewport (&vpsave);
@@ -377,7 +477,7 @@
if (check_boxes (self))
{
int boxpad = self->item_padding;
- int item_vspace = self->item_spacing;
+ int item_space = self->item_spacing;
int item_height = self->item_height;
int num_items = 3;
@@ -386,24 +486,48 @@
int box_top_pad = box->get_top_pad (box);
int box_right_pad = box->get_right_pad (box);
int box_bottom_pad = box->get_bottom_pad (box);
- unsigned width_s;
+
+ unsigned sel_size;
grub_gfxmenu_box_t selbox = self->selected_item_box;
int sel_toppad = selbox->get_top_pad (selbox);
-
- *width = grub_font_get_string_width (self->item_font, "Typical OS");
- width_s = grub_font_get_string_width (self->selected_item_font,
- "Typical OS");
- if (*width < width_s)
- *width = width_s;
-
- *width += 2 * boxpad + box_left_pad + box_right_pad;
-
- /* Set the menu box height to fit the items. */
- *height = (item_height * num_items
- + item_vspace * (num_items - 1)
- + 2 * boxpad
- + box_top_pad + box_bottom_pad + sel_toppad);
+ int sel_bottompad = selbox->get_bottom_pad (selbox);
+
+ grub_gfxmenu_box_t itembox = self->item_box;
+ int item_toppad = itembox->get_top_pad (itembox);
+ int item_bottompad = itembox->get_bottom_pad (itembox);
+
+ unsigned max_toppad = grub_max(sel_toppad, item_toppad);
+ unsigned max_bottompad = grub_max(sel_bottompad, item_bottompad);
+
+ if (self->horizontal == 0) {
+ *width = grub_font_get_string_width (self->item_font, "Typical OS");
+ sel_size = grub_font_get_string_width (self->selected_item_font,
+ "Typical OS");
+ if (*width < sel_size) *width = sel_size;
+
+ *width += 2 * boxpad + box_left_pad + box_right_pad;
+
+ /* Set the menu box height to fit the items. */
+ *height = (item_height * num_items
+ + item_space * (num_items - 1)
+ + 2 * boxpad
+ + box_top_pad + box_bottom_pad + sel_toppad);
+ } else {
+ *height = grub_font_get_ascent (self->item_font)
+ - grub_font_get_descent (self->item_font);
+ sel_size = grub_font_get_ascent (self->selected_item_font)
+ - grub_font_get_descent (self->selected_item_font);
+ if (*height < sel_size && self->selected_item_font) *height = sel_size;
+ if (*height + self->item_icon_space < max_bottompad) *height = max_bottompad;
+ else *height += max_bottompad;
+
+ *height += self->icon_height + box_top_pad + box_bottom_pad
+ + (2 * (boxpad + self->item_icon_padding))
+ + max_toppad + self->item_icon_space;
+ /* Set the menu box width to fit the items. ie: set to full width */
+ *width = self->bounds.width;
+ }
}
else
{
@@ -458,6 +582,10 @@
self->icon_width,
self->icon_height);
}
+ else if (grub_strcmp (name, "item_width") == 0)
+ {
+ self->item_width = grub_strtol (value, 0, 10);
+ }
else if (grub_strcmp (name, "item_height") == 0)
{
self->item_height = grub_strtol (value, 0, 10);
@@ -470,6 +598,10 @@
{
self->item_icon_space = grub_strtol (value, 0, 10);
}
+ else if (grub_strcmp (name, "item_icon_padding") == 0)
+ {
+ self->item_icon_padding = grub_strtol (value, 0, 10);
+ }
else if (grub_strcmp (name, "item_spacing") == 0)
{
self->item_spacing = grub_strtol (value, 0, 10);
@@ -490,6 +622,16 @@
grub_free (self->selected_item_box_pattern);
self->selected_item_box_pattern = value ? grub_strdup (value) : 0;
}
+ else if (grub_strcmp (name, "item_pixmap_style") == 0)
+ {
+ self->need_to_recreate_boxes = 1;
+ grub_free (self->item_box_pattern);
+ self->item_box_pattern = value ? grub_strdup (value) : 0;
+ }
+ else if (grub_strcmp (name, "item_pixmap_icon_only") == 0)
+ {
+ self->box_icon_only = grub_strcmp (value, "false") != 0;
+ }
else if (grub_strcmp (name, "scrollbar_frame") == 0)
{
self->need_to_recreate_scrollbar = 1;
@@ -524,6 +666,11 @@
else
self->id = 0;
}
+ else if (grub_strcmp (name, "horizontal") == 0)
+ {
+ self->horizontal = grub_strcmp (value, "false") != 0;
+ if(self->horizontal) grub_env_set("orientation", "horizontal");
+ }
return grub_errno;
}
@@ -578,9 +725,11 @@
self->icon_width = 32;
self->icon_height = 32;
+ self->item_width = 42; // Only applies to horizontal lists TODO: do for both and appropriate default value
self->item_height = 42;
self->item_padding = 14;
self->item_icon_space = 4;
+ self->item_icon_padding = 0;
self->item_spacing = 16;
self->item_font = default_font;
self->selected_item_font = 0; /* Default to using the item_font. */
@@ -604,6 +753,10 @@
self->selected_item_box_pattern = 0;
self->menu_box = grub_gfxmenu_create_box (0, 0);
self->selected_item_box = grub_gfxmenu_create_box (0, 0);
+ self->item_box = grub_gfxmenu_create_box (0, 0);
+ self->box_icon_only = 0;
+
+ self->horizontal = 0;
self->icon_manager = grub_gfxmenu_icon_manager_new ();
if (! self->icon_manager)
=== modified file 'grub-core/gfxmenu/icon_manager.c'
--- grub-core/gfxmenu/icon_manager.c 2009-11-21 16:48:05 +0000
+++ grub-core/gfxmenu/icon_manager.c 2011-04-09 13:10:49 +0000
@@ -257,7 +257,7 @@
/* Try each class in succession. */
icon = 0;
- for (c = entry->classes->next; c && ! icon; c = c->next)
+ for (c = entry->classes; c && ! icon; c = c->next)
icon = get_icon_by_class (mgr, c->name);
return icon;
}
=== modified file 'grub-core/normal/menu.c'
--- grub-core/normal/menu.c 2011-04-08 10:12:02 +0000
+++ grub-core/normal/menu.c 2011-04-10 18:13:14 +0000
@@ -349,6 +349,8 @@
struct grub_term_output *term;
int gfxmenu = 0;
+ grub_env_set("orientation", "vertical");
+
FOR_ACTIVE_TERM_OUTPUTS(term)
if (grub_strcmp (term->name, "gfxterm") == 0)
{
@@ -580,22 +582,6 @@
menu_set_chosen_entry (current_entry);
break;
- case GRUB_TERM_KEY_UP:
- case GRUB_TERM_CTRL | 'p':
- case '^':
- if (current_entry > 0)
- current_entry--;
- menu_set_chosen_entry (current_entry);
- break;
-
- case GRUB_TERM_CTRL | 'n':
- case GRUB_TERM_KEY_DOWN:
- case 'v':
- if (current_entry < menu->size - 1)
- current_entry++;
- menu_set_chosen_entry (current_entry);
- break;
-
case GRUB_TERM_CTRL | 'g':
case GRUB_TERM_KEY_PPAGE:
if (current_entry < GRUB_MENU_PAGE_SIZE)
@@ -614,14 +600,6 @@
menu_set_chosen_entry (current_entry);
break;
- case '\n':
- case '\r':
- case GRUB_TERM_KEY_RIGHT:
- case GRUB_TERM_CTRL | 'f':
- menu_fini ();
- *auto_boot = 0;
- return current_entry;
-
case '\e':
if (nested)
{
@@ -656,6 +634,62 @@
*auto_boot = 0;
return i;
}
+
+ if (grub_strcmp(grub_env_get("orientation"), "horizontal") == 0) {
+ switch(c) {
+ case GRUB_TERM_KEY_LEFT:
+ case GRUB_TERM_CTRL | 'p':
+ case '<':
+ if (current_entry > 0)
+ current_entry--;
+ menu_set_chosen_entry (current_entry);
+ break;
+
+ case GRUB_TERM_CTRL | 'n':
+ case GRUB_TERM_KEY_RIGHT:
+ case '>':
+ if (current_entry < menu->size - 1)
+ current_entry++;
+ menu_set_chosen_entry (current_entry);
+ break;
+
+ case '\n':
+ case '\r':
+ case GRUB_TERM_CTRL | 'f':
+ menu_fini ();
+ *auto_boot = 0;
+ return current_entry;
+
+ }
+ } else {
+ switch(c) {
+ case GRUB_TERM_KEY_UP:
+ case GRUB_TERM_CTRL | 'p':
+ case '^':
+ if (current_entry > 0)
+ current_entry--;
+ menu_set_chosen_entry (current_entry);
+ break;
+
+ case GRUB_TERM_CTRL | 'n':
+ case GRUB_TERM_KEY_DOWN:
+ case 'v':
+ if (current_entry < menu->size - 1)
+ current_entry++;
+ menu_set_chosen_entry (current_entry);
+ break;
+
+ case '\n':
+ case '\r':
+ case GRUB_TERM_KEY_RIGHT:
+ case GRUB_TERM_CTRL | 'f':
+ menu_fini ();
+ *auto_boot = 0;
+ return current_entry;
+
+ }
+ }
+
}
break;
}
^ permalink raw reply
* [PATCH 2/2] ath9k: index out of bounds
From: roel @ 2011-04-10 19:09 UTC (permalink / raw)
To: Luis R. Rodriguez, Jouni Malinen, Vasanthakumar Thiagarajan,
Senthil Balasubramanian, linux-wireless, ath9k-devel,
Andrew Morton, LKML
Check whether index is within bounds before testing the element
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
drivers/net/wireless/ath/ath9k/rc.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 4c0d36a..1809409 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1092,8 +1092,7 @@ static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table,
if (!(rate->flags & IEEE80211_TX_RC_MCS))
return rate->idx;
- while (rate->idx > mcs_rix_off[i] &&
- i < ARRAY_SIZE(mcs_rix_off)) {
+ while (i < ARRAY_SIZE(mcs_rix_off) && rate->idx > mcs_rix_off[i]) {
rix++; i++;
}
^ permalink raw reply related
* [ath9k-devel] [PATCH 2/2] ath9k: index out of bounds
From: roel @ 2011-04-10 19:09 UTC (permalink / raw)
To: ath9k-devel
Check whether index is within bounds before testing the element
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
drivers/net/wireless/ath/ath9k/rc.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 4c0d36a..1809409 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1092,8 +1092,7 @@ static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table,
if (!(rate->flags & IEEE80211_TX_RC_MCS))
return rate->idx;
- while (rate->idx > mcs_rix_off[i] &&
- i < ARRAY_SIZE(mcs_rix_off)) {
+ while (i < ARRAY_SIZE(mcs_rix_off) && rate->idx > mcs_rix_off[i]) {
rix++; i++;
}
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.