--- Makefile.target | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/Makefile.target b/Makefile.target index f94f450..bf83b5b 100644 --- a/Makefile.target +++ b/Makefile.target @@ -25,6 +25,7 @@ STRIP := $(TARGET)strip RANLIB := $(TARGET)ranlib
CFLAGS+= -Os -g -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS +CFLAGS+= -fno-strict-aliasing CFLAGS+= -Wall -Wredundant-decls -Wshadow -Wpointer-arith CFLAGS+= -Wstrict-prototypes -Wmissing-declarations -Wundef -Wendif-labels CFLAGS+= -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
CONFIG_OFMEM and CONFIG_OFMEM_MALLOC_ALIGN are defined in cross-ppc_config.xml, but not in ppc_config.xml, so copy them. Likewise, copy those setting from cross-sparc64_config.xml to sparc64_config.xml. --- config/examples/ppc_config.xml | 2 ++ config/examples/sparc64_config.xml | 2 ++ 2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/config/examples/ppc_config.xml b/config/examples/ppc_config.xml index 59fd25f..d8a936c 100644 --- a/config/examples/ppc_config.xml +++ b/config/examples/ppc_config.xml @@ -35,6 +35,8 @@ <option name="CONFIG_DEBLOCKER" type="boolean" value="true"/> <option name="CONFIG_FONT_8X8" type="boolean" value="true"/> <option name="CONFIG_FONT_8X16" type="boolean" value="false"/> + <option name="CONFIG_OFMEM" type="boolean" value="true"/> + <option name="CONFIG_OFMEM_MALLOC_ALIGN" type="integer" value="4"/> <option name="CONFIG_VGA_WIDTH" type="integer" value="800"/> <option name="CONFIG_VGA_HEIGHT" type="integer" value="600"/> <option name="CONFIG_VGA_DEPTH" type="integer" value="8"/> diff --git a/config/examples/sparc64_config.xml b/config/examples/sparc64_config.xml index 825ed14..d030e00 100644 --- a/config/examples/sparc64_config.xml +++ b/config/examples/sparc64_config.xml @@ -39,6 +39,8 @@ <option name="CONFIG_DEBLOCKER" type="boolean" value="true"/> <option name="CONFIG_FONT_8X8" type="boolean" value="true"/> <option name="CONFIG_FONT_8X16" type="boolean" value="false"/> + <option name="CONFIG_OFMEM" type="boolean" value="true"/> + <option name="CONFIG_OFMEM_MALLOC_ALIGN" type="integer" value="8"/>
<!-- Filesystem Configuration --> <option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
Le lundi 10 août 2009 à 21:26 -0400, Pavel Roskin a écrit :
CONFIG_OFMEM and CONFIG_OFMEM_MALLOC_ALIGN are defined in cross-ppc_config.xml, but not in ppc_config.xml, so copy them. Likewise, copy those setting from cross-sparc64_config.xml to sparc64_config.xml.
Applied, thanks.
Check that the script is run from the top-level directory. Check that the config file is available for every specified architecture. --- config/scripts/switch-arch | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/config/scripts/switch-arch b/config/scripts/switch-arch index f52c343..0ed41a9 100755 --- a/config/scripts/switch-arch +++ b/config/scripts/switch-arch @@ -84,6 +84,11 @@ archname() -e "s/Power Macintosh/ppc/"` }
+if ! test -f utils/dist/debian/rules; then + echo "switch-arch must be run from the top-level source directory" >&2 + exit 1 +fi + # This is needed because viewvc messes with the permissions of executables: chmod 755 utils/dist/debian/rules chmod 755 config/scripts/switch-arch @@ -97,6 +102,11 @@ VERSION=`head VERSION`
echo "Configuring OpenBIOS on $HOSTARCH for $*" for RULES_ARCH in $*; do + if ! test -f config/examples/${RULES_ARCH}_config.xml; then + echo "Cannot find config/examples/${RULES_ARCH}_config.xml" >&2 + exit 1 + fi + ARCH=`echo $RULES_ARCH | sed s/cross-//g` case $ARCH in amd64)
Le lundi 10 août 2009 à 21:26 -0400, Pavel Roskin a écrit :
Check that the script is run from the top-level directory. Check that the config file is available for every specified architecture.
Applied, thanks.
Rewrite hfs_get_ushort() and hfs_get_uint() as inline functions so that their arguments are checked. Use __be16_to_cpu and __be32_to_cpu to byte-swap the result as needed. --- fs/hfs_mdb.h | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/fs/hfs_mdb.h b/fs/hfs_mdb.h index 3df549a..8301a15 100644 --- a/fs/hfs_mdb.h +++ b/fs/hfs_mdb.h @@ -15,12 +15,21 @@ #ifndef _H_HFS_MDB #define _H_HFS_MDB
+#include "libc/byteorder.h" + typedef unsigned char hfs_char_t; typedef unsigned char hfs_ushort_t[2]; typedef unsigned char hfs_uint_t[4];
-#define hfs_get_ushort(addr) (*((unsigned short*)(addr))) -#define hfs_get_uint(addr) (*((unsigned int*)(addr))) +static inline unsigned short hfs_get_ushort(hfs_ushort_t addr) +{ + return __be16_to_cpu(*((unsigned short *)(addr))); +} + +static inline unsigned short hfs_get_uint(hfs_uint_t addr) +{ + return __be32_to_cpu(*((unsigned int *)(addr))); +}
/* * The HFS Master Directory Block (MDB).
+static inline unsigned short hfs_get_uint(hfs_uint_t addr)
Sorry, this should be:
+static inline unsigned int hfs_get_uint(hfs_uint_t addr)
hfs_get_uint() is not currently used, so it didn't get caught by the compiler.
Fix HFS on little-endian systems
Rewrite hfs_get_ushort() and hfs_get_uint() as inline functions so that their arguments are checked. Use __be16_to_cpu and __be32_to_cpu to byte-swap the result as needed. --- fs/hfs_mdb.h | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/fs/hfs_mdb.h b/fs/hfs_mdb.h index 3df549a..19182a0 100644 --- a/fs/hfs_mdb.h +++ b/fs/hfs_mdb.h @@ -15,12 +15,21 @@ #ifndef _H_HFS_MDB #define _H_HFS_MDB
+#include "libc/byteorder.h" + typedef unsigned char hfs_char_t; typedef unsigned char hfs_ushort_t[2]; typedef unsigned char hfs_uint_t[4];
-#define hfs_get_ushort(addr) (*((unsigned short*)(addr))) -#define hfs_get_uint(addr) (*((unsigned int*)(addr))) +static inline unsigned short hfs_get_ushort(hfs_ushort_t addr) +{ + return __be16_to_cpu(*((unsigned short *)(addr))); +} + +static inline unsigned int hfs_get_uint(hfs_uint_t addr) +{ + return __be32_to_cpu(*((unsigned int *)(addr))); +}
/* * The HFS Master Directory Block (MDB).
Le lundi 10 août 2009 à 21:26 -0400, Pavel Roskin a écrit :
Rewrite hfs_get_ushort() and hfs_get_uint() as inline functions so that their arguments are checked. Use __be16_to_cpu and __be32_to_cpu to byte-swap the result as needed.
Corrected one applied, thanks