All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v8 0/2] Implement Hex file loader and add test case
@ 2018-05-15  1:45 Su Hang
  2018-05-15  1:45 ` [Qemu-devel] [PATCH v8 1/2] Implement .hex file loader Su Hang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Su Hang @ 2018-05-15  1:45 UTC (permalink / raw)
  To: stefanha, jim, joel; +Cc: qemu-devel

These series of patchs implement Intel Hexadecimal File loader and
add QTest testcase to verify the correctness of Loader.

v1:
--  Basic version.

v2:
--  Replace `do{}while(cond);` block with `for(;;)` block.

v3:
--  Add two new files information in MAINTAINERS.

v4:
--  Correct the 'test.hex' path in hexloader-test.c.

v5:
--  Split huge parse_hex_blob() function into four small function;
--  Add check for memory bounds;
--  Check validation for Record type;
--  Replace function ctoh() with glib function g_ascii_xdigit_value();
--  Remove check for '.hex' suffix;
--  Remove unnecessary type cast;
--  Remove duplicate zero-initialization;
--  Correct typos;

v6:
--  Call Intel HEX loader after load_uimage_as();
--  Remove use of KERNEL_LOAD_ADDR;
--  Change (hwaddr) type argument to (hwaddr *) type;
--  Use new struct HexParser to contain all arguments needed by
        handle_record_type();
--  Enable discontiguous data records (again);
--  Remove unnecessary memory clean: bin_buf and HexLine line;
--  Correct typo;
--  Remove unnecessary check for hex file size;
--  Add entry point handle for START_SEG_ADDR_RECORD and
        START_LINEAR_ADDR_RECORD record type;
--  Use hwaddr * type to store entry point;

v7:
--  Remove unnecessary code style changes;
--  Replace `bool` with `size_t` for function `parse_record` return type;
--  Replace `int` with `size_t` for struct `HexParser` member field
        `total_size` type;
--  Replace `int` with `size_t` for function `handle_record_type` return type;
--  Return an error when encountered unimplemented data type
        `START_SEG_ADDR_RECORD`;
--  Add check for `START_LINEAR_ADDR_RECORD` data type:
        byte_count == 4 and address == 0;
--  Rename struct `HexParser` member field `addr` to `start_addr`;
--  Replace `int` with `size_t` for function `parse_hex_blob` return type;
--  Stop incrementing `record_index` when encountered whitespace;
--  Replace
    `if ((record_index >> 1) - LEN_EXCEPT_DATA != parser.line.byte_count)`
    with
    `if ((LEN_EXCEPT_DATA + parser.line.byte_count) * 2 != record_index)`
--  Remove unused field `max_sz`;
--  Replace `int` with `size_t` for local variable `total_size`
        in function `parse_hex_blob`
--  Rename function `load_image_targphys_hex_as` argument `addr` to `entry`;

v8:
--  Discard change in code logic: Stop attempting load 32-bit kernel after
        failed to load 64-bit kernel image;
--  Rename function name `load_image_targphys_hex_as` to `load_targphys_hex_as`
        in comment;
--  Correct grammatical errors in comments;
--  Drop non-exist argument description in comment;
--  Drop macro function `rom_add_hex_blob_as`, replace it with
        `rom_add_blob_fixed_as`, because they are equivalent;


Su Hang (2):
  Implement .hex file loader
  Add QTest testcase for the Intel Hexadecimal Object File Loader.

 MAINTAINERS                          |   6 +
 hw/arm/boot.c                        |   7 +-
 hw/core/loader.c                     | 246 +++++++++++++++++++++++++++++++++++
 include/hw/loader.h                  |  12 ++
 tests/Makefile.include               |   2 +
 tests/hex-loader-check-data/test.hex |  12 ++
 tests/hexloader-test.c               |  56 ++++++++
 7 files changed, 340 insertions(+), 1 deletion(-)
 create mode 100644 tests/hex-loader-check-data/test.hex
 create mode 100644 tests/hexloader-test.c

--
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH v8 0/2] Implement Hex file loader and add test case
@ 2018-05-11  5:53 Su Hang
  2018-05-11  5:53 ` [Qemu-devel] [PATCH v8 2/2] Add QTest testcase for the Intel Hexadecimal Object File Loader Su Hang
  0 siblings, 1 reply; 7+ messages in thread
From: Su Hang @ 2018-05-11  5:53 UTC (permalink / raw)
  To: stefanha, jim, joel; +Cc: qemu-devel

These series of patchs implement Intel Hexadecimal File loader and
add QTest testcase to verify the correctness of Loader.

v1:
--  Basic version.

v2:
--  Replace `do{}while(cond);` block with `for(;;)` block.

v3:
--  Add two new files information in MAINTAINERS.

v4:
--  Correct the 'test.hex' path in hexloader-test.c.

v5:
--  Split huge parse_hex_blob() function into four small function;
--  Add check for memory bounds;
--  Check validation for Record type;
--  Replace function ctoh() with glib function g_ascii_xdigit_value();
--  Remove check for '.hex' suffix;
--  Remove unnecessary type cast;
--  Remove duplicate zero-initialization;
--  Correct typos;

v6:
--  Call Intel HEX loader after load_uimage_as();
--  Remove use of KERNEL_LOAD_ADDR;
--  Change (hwaddr) type argument to (hwaddr *) type;
--  Use new struct HexParser to contain all arguments needed by
        handle_record_type();
--  Enable discontiguous data records (again);
--  Remove unnecessary memory clean: bin_buf and HexLine line;
--  Correct typo;
--  Remove unnecessary check for hex file size;
--  Add entry point handle for START_SEG_ADDR_RECORD and
        START_LINEAR_ADDR_RECORD record type;
--  Use hwaddr * type to store entry point;

v7:
--  Remove unnecessary code style changes;
--  Replace `bool` with `size_t` for function `parse_record` return type;
--  Replace `int` with `size_t` for struct `HexParser` member field
        `total_size` type;
--  Replace `int` with `size_t` for function `handle_record_type` return type;
--  Return an error when encountered unimplemented data type
        `START_SEG_ADDR_RECORD`;
--  Add check for `START_LINEAR_ADDR_RECORD` data type:
        byte_count == 4 and address == 0;
--  Rename struct `HexParser` member field `addr` to `start_addr`;
--  Replace `int` with `size_t` for function `parse_hex_blob` return type;
--  Stop incrementing `record_index` when encountered whitespace;
--  Replace
    `if ((record_index >> 1) - LEN_EXCEPT_DATA != parser.line.byte_count)`
    with
    `if ((LEN_EXCEPT_DATA + parser.line.byte_count) * 2 != record_index)`
--  Remove unused field `max_sz`;
--  Replace `int` with `size_t` for local variable `total_size`
        in function `parse_hex_blob`
--  Rename function `load_image_targphys_hex_as` argument `addr` to `entry`;

v8:
--  Discard change in code logic: Stop attempting load 32-bit kernel after
        failed to load 64-bit kernel image;
--  Rename function name `load_image_targphys_hex_as` to `load_targphys_hex_as`
        in comment;
--  Correct grammatical errors in comments;
--  Drop non-exist argument description in comment;
--  Drop macro function `rom_add_hex_blob_as`, replace it with
        `rom_add_blob_fixed_as`, because they are equivalent;


Su Hang (2):
  Implement .hex file loader
  Add QTest testcase for the Intel Hexadecimal Object File Loader.

 MAINTAINERS                          |   6 +
 hw/arm/boot.c                        |   7 +-
 hw/core/loader.c                     | 246 +++++++++++++++++++++++++++++++++++
 include/hw/loader.h                  |  12 ++
 tests/Makefile.include               |   2 +
 tests/hex-loader-check-data/test.hex |  12 ++
 tests/hexloader-test.c               |  56 ++++++++
 7 files changed, 340 insertions(+), 1 deletion(-)
 create mode 100644 tests/hex-loader-check-data/test.hex
 create mode 100644 tests/hexloader-test.c

--
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-05-15 10:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-15  1:45 [Qemu-devel] [PATCH v8 0/2] Implement Hex file loader and add test case Su Hang
2018-05-15  1:45 ` [Qemu-devel] [PATCH v8 1/2] Implement .hex file loader Su Hang
2018-05-15 10:04   ` Stefan Hajnoczi
2018-05-15  1:45 ` [Qemu-devel] [PATCH v8 2/2] Add QTest testcase for the Intel Hexadecimal Object File Loader Su Hang
2018-05-15 10:05   ` Stefan Hajnoczi
2018-05-15 10:07 ` [Qemu-devel] [PATCH v8 0/2] Implement Hex file loader and add test case Stefan Hajnoczi
  -- strict thread matches above, loose matches on Subject: below --
2018-05-11  5:53 Su Hang
2018-05-11  5:53 ` [Qemu-devel] [PATCH v8 2/2] Add QTest testcase for the Intel Hexadecimal Object File Loader Su Hang

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.