[U-Boot-Users] Bios emulator - microblaze toolchain problem

HI,
microblaze CPU have problem with bios_emulator code. Microblaze toolchain doesn't support PRAGMA PACK. Patch is below.
signed-off-by: Michal Simek monstr@monstr.eu
Best regards, Michal Simek
diff --git a/drivers/bios_emulator/besys.c b/drivers/bios_emulator/besys.c index 4c4bc8d..5751eeb 100644 --- a/drivers/bios_emulator/besys.c +++ b/drivers/bios_emulator/besys.c @@ -47,9 +47,10 @@ * ****************************************************************************/
+#if defined(CONFIG_BIOSEMU) + #include "biosemui.h"
-#if defined(CONFIG_BIOSEMU) /*------------------------- Global Variables ------------------------------*/
#ifndef __i386__ diff --git a/drivers/bios_emulator/bios.c b/drivers/bios_emulator/bios.c index 7aa1bfb..d9ccbf8 100644 --- a/drivers/bios_emulator/bios.c +++ b/drivers/bios_emulator/bios.c @@ -41,9 +41,10 @@ * ****************************************************************************/
+#if defined(CONFIG_BIOSEMU) + #include "biosemui.h"
-#if defined(CONFIG_BIOSEMU) /*----------------------------- Implementation ----------------------------*/
/**************************************************************************** diff --git a/drivers/bios_emulator/biosemu.c b/drivers/bios_emulator/biosemu.c index 4c3aedf..5ab9e74 100644 --- a/drivers/bios_emulator/biosemu.c +++ b/drivers/bios_emulator/biosemu.c @@ -45,11 +45,12 @@ * ****************************************************************************/
-#include "biosemui.h" #include <malloc.h>
#if defined(CONFIG_BIOSEMU)
+#include "biosemui.h" + BE_sysEnv _BE_env = {{0}}; static X86EMU_memFuncs _BE_mem __attribute__((section(".got2"))) = { BE_rdb, diff --git a/drivers/bios_emulator/x86emu/debug.c b/drivers/bios_emulator/x86emu/debug.c index 915739c..3acc7e5 100644 --- a/drivers/bios_emulator/x86emu/debug.c +++ b/drivers/bios_emulator/x86emu/debug.c @@ -37,11 +37,12 @@ * ****************************************************************************/
-#include "x86emu/x86emui.h" #include <stdarg.h>
#if defined(CONFIG_BIOSEMU)
+#include "x86emu/x86emui.h" + /*----------------------------- Implementation ----------------------------*/
#ifdef DEBUG diff --git a/drivers/bios_emulator/x86emu/decode.c b/drivers/bios_emulator/x86emu/decode.c index 879f0a0..915645c 100644 --- a/drivers/bios_emulator/x86emu/decode.c +++ b/drivers/bios_emulator/x86emu/decode.c @@ -37,10 +37,10 @@ * ****************************************************************************/
-#include "x86emu/x86emui.h" - #if defined(CONFIG_BIOSEMU)
+#include "x86emu/x86emui.h" + /*----------------------------- Implementation ----------------------------*/
/**************************************************************************** diff --git a/drivers/bios_emulator/x86emu/ops.c b/drivers/bios_emulator/x86emu/ops.c index d334fb5..ff2f119 100644 --- a/drivers/bios_emulator/x86emu/ops.c +++ b/drivers/bios_emulator/x86emu/ops.c @@ -75,10 +75,10 @@ * ****************************************************************************/
-#include "x86emu/x86emui.h" - #if defined(CONFIG_BIOSEMU)
+#include "x86emu/x86emui.h" + /*----------------------------- Implementation ----------------------------*/
/* constant arrays to do several instructions in just one function */ diff --git a/drivers/bios_emulator/x86emu/ops2.c b/drivers/bios_emulator/x86emu/ops2.c index 81c0d49..c8b8517 100644 --- a/drivers/bios_emulator/x86emu/ops2.c +++ b/drivers/bios_emulator/x86emu/ops2.c @@ -44,10 +44,10 @@ * ****************************************************************************/
-#include "x86emu/x86emui.h" - #if defined(CONFIG_BIOSEMU)
+#include "x86emu/x86emui.h" + /*----------------------------- Implementation ----------------------------*/
/**************************************************************************** diff --git a/drivers/bios_emulator/x86emu/prim_ops.c b/drivers/bios_emulator/x86emu/prim_ops.c index c1152ea..b3d82bb 100644 --- a/drivers/bios_emulator/x86emu/prim_ops.c +++ b/drivers/bios_emulator/x86emu/prim_ops.c @@ -98,10 +98,11 @@ ****************************************************************************/
#define PRIM_OPS_NO_REDEFINE_ASM -#include "x86emu/x86emui.h"
#if defined(CONFIG_BIOSEMU)
+#include "x86emu/x86emui.h" + /*------------------------- Global Variables ------------------------------*/
static u32 x86emu_parity_tab[8] = diff --git a/drivers/bios_emulator/x86emu/sys.c b/drivers/bios_emulator/x86emu/sys.c index 566389f..6324cd3 100644 --- a/drivers/bios_emulator/x86emu/sys.c +++ b/drivers/bios_emulator/x86emu/sys.c @@ -39,10 +39,10 @@ * ****************************************************************************/
-#include "x86emu/x86emui.h" - #if defined(CONFIG_BIOSEMU)
+#include "x86emu/x86emui.h" + /*------------------------- Global Variables ------------------------------*/
X86EMU_sysEnv _X86EMU_env; /* Global emulator machine state */

In message 2915.5442-13307-198212161-1187200010@seznam.cz you wrote:
HI,
microblaze CPU have problem with bios_emulator code. Microblaze toolchain doesn't support PRAGMA PACK. Patch is below.
signed-off-by: Michal Simek monstr@monstr.eu
Did you try building any board that enables CONFIG_BIOSEMU and verify that it still included the bios_emulator code?
--- a/drivers/bios_emulator/besys.c +++ b/drivers/bios_emulator/besys.c @@ -47,9 +47,10 @@
****************************************************************************/
+#if defined(CONFIG_BIOSEMU)
#include "biosemui.h"
Where do you think the CONFIG_BIOSEMU might be coming from when you move it before the first #include ?
NAK.
Best regards,
Wolfgang Denk

Hi,
Did you try building any board that enables CONFIG_BIOSEMU and verify that it still included the bios_emulator code?
Old patch have problems in some files. I made second changes.
desc: microblaze CPU have problem with bios_emulator code. Microblaze toolchain doesn't support PRAGMA PACK.
signed-off-by: Michal Simek monstr@monstr.eu
Best regards, Michal Simek
diff --git a/drivers/bios_emulator/besys.c b/drivers/bios_emulator/besys.c index 4c4bc8d..8f1d8b2 100644 --- a/drivers/bios_emulator/besys.c +++ b/drivers/bios_emulator/besys.c @@ -47,9 +47,12 @@ * ****************************************************************************/
-#include "biosemui.h" +#include <common.h>
#if defined(CONFIG_BIOSEMU) + +#include "biosemui.h" + /*------------------------- Global Variables ------------------------------*/
#ifndef __i386__ diff --git a/drivers/bios_emulator/bios.c b/drivers/bios_emulator/bios.c index 7aa1bfb..70e9ce1 100644 --- a/drivers/bios_emulator/bios.c +++ b/drivers/bios_emulator/bios.c @@ -41,9 +41,12 @@ * ****************************************************************************/
-#include "biosemui.h" +#include <common.h>
#if defined(CONFIG_BIOSEMU) + +#include "biosemui.h" + /*----------------------------- Implementation ----------------------------*/
/**************************************************************************** diff --git a/drivers/bios_emulator/biosemu.c b/drivers/bios_emulator/biosemu.c index 4c3aedf..ccfc872 100644 --- a/drivers/bios_emulator/biosemu.c +++ b/drivers/bios_emulator/biosemu.c @@ -45,11 +45,13 @@ * ****************************************************************************/
-#include "biosemui.h" #include <malloc.h> +#include <common.h>
#if defined(CONFIG_BIOSEMU)
+#include "biosemui.h" + BE_sysEnv _BE_env = {{0}}; static X86EMU_memFuncs _BE_mem __attribute__((section(".got2"))) = { BE_rdb, diff --git a/drivers/bios_emulator/x86emu/debug.c b/drivers/bios_emulator/x86emu/debug.c index 915739c..5cbcc95 100644 --- a/drivers/bios_emulator/x86emu/debug.c +++ b/drivers/bios_emulator/x86emu/debug.c @@ -37,11 +37,13 @@ * ****************************************************************************/
-#include "x86emu/x86emui.h" #include <stdarg.h> +#include <common.h>
#if defined(CONFIG_BIOSEMU)
+#include "x86emu/x86emui.h" + /*----------------------------- Implementation ----------------------------*/
#ifdef DEBUG diff --git a/drivers/bios_emulator/x86emu/decode.c b/drivers/bios_emulator/x86emu/decode.c index 879f0a0..7a9a1dd 100644 --- a/drivers/bios_emulator/x86emu/decode.c +++ b/drivers/bios_emulator/x86emu/decode.c @@ -36,11 +36,12 @@ * instruction decoding and accessess of immediate data via IP. etc. * ****************************************************************************/ - -#include "x86emu/x86emui.h" +#include <common.h>
#if defined(CONFIG_BIOSEMU)
+#include "x86emu/x86emui.h" + /*----------------------------- Implementation ----------------------------*/
/**************************************************************************** diff --git a/drivers/bios_emulator/x86emu/ops.c b/drivers/bios_emulator/x86emu/ops.c index d334fb5..a77bd9b 100644 --- a/drivers/bios_emulator/x86emu/ops.c +++ b/drivers/bios_emulator/x86emu/ops.c @@ -75,10 +75,12 @@ * ****************************************************************************/
-#include "x86emu/x86emui.h" +#include <common.h>
#if defined(CONFIG_BIOSEMU)
+#include "x86emu/x86emui.h" + /*----------------------------- Implementation ----------------------------*/
/* constant arrays to do several instructions in just one function */ diff --git a/drivers/bios_emulator/x86emu/ops2.c b/drivers/bios_emulator/x86emu/ops2.c index 81c0d49..d6a210c 100644 --- a/drivers/bios_emulator/x86emu/ops2.c +++ b/drivers/bios_emulator/x86emu/ops2.c @@ -44,10 +44,12 @@ * ****************************************************************************/
-#include "x86emu/x86emui.h" +#include <common.h>
#if defined(CONFIG_BIOSEMU)
+#include "x86emu/x86emui.h" + /*----------------------------- Implementation ----------------------------*/
/**************************************************************************** diff --git a/drivers/bios_emulator/x86emu/prim_ops.c b/drivers/bios_emulator/x86emu/prim_ops.c index c1152ea..2a254a4 100644 --- a/drivers/bios_emulator/x86emu/prim_ops.c +++ b/drivers/bios_emulator/x86emu/prim_ops.c @@ -97,11 +97,14 @@ * ****************************************************************************/
+#include <common.h> + #define PRIM_OPS_NO_REDEFINE_ASM -#include "x86emu/x86emui.h"
#if defined(CONFIG_BIOSEMU)
+#include "x86emu/x86emui.h" + /*------------------------- Global Variables ------------------------------*/
static u32 x86emu_parity_tab[8] = diff --git a/drivers/bios_emulator/x86emu/sys.c b/drivers/bios_emulator/x86emu/sys.c index 566389f..dd44ff1 100644 --- a/drivers/bios_emulator/x86emu/sys.c +++ b/drivers/bios_emulator/x86emu/sys.c @@ -39,10 +39,12 @@ * ****************************************************************************/
-#include "x86emu/x86emui.h" +#include <common.h>
#if defined(CONFIG_BIOSEMU)
+#include "x86emu/x86emui.h" + /*------------------------- Global Variables ------------------------------*/
X86EMU_sysEnv _X86EMU_env; /* Global emulator machine state */

In message 2876.5567-31479-239920790-1187247250@seznam.cz you wrote:
Did you try building any board that enables CONFIG_BIOSEMU and verify that it still included the bios_emulator code?
Old patch have problems in some files. I made second changes.
desc: microblaze CPU have problem with bios_emulator code. Microblaze toolchain doesn't support PRAGMA PACK.
signed-off-by: Michal Simek monstr@monstr.eu
Applied.
Best regards,
Wolfgang Denk
participants (2)
-
Michal Simek
-
Wolfgang Denk