]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/glsdk-u-boot.git/commitdiff
Merge branch 'master' of git://git.denx.de/u-boot-x86
authorTom Rini <trini@ti.com>
Fri, 7 Dec 2012 13:43:40 +0000 (06:43 -0700)
committerTom Rini <trini@ti.com>
Fri, 7 Dec 2012 15:47:59 +0000 (08:47 -0700)
30 files changed:
.gitignore
MAINTAINERS
MAKEALL
Makefile
README
board/iomega/iconnect/iconnect.c
board/iomega/iconnect/iconnect.h
board/iomega/iconnect/kwbimage.cfg
board/raidsonic/ib62x0/ib62x0.c
board/raidsonic/ib62x0/ib62x0.h
board/raidsonic/ib62x0/kwbimage.cfg
common/cmd_led.c
disk/part.c
doc/DocBook/Makefile
doc/kwboot.1
drivers/serial/serial_pl01x.c
fs/cbfs/Makefile
fs/cbfs/cbfs.c
fs/ext4/dev.c
fs/ext4/ext4_common.c
fs/ext4/ext4_journal.c
fs/ext4/ext4fs.c
include/cbfs.h
include/configs/ib62x0.h
include/configs/iconnect.h
lib/lzma/LzmaDec.c
lib/lzma/LzmaDec.h
lib/lzma/Types.h
lib/lzma/history.txt
lib/lzma/lzma.txt

index 1ac43f2825666d93f2f611e86ab2f735777bf83f..a163728832eb0fc7b01ece5d81c6239f3b824671 100644 (file)
 /u-boot.sha1
 /u-boot.dis
 /u-boot.lds
-/u-boot.lst
 /u-boot.ubl
 /u-boot.ais
 /u-boot.dtb
 /u-boot.sb
 /u-boot.geany
+/include/u-boot.lst
 
 #
 # Generated files
index 428b0064e1b803a963c9ed34a2d613b49c504283..b24ba19b76490bb2a4e5e35f5b552d790fd9e49c 100644 (file)
@@ -7,6 +7,10 @@
 # and Cc: the <u-boot@lists.denx.de> mailing list.                     #
 #                                                                      #
 # Note: lists sorted by Maintainer Name                                        #
+# Note: These are the maintainers for specific *boards*.  The          #
+#      custodians for general architectures and subsystems can         #
+#      be found here -- http://www.denx.de/wiki/U-Boot/Custodians      #
+#                                                                      #
 #########################################################################
 
 
@@ -801,7 +805,7 @@ Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
 
        apx4devkit      i.MX28
 
-Luka Perkov <uboot@lukaperkov.net>
+Luka Perkov <luka@openwrt.org>
 
        ib62x0          ARM926EJS
        iconnect        ARM926EJS
diff --git a/MAKEALL b/MAKEALL
index 46c021241ff4809bdb8e033d90e28b510e0e5d64..5b06c5477decafc2d18dafd0ad8520e96a572ca0 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -20,6 +20,8 @@ usage()
          -m,        --maintainers     List all targets and maintainer email
          -M,        --mails           List all targets and all affilated emails
          -C,        --check           Enable build checking
+         -n,        --continue        Continue (skip boards already built)
+         -r,        --rebuild-errors  Rebuild any boards that errored
          -h,        --help            This help output
 
        Selections by these options are logically ANDed; if the same option
@@ -52,8 +54,8 @@ usage()
        exit ${ret}
 }
 
-SHORT_OPTS="ha:c:v:s:lmMC"
-LONG_OPTS="help,arch:,cpu:,vendor:,soc:,list,maintainers,mails,check"
+SHORT_OPTS="ha:c:v:s:lmMCnr"
+LONG_OPTS="help,arch:,cpu:,vendor:,soc:,list,maintainers,mails,check,continue,rebuild-errors"
 
 # Option processing based on util-linux-2.13/getopt-parse.bash
 
@@ -73,6 +75,8 @@ SELECTED=''
 ONLY_LIST=''
 PRINT_MAINTS=''
 MAINTAINERS_ONLY=''
+CONTINUE=''
+REBUILD_ERRORS=''
 
 while true ; do
        case "$1" in
@@ -115,6 +119,12 @@ while true ; do
        -C|--check)
                CHECK='C=1'
                shift ;;
+       -n|--continue)
+               CONTINUE='y'
+               shift ;;
+       -r|--rebuild-errors)
+               REBUILD_ERRORS='y'
+               shift ;;
        -l|--list)
                ONLY_LIST='y'
                shift ;;
@@ -198,7 +208,9 @@ fi
 OUTPUT_PREFIX="${BUILD_DIR}"
 
 [ -d ${LOG_DIR} ] || mkdir "${LOG_DIR}" || exit 1
-find "${LOG_DIR}/" -type f -exec rm -f {} +
+if [ "$CONTINUE" != 'y' -a "$REBUILD_ERRORS" != 'y' ] ; then
+       find "${LOG_DIR}/" -type f -exec rm -f {} +
+fi
 
 LIST=""
 
@@ -208,6 +220,7 @@ ERR_LIST=""
 WRN_CNT=0
 WRN_LIST=""
 TOTAL_CNT=0
+SKIP_CNT=0
 CURRENT_CNT=0
 OLDEST_IDX=1
 RC=0
@@ -616,6 +629,13 @@ list_target() {
 donep="${LOG_DIR}/._done_"
 skipp="${LOG_DIR}/._skip_"
 
+build_target_killed() {
+       echo "Aborted $target build."
+       # Remove the logs for this board since it was aborted
+       rm -f ${LOG_DIR}/$target.MAKELOG ${LOG_DIR}/$target.ERR
+       exit
+}
+
 build_target() {
        target=$1
        build_idx=$2
@@ -628,6 +648,7 @@ build_target() {
        if [ $BUILD_MANY == 1 ] ; then
                output_dir="${OUTPUT_PREFIX}/${target}"
                mkdir -p "${output_dir}"
+               trap build_target_killed TERM
        else
                output_dir="${OUTPUT_PREFIX}"
        fi
@@ -646,6 +667,8 @@ build_target() {
        fi
 
        if [ $BUILD_MANY == 1 ] ; then
+               trap - TERM
+
                ${MAKE} -s tidy
 
                if [ -s ${LOG_DIR}/${target}.ERR ] ; then
@@ -724,10 +747,20 @@ build_targets() {
                        : $((CURRENT_CNT += 1))
                        rm -f "${donep}${TOTAL_CNT}"
                        rm -f "${skipp}${TOTAL_CNT}"
-                       if [ $BUILD_MANY == 1 ] ; then
-                               build_target ${t} ${TOTAL_CNT} &
+                       if [ "$CONTINUE" = 'y' -a -e ${LOG_DIR}/$t.MAKELOG ] ; then
+                               : $((SKIP_CNT += 1))
+                               touch "${donep}${TOTAL_CNT}"
+                       elif [ "$REBUILD_ERRORS" = 'y' -a ! -e ${LOG_DIR}/$t.ERR ] ; then
+                               : $((SKIP_CNT += 1))
+                               touch "${donep}${TOTAL_CNT}"
                        else
-                               build_target ${t} ${TOTAL_CNT}
+                               if [ $BUILD_MANY == 1 ] ; then
+                                       build_target ${t} ${TOTAL_CNT} &
+                               else
+                                       CUR_TGT="${t}"
+                                       build_target ${t} ${TOTAL_CNT}
+                                       CUR_TGT=''
+                               fi
                        fi
                fi
 
@@ -751,7 +784,11 @@ build_targets() {
 #-----------------------------------------------------------------------
 
 kill_children() {
-       kill -- "-$1"
+       local pgid=`ps -p $$ --no-headers -o "%r" | tr -d ' '`
+       local children=`pgrep -g $pgid | grep -v $$ | grep -v $pgid`
+
+       kill $children 2> /dev/null
+       wait $children 2> /dev/null
 
        exit
 }
@@ -759,6 +796,9 @@ kill_children() {
 print_stats() {
        if [ "$ONLY_LIST" == 'y' ] ; then return ; fi
 
+       # Only count boards that completed
+       : $((TOTAL_CNT = `find ${skipp}* 2> /dev/null | wc -l`))
+
        rm -f ${donep}* ${skipp}*
 
        if [ $BUILD_MANY == 1 ] && [ -e "${OUTPUT_PREFIX}/ERR" ] ; then
@@ -768,10 +808,17 @@ print_stats() {
                WRN_LIST=`grep -riwL error ${OUTPUT_PREFIX}/ERR/`
                WRN_LIST=`for f in $WRN_LIST ; do echo -n " $(basename $f)" ; done`
                WRN_CNT=`echo $WRN_LIST | wc -w | awk '{print $1}'`
+       else
+               # Remove the logs for any board that was interrupted
+               rm -f ${LOG_DIR}/${CUR_TGT}.MAKELOG ${LOG_DIR}/${CUR_TGT}.ERR
        fi
 
+       : $((TOTAL_CNT -= ${SKIP_CNT}))
        echo ""
        echo "--------------------- SUMMARY ----------------------------"
+       if [ "$CONTINUE" = 'y' -o "$REBUILD_ERRORS" = 'y' ] ; then
+               echo "Boards skipped: ${SKIP_CNT}"
+       fi
        echo "Boards compiled: ${TOTAL_CNT}"
        if [ ${ERR_CNT} -gt 0 ] ; then
                echo "Boards with errors: ${ERR_CNT} (${ERR_LIST} )"
@@ -782,7 +829,7 @@ print_stats() {
        echo "----------------------------------------------------------"
 
        if [ $BUILD_MANY == 1 ] ; then
-               kill_children $$ &
+               kill_children
        fi
 
        exit $RC
index 2132ebf10f23e89b830749d00bbb6f0d71b163cf..de96861ea28b4e7eb22e8bc9357767bbfa720d41 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -390,12 +390,12 @@ __LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD))
 ifneq ($(CONFIG_BOARD_SIZE_LIMIT),)
 BOARD_SIZE_CHECK = \
        @actual=`wc -c $@ | awk '{print $$1}'`; \
-       limit=$(CONFIG_BOARD_SIZE_LIMIT); \
+       limit=`printf "%d" $(CONFIG_BOARD_SIZE_LIMIT)`; \
        if test $$actual -gt $$limit; then \
-               echo "$@ exceeds file size limit:"; \
-               echo "  limit:  $$limit bytes"; \
-               echo "  actual: $$actual bytes"; \
-               echo "  excess: $$((actual - limit)) bytes"; \
+               echo "$@ exceeds file size limit:" >&2 ; \
+               echo "  limit:  $$limit bytes" >&2 ; \
+               echo "  actual: $$actual bytes" >&2 ; \
+               echo "  excess: $$((actual - limit)) bytes" >&2; \
                exit 1; \
        fi
 else
diff --git a/README b/README
index 0f5dfadcaf9a5a9548dbdefa8627decc21185d86..5a86ae9c5f9188dd53a8b54ce3eb9554f2485f41 100644 (file)
--- a/README
+++ b/README
@@ -54,6 +54,11 @@ In case of problems see the CHANGELOG and CREDITS files to find out
 who contributed the specific port. The MAINTAINERS file lists board
 maintainers.
 
+Note: There is no CHANGELOG file in the actual U-Boot source tree;
+it can be created dynamically from the Git log using:
+
+       make CHANGELOG
+
 
 Where to get help:
 ==================
index 6ee2128aab8e6738539266dea07ef016ee6218f7..8cfb4e6620dade4577bca5c1e02d3944d3d3fc65 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2009-2012
  * Wojciech Dubowik <wojciech.dubowik@neratec.com>
- * Luka Perkov <uboot@lukaperkov.net>
+ * Luka Perkov <luka@openwrt.org>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
index 2fb3e5ed8f23eb94626f7b20cd3b40c0a9efbe9a..8b6fe1bcadb56bf6f296c61b899111472e4c55ff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2009-2012
  * Wojciech Dubowik <wojciech.dubowik@neratec.com>
- * Luka Perkov <uboot@lukaperkov.net>
+ * Luka Perkov <luka@openwrt.org>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
index 6c9dfe3d31d3e6b2fc3ab2d687c5c6cf0b9778eb..4b64dab5925121fb97f7e68bb731d91fd95c99a0 100644 (file)
@@ -1,7 +1,7 @@
 #
 # (C) Copyright 2009-2012
 # Wojciech Dubowik <wojciech.dubowik@neratec.com>
-# Luka Perkov <uboot@lukaperkov.net>
+# Luka Perkov <luka@openwrt.org>
 #
 # See file CREDITS for list of people who contributed to this
 # project.
index b7e6e4107c5be88049fe7133cf3d705cdfc112bf..5f0f3961d319ad2ab037403e26b243f2debe43c3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2011-2012
  * Gerald Kerma <dreagle@doukki.net>
- * Luka Perkov <uboot@lukaperkov.net>
+ * Luka Perkov <luka@openwrt.org>
  * Simon Baatz <gmbnomis@gmail.com>
  *
  * See file CREDITS for list of people who contributed to this
index 0118c2b69acc18d7c25fc31195c39d5e9e6009d0..3315696dda91c5f48eb32eee17e0cbb5762fc381 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2011-2012
  * Gerald Kerma <dreagle@doukki.net>
  * Simon Baatz <gmbnomis@gmail.com>
- * Luka Perkov <uboot@lukaperkov.net>
+ * Luka Perkov <luka@openwrt.org>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
index bd594ebd5d7752fa63d86e1e2bdea6511c8ee005..bade627ccf57d7581e828c809e8c2798d2ee8061 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright (C) 2011-2012
 # Gerald Kerma <dreagle@doukki.net>
 # Simon Baatz <gmbnomis@gmail.com>
-# Luka Perkov <uboot@lukaperkov.net>
+# Luka Perkov <luka@openwrt.org>
 #
 # See file CREDITS for list of people who contributed to this
 # project.
index d83b3ba69b7269dd0eb52bcfb455779d8aec2637..7f5ab43c7f5d92f4af1e799ae42e2ffcbe9f3786 100644 (file)
@@ -140,7 +140,7 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 U_BOOT_CMD(
        led, 3, 1, do_led,
-       "led\t- ["
+       "["
 #ifdef CONFIG_BOARD_SPECIFIC_LED
 #ifdef STATUS_LED_BIT
        "0|"
@@ -167,6 +167,6 @@ U_BOOT_CMD(
 #ifdef STATUS_LED_BLUE
        "blue|"
 #endif
-       "all] [on|off|toggle]\n",
-       "led [led_name] [on|off|toggle] sets or clears led(s)\n"
+       "all] [on|off|toggle]",
+       "[led_name] [on|off|toggle] sets or clears led(s)"
 );
index 4646f682d2c8b6c7f05bf0dc5ea9fba1c8b4f791..7bdc90eff701183934874195356c36e6d5a4ab5f 100644 (file)
@@ -199,7 +199,7 @@ void dev_print (block_dev_desc_t *dev_desc)
                break;
        }
        puts ("\n");
-       if ((dev_desc->lba * dev_desc->blksz)>0L) {
+       if (dev_desc->lba > 0L && dev_desc->blksz > 0L) {
                ulong mb, mb_quot, mb_rem, gb, gb_quot, gb_rem;
                lbaint_t lba;
 
index da88b3241984c45bf5c8970ca7f818e54c4d9a18..521e8bc0e9b7144e0e378ab2808ccaccbb3d8ce3 100644 (file)
@@ -8,7 +8,7 @@
 
 include $(TOPDIR)/config.mk
 
-DOCBOOKS := linker_lists.xml stdio.xml
+DOCBOOKS := fs.xml linker_lists.xml stdio.xml
 
 ###
 # The build process is as follows (targets):
index ed0839836ea15fb400185b395e2da183fb85bff0..25fe69aa5c4cbc31593bdd2d0b8cd8ca4398090d 100644 (file)
@@ -79,6 +79,6 @@ Adjust the baud rate on \fITTY\fP. Default rate is 115200.
 
 Daniel Stodden <daniel.stodden@gmail.com>
 .br
-Luka Perkov <uboot@lukaperkov.net>
+Luka Perkov <luka@openwrt.org>
 .br
 David Purdy <david.c.purdy@gmail.com>
index b331be794badb8f5d84710ba693348ca9600bc2e..dfdba9f64eb8031144d6be6b2722f070df3cf047 100644 (file)
@@ -163,8 +163,8 @@ static int pl01x_serial_init(void)
        }
 #endif
        /* Finally, enable the UART */
-       writel(UART_PL011_CR_UARTEN | UART_PL011_CR_TXE | UART_PL011_CR_RXE,
-              &regs->pl011_cr);
+       writel(UART_PL011_CR_UARTEN | UART_PL011_CR_TXE | UART_PL011_CR_RXE |
+              UART_PL011_CR_RTS, &regs->pl011_cr);
 
        return 0;
 }
index 2be8a6880b73eb939caee408eb21dea8e5e7d48e..e0e6de69faf1823fab4272cb3954bff8639641d9 100644 (file)
@@ -1,6 +1,4 @@
-#
-# See file CREDITS for list of people who contributed to this
-# project.
+# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
index cae6d56db796db06684a4981af1ab11ce8bbc445..1b25a15e48848081c34c396eb7e060d150327a61 100644 (file)
@@ -1,9 +1,6 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of
index 1596a92b9ada611fd6889741f5b5d421b290f0fc..464a67d5319cf771da2aad2036fb5abf46a3e42a 100644 (file)
@@ -52,6 +52,7 @@ void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
        part_info = info;
        part_offset = info->start;
        get_fs()->total_sect = (info->size * info->blksz) / SECTOR_SIZE;
+       get_fs()->dev_desc = rbdd;
 }
 
 int ext4fs_devread(int sector, int byte_offset, int byte_len, char *buf)
index 323875fa9452e9863b8fa21376b519c28f1729da..f12b8056cc02abb788bf4d9d6b70cf1f3e0ee8f1 100644 (file)
@@ -378,7 +378,6 @@ void ext4fs_update_parent_dentry(char *filename, int *p_ino, int file_type)
        struct ext_filesystem *fs = get_fs();
        /* directory entry */
        struct ext2_dirent *dir;
-       char *ptr = NULL;
        char *temp_dir = NULL;
 
        zero_buffer = zalloc(fs->blksz);
@@ -415,7 +414,6 @@ restart:
        if (ext4fs_log_journal(root_first_block_buffer, first_block_no_of_root))
                goto fail;
        dir = (struct ext2_dirent *)root_first_block_buffer;
-       ptr = (char *)dir;
        totalbytes = 0;
        while (dir->direntlen > 0) {
                /*
@@ -483,14 +481,12 @@ restart:
                        break;
 
                dir = (struct ext2_dirent *)((char *)dir + templength);
-               ptr = (char *)dir;
        }
 
        /* make a pointer ready for creating next directory entry */
        templength = dir->direntlen;
        totalbytes = totalbytes + templength;
        dir = (struct ext2_dirent *)((char *)dir + templength);
-       ptr = (char *)dir;
 
        /* get the next available inode number */
        inodeno = ext4fs_get_new_inode_no();
@@ -1200,6 +1196,11 @@ static void alloc_double_indirect_block(struct ext2_inode *file_inode,
                status = ext4fs_devread(di_blockno_parent *
                                        fs->sect_perblk, 0,
                                        fs->blksz, (char *)di_parent_buffer);
+
+               if (!status) {
+                       printf("%s: Device read error!\n", __func__);
+                       goto fail;
+               }
                memset(di_parent_buffer, '\0', fs->blksz);
 
                /*
@@ -1227,6 +1228,11 @@ static void alloc_double_indirect_block(struct ext2_inode *file_inode,
                                                fs->sect_perblk, 0,
                                                fs->blksz,
                                                (char *)di_child_buff);
+
+                       if (!status) {
+                               printf("%s: Device read error!\n", __func__);
+                               goto fail;
+                       }
                        memset(di_child_buff, '\0', fs->blksz);
                        /* filling of actual datablocks for each child */
                        for (j = 0; j < (fs->blksz / sizeof(int)); j++) {
index 8a252d66c336d813d6d13ddaee0f2d56877d8cbf..9f017084f17e37c1949947f557861d4f7b2c02ec 100644 (file)
@@ -410,7 +410,7 @@ int ext4fs_check_journal_state(int recovery_flag)
        int transaction_state = TRANSACTION_COMPLETE;
        int prev_desc_logical_no = 0;
        int curr_desc_logical_no = 0;
-       int ofs, flags, block;
+       int ofs, flags;
        struct ext2_inode inode_journal;
        struct journal_superblock_t *jsb = NULL;
        struct journal_header_t *jdb = NULL;
@@ -453,7 +453,6 @@ int ext4fs_check_journal_state(int recovery_flag)
 
        i = be32_to_cpu(jsb->s_first);
        while (1) {
-               block = be32_to_cpu(jsb->s_first);
                blknr = read_allocated_block(&inode_journal, i);
                memset(temp_buff1, '\0', fs->blksz);
                ext4fs_devread(blknr * fs->sect_perblk,
index 06536baf625b375e5843e8af08fb4e6d354857aa..f02c215ccc2e5676dd1c8fd6783b4d582ae32b69 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/stat.h>
 #include <linux/time.h>
 #include <asm/byteorder.h>
+#include <div64.h>
 #include "ext4_common.h"
 
 int ext4fs_symlinknest;
@@ -930,7 +931,6 @@ static int ext4fs_write_file(struct ext2_inode *file_inode,
        int previous_block_number = -1;
        int delayed_start = 0;
        int delayed_extent = 0;
-       int delayed_skipfirst = 0;
        int delayed_next = 0;
        char *delayed_buf = NULL;
 
@@ -963,7 +963,6 @@ static int ext4fs_write_file(struct ext2_inode *file_inode,
                                        previous_block_number = blknr;
                                        delayed_start = blknr;
                                        delayed_extent = blockend;
-                                       delayed_skipfirst = skipfirst;
                                        delayed_buf = buf;
                                        delayed_next = blknr +
                                            (blockend >> SECTOR_BITS);
@@ -972,7 +971,6 @@ static int ext4fs_write_file(struct ext2_inode *file_inode,
                                previous_block_number = blknr;
                                delayed_start = blknr;
                                delayed_extent = blockend;
-                               delayed_skipfirst = skipfirst;
                                delayed_buf = buf;
                                delayed_next = blknr +
                                    (blockend >> SECTOR_BITS);
@@ -1013,8 +1011,6 @@ int ext4fs_write(const char *fname, unsigned char *buffer,
        unsigned int blks_reqd_for_file;
        unsigned int blocks_remaining;
        int existing_file_inodeno;
-       char filename[256];
-
        char *temp_ptr = NULL;
        long int itable_blkno;
        long int parent_itable_blkno;
@@ -1023,6 +1019,9 @@ int ext4fs_write(const char *fname, unsigned char *buffer,
        unsigned int inodes_per_block;
        unsigned int ibmap_idx;
        struct ext_filesystem *fs = get_fs();
+       ALLOC_CACHE_ALIGN_BUFFER(char, filename, 256);
+       memset(filename, 0x00, sizeof(filename));
+
        g_parent_inode = zalloc(sizeof(struct ext2_inode));
        if (!g_parent_inode)
                goto fail;
@@ -1051,8 +1050,8 @@ int ext4fs_write(const char *fname, unsigned char *buffer,
        }
        /* calucalate how many blocks required */
        bytes_reqd_for_file = sizebytes;
-       blks_reqd_for_file = bytes_reqd_for_file / fs->blksz;
-       if (bytes_reqd_for_file % fs->blksz != 0) {
+       blks_reqd_for_file = lldiv(bytes_reqd_for_file, fs->blksz);
+       if (do_div(bytes_reqd_for_file, fs->blksz) != 0) {
                blks_reqd_for_file++;
                debug("total bytes for a file %u\n", blks_reqd_for_file);
        }
index 6ea3f351196118a8b96d8e280cdbfe6d13d76771..5bb12c355c2f390276bb28bb355914dcf2199e1e 100644 (file)
@@ -1,9 +1,6 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of
@@ -77,46 +74,47 @@ struct cbfs_cachenode {
 
 extern enum cbfs_result file_cbfs_result;
 
-/*
- * Return a string describing the most recent error condition.
+/**
+ * file_cbfs_error() - Return a string describing the most recent error
+ * condition.
  *
  * @return A pointer to the constant string.
  */
 const char *file_cbfs_error(void);
 
-/*
- * Initialize the CBFS driver and load metadata into RAM.
+/**
+ * file_cbfs_init() - Initialize the CBFS driver and load metadata into RAM.
  *
- * @param end_of_rom   Points to the end of the ROM the CBFS should be read
+ * @end_of_rom: Points to the end of the ROM the CBFS should be read
  *                      from.
  */
 void file_cbfs_init(uintptr_t end_of_rom);
 
-/*
- * Get the header structure for the current CBFS.
+/**
+ * file_cbfs_get_header() - Get the header structure for the current CBFS.
  *
  * @return A pointer to the constant structure, or NULL if there is none.
  */
 const struct cbfs_header *file_cbfs_get_header(void);
 
-/*
- * Get a handle for the first file in CBFS.
+/**
+ * file_cbfs_get_first() - Get a handle for the first file in CBFS.
  *
  * @return A handle for the first file in CBFS, NULL on error.
  */
 const struct cbfs_cachenode *file_cbfs_get_first(void);
 
-/*
- * Get a handle to the file after this one in CBFS.
+/**
+ * file_cbfs_get_next() - Get a handle to the file after this one in CBFS.
  *
- * @param file         A pointer to the handle to advance.
+ * @file:              A pointer to the handle to advance.
  */
 void file_cbfs_get_next(const struct cbfs_cachenode **file);
 
-/*
- * Find a file with a particular name in CBFS.
+/**
+ * file_cbfs_find() - Find a file with a particular name in CBFS.
  *
- * @param name         The name to search for.
+ * @name:              The name to search for.
  *
  * @return A handle to the file, or NULL on error.
  */
@@ -127,53 +125,55 @@ const struct cbfs_cachenode *file_cbfs_find(const char *name);
 /* All of the functions below can be used without first initializing CBFS. */
 /***************************************************************************/
 
-/*
- * Find a file with a particular name in CBFS without using the heap.
+/**
+ * file_cbfs_find_uncached() - Find a file with a particular name in CBFS
+ * without using the heap.
  *
- * @param end_of_rom   Points to the end of the ROM the CBFS should be read
+ * @end_of_rom:                Points to the end of the ROM the CBFS should be read
  *                      from.
- * @param name         The name to search for.
+ * @name:              The name to search for.
  *
  * @return A handle to the file, or NULL on error.
  */
 const struct cbfs_cachenode *file_cbfs_find_uncached(uintptr_t end_of_rom,
                                                     const char *name);
 
-/*
- * Get the name of a file in CBFS.
+/**
+ * file_cbfs_name() - Get the name of a file in CBFS.
  *
- * @param file         The handle to the file.
+ * @file:              The handle to the file.
  *
  * @return The name of the file, NULL on error.
  */
 const char *file_cbfs_name(const struct cbfs_cachenode *file);
 
-/*
- * Get the size of a file in CBFS.
+/**
+ * file_cbfs_size() - Get the size of a file in CBFS.
  *
- * @param file         The handle to the file.
+ * @file:              The handle to the file.
  *
  * @return The size of the file, zero on error.
  */
 u32 file_cbfs_size(const struct cbfs_cachenode *file);
 
-/*
- * Get the type of a file in CBFS.
+/**
+ * file_cbfs_type() - Get the type of a file in CBFS.
  *
- * @param file         The handle to the file.
+ * @file:              The handle to the file.
  *
  * @return The type of the file, zero on error.
  */
 u32 file_cbfs_type(const struct cbfs_cachenode *file);
 
-/*
- * Read a file from CBFS into RAM
+/**
+ * file_cbfs_read() - Read a file from CBFS into RAM
  *
- * @param file         A handle to the file to read.
- * @param buffer       Where to read it into memory.
+ * @file:              A handle to the file to read.
+ * @buffer:            Where to read it into memory.
+ * @maxsize:           Maximum number of bytes to read
  *
  * @return If positive or zero, the number of characters read. If negative, an
- *         error occurred.
+ *        error occurred.
  */
 long file_cbfs_read(const struct cbfs_cachenode *file, void *buffer,
                    unsigned long maxsize);
index 85856f290edecc8f83241d4ac929b4a5d94eda1b..f646ae57764de475ae23d701c8a74eed675a1041 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2011-2012
  * Gerald Kerma <dreagle@doukki.net>
- * Luka Perkov <uboot@lukaperkov.net>
+ * Luka Perkov <luka@openwrt.org>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
index 2b523c9fc97f3a22e4596e60da0a9599153cfd35..ba57849a602f32223b42df8601da632e3eac5745 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * (C) Copyright 2009-2012
  * Wojciech Dubowik <wojciech.dubowik@neratec.com>
- * Luka Perkov <uboot@lukaperkov.net>
+ * Luka Perkov <luka@openwrt.org>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
index f941da27dd0bdad1c78e2ed77825797a29f8bfd4..4f45f80fe26477f04b516cff23ffb417551cd30d 100644 (file)
@@ -1,5 +1,5 @@
 /* LzmaDec.c -- LZMA Decoder
-2008-11-06 : Igor Pavlov : Public domain */
+2009-09-20 : Igor Pavlov : Public domain */
 
 #include <config.h>
 #include <common.h>
 StopCompilingDueBUG
 #endif
 
-static const Byte kLiteralNextStates[kNumStates * 2] =
-{
-  0, 0, 0, 0, 1, 2, 3,  4,  5,  6,  4,  5,
-  7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10
-};
-
 #define LZMA_DIC_MIN (1 << 12)
 
 /* First LZMA-symbol is always decoded.
@@ -180,6 +174,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
 
       if (state < kNumLitStates)
       {
+        state -= (state < 4) ? state : 3;
         symbol = 1;
 
         WATCHDOG_RESET();
@@ -190,6 +185,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
       {
         unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
         unsigned offs = 0x100;
+        state -= (state < 10) ? 3 : 6;
         symbol = 1;
 
         WATCHDOG_RESET();
@@ -207,9 +203,6 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
       }
       dic[dicPos++] = (Byte)symbol;
       processedPos++;
-
-      state = kLiteralNextStates[state];
-      /* if (state < 4) state = 0; else if (state < 10) state -= 3; else state -= 6; */
       continue;
     }
     else
@@ -395,7 +388,6 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
         else if (distance >= checkDicSize)
           return SZ_ERROR_DATA;
         state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3;
-        /* state = kLiteralNextStates[state]; */
       }
 
       len += kMatchMinLen;
index 7fba87f076e397790c7af75effeb43b348f27dc3..63aa505e8ca5a8aa6ed4087aa6f262ac147c40a4 100644 (file)
@@ -1,8 +1,8 @@
 /* LzmaDec.h -- LZMA Decoder
-2008-10-04 : Igor Pavlov : Public domain */
+2009-02-07 : Igor Pavlov : Public domain */
 
-#ifndef __LZMADEC_H
-#define __LZMADEC_H
+#ifndef __LZMA_DEC_H
+#define __LZMA_DEC_H
 
 #include "Types.h"
 
index 1af5cfc4d86871403ce279a3b395aba9ba811588..8afcba556eb404fc92355f2edb880f44e39e8350 100644 (file)
@@ -1,5 +1,5 @@
 /* Types.h -- Basic types
-2008-11-23 : Igor Pavlov : Public domain */
+2010-10-09 : Igor Pavlov : Public domain */
 
 #ifndef __7Z_TYPES_H
 #define __7Z_TYPES_H
@@ -65,9 +65,11 @@ typedef unsigned long UInt64;
 #if defined(_MSC_VER) || defined(__BORLANDC__)
 typedef __int64 Int64;
 typedef unsigned __int64 UInt64;
+#define UINT64_CONST(n) n
 #else
 typedef long long int Int64;
 typedef unsigned long long int UInt64;
+#define UINT64_CONST(n) n ## ULL
 #endif
 
 #endif
@@ -92,13 +94,11 @@ typedef int Bool;
 #endif
 
 #define MY_CDECL __cdecl
-#define MY_STD_CALL __stdcall
-#define MY_FAST_CALL MY_NO_INLINE __fastcall
+#define MY_FAST_CALL __fastcall
 
 #else
 
 #define MY_CDECL
-#define MY_STD_CALL
 #define MY_FAST_CALL
 
 #endif
@@ -106,6 +106,16 @@ typedef int Bool;
 
 /* The following interfaces use first parameter as pointer to structure */
 
+typedef struct
+{
+  Byte (*Read)(void *p); /* reads one byte, returns 0 in case of EOF or error */
+} IByteIn;
+
+typedef struct
+{
+  void (*Write)(void *p, Byte b);
+} IByteOut;
+
 typedef struct
 {
   SRes (*Read)(void *p, void *buf, size_t *size);
@@ -140,7 +150,7 @@ typedef struct
 
 typedef struct
 {
-  SRes (*Look)(void *p, void **buf, size_t *size);
+  SRes (*Look)(void *p, const void **buf, size_t *size);
     /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
        (output(*size) > input(*size)) is not allowed
        (output(*size) < input(*size)) is allowed */
@@ -205,4 +215,20 @@ typedef struct
 #define IAlloc_Alloc(p, size) (p)->Alloc((p), size)
 #define IAlloc_Free(p, a) (p)->Free((p), a)
 
+#ifdef _WIN32
+
+#define CHAR_PATH_SEPARATOR '\\'
+#define WCHAR_PATH_SEPARATOR L'\\'
+#define STRING_PATH_SEPARATOR "\\"
+#define WSTRING_PATH_SEPARATOR L"\\"
+
+#else
+
+#define CHAR_PATH_SEPARATOR '/'
+#define WCHAR_PATH_SEPARATOR L'/'
+#define STRING_PATH_SEPARATOR "/"
+#define WSTRING_PATH_SEPARATOR L"/"
+
+#endif
+
 #endif
index aadf8255edb395d58b1cd7beab31569110ef7b3c..443511bdd49cc19f8ebffd11dc9153a6b2e23168 100644 (file)
@@ -1,6 +1,41 @@
 HISTORY of the LZMA SDK
 -----------------------
 
+9.18 beta      2010-11-02
+-------------------------
+- New small SFX module for installers (SfxSetup).
+
+
+9.12 beta      2010-03-24
+-------------------------
+- The BUG in LZMA SDK 9.* was fixed: LZMA2 codec didn't work,
+  if more than 10 threads were used (or more than 20 threads in some modes).
+
+
+9.11 beta      2010-03-15
+-------------------------
+- PPMd compression method support
+
+
+9.09           2009-12-12
+-------------------------
+- The bug was fixed:
+   Utf16_To_Utf8 funstions in UTFConvert.cpp and 7zMain.c
+   incorrectly converted surrogate characters (the code >= 0x10000) to UTF-8.
+- Some bugs were fixed
+
+
+9.06           2009-08-17
+-------------------------
+- Some changes in ANSI-C 7z Decoder interfaces.
+
+
+9.04           2009-05-30
+-------------------------
+- LZMA2 compression method support
+- xz format support
+
+
 4.65           2009-02-03
 -------------------------
 - Some minor fixes
index aa20f9dc5ce902f594db59e505aec9801136d675..144cd9aee2ecc718086b16f3bae63e9073521813 100644 (file)
@@ -1,4 +1,4 @@
-LZMA SDK 4.65
+LZMA SDK 9.20
 -------------
 
 LZMA SDK provides the documentation, samples, header files, libraries,
@@ -20,6 +20,10 @@ LICENSE
 
 LZMA SDK is written and placed in the public domain by Igor Pavlov.
 
+Some code in LZMA SDK is based on public domain code from another developers:
+  1) PPMd var.H (2001): Dmitry Shkarin
+  2) SHA-256: Wei Dai (Crypto++ library)
+
 
 LZMA SDK Contents
 -----------------
@@ -33,7 +37,7 @@ LZMA SDK includes:
 UNIX/Linux version
 ------------------
 To compile C++ version of file->file LZMA encoding, go to directory
-C++/7zip/Compress/LZMA_Alone
+CPP/7zip/Bundles/LzmaCon
 and call make to recompile it:
   make -f makefile.gcc clean all
 
@@ -49,6 +53,7 @@ lzma.txt     - LZMA SDK description (this file)
 7zC.txt      - 7z ANSI-C Decoder description
 methods.txt  - Compression method IDs for .7z
 lzma.exe     - Compiled file->file LZMA encoder/decoder for Windows
+7zr.exe      - 7-Zip with 7z/lzma/xz support.
 history.txt  - history of the LZMA SDK
 
 
@@ -66,7 +71,7 @@ C/  - C files
         LzmaEnc.*  - LZMA encoding
         LzmaLib.*  - LZMA Library for DLL calling
         Types.h    - Basic types for another .c files
-       Threads.*  - The code for multithreading.
+        Threads.*  - The code for multithreading.
 
     LzmaLib  - LZMA Library (.DLL for Windows)
 
@@ -86,12 +91,6 @@ CPP/ -- CPP files
 
     Compress - files related to compression/decompression
 
-      Copy         - Copy coder
-      RangeCoder   - Range Coder (special code of compression/decompression)
-      LZMA         - LZMA compression/decompression on C++
-      LZMA_Alone   - file->file LZMA compression/decompression
-      Branch       - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code
-
     Archive - files related to archiving
 
       Common   - common files for archive handling
@@ -100,6 +99,7 @@ CPP/ -- CPP files
     Bundles    - Modules that are bundles of other modules
 
       Alone7z           - 7zr.exe: Standalone version of 7z.exe that supports only 7z/LZMA/BCJ/BCJ2
+      LzmaCon           - lzma.exe: LZMA compression/decompression
       Format7zR         - 7zr.dll: Reduced version of 7za.dll: extracting/compressing to 7z/LZMA/BCJ/BCJ2
       Format7zExtractR  - 7zxr.dll: Reduced version of 7zxa.dll: extracting from 7z/LZMA/BCJ/BCJ2.
 
@@ -369,8 +369,8 @@ Interface:
     propData - LZMA properties  (5 bytes)
     propSize - size of propData buffer (5 bytes)
     finishMode - It has meaning only if the decoding reaches output limit (*destLen).
-        LZMA_FINISH_ANY - Decode just destLen bytes.
-        LZMA_FINISH_END - Stream must be finished after (*destLen).
+         LZMA_FINISH_ANY - Decode just destLen bytes.
+         LZMA_FINISH_END - Stream must be finished after (*destLen).
                            You can use LZMA_FINISH_END, when you know that
                            current output buffer covers last bytes of stream.
     alloc    - Memory allocator.
@@ -431,7 +431,7 @@ Memory Requirements:
   {
     ...
     int res = LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
-       const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode);
+        const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode);
     ...
   }
 
@@ -527,7 +527,8 @@ static ISzAlloc g_Alloc = { SzAlloc, SzFree };
   LzmaEnc_Destroy(enc, &g_Alloc, &g_Alloc);
 
 
-If callback function return some error code, LzmaEnc_Encode also returns that code.
+If callback function return some error code, LzmaEnc_Encode also returns that code
+or it can return the code like SZ_ERROR_READ, SZ_ERROR_WRITE or SZ_ERROR_PROGRESS.
 
 
 Single-call RAM->RAM Compression
@@ -549,8 +550,8 @@ Return code:
 
 
 
-LZMA Defines
-------------
+Defines
+-------
 
 _LZMA_SIZE_OPT - Enable some optimizations in LZMA Decoder to get smaller executable code.
 
@@ -562,6 +563,9 @@ _LZMA_UINT32_IS_ULONG  - Define it if int is 16-bit on your compiler and long is
 _LZMA_NO_SYSTEM_SIZE_T  - Define it if you don't want to use size_t type.
 
 
+_7ZIP_PPMD_SUPPPORT - Define it if you don't want to support PPMD method in AMSI-C .7z decoder.
+
+
 C++ LZMA Encoder/Decoder
 ~~~~~~~~~~~~~~~~~~~~~~~~
 C++ LZMA code use COM-like interfaces. So if you want to use it,