Hello ?ukasz Dmitrowski,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/flashrom/+/34363
to review the following change.
Change subject: libflashrom: add querying functions with meson integration ......................................................................
libflashrom: add querying functions with meson integration
Work based on lukasz.dmitrowski@gmail.com code
Change-Id: I49041b8fa5700dabe59fef0d2337339d34cd6c6f Signed-off-by: Artur Raglis artur.raglis@3mdeb.com Signed-off-by: Lukasz Dmitrowski lukasz.dmitrowski@gmail.com --- M libflashrom.c M libflashrom.h M libflashrom.map M meson.build 4 files changed, 187 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/63/34363/1
diff --git a/libflashrom.c b/libflashrom.c index f90a22c..cc26835 100644 --- a/libflashrom.c +++ b/libflashrom.c @@ -103,7 +103,142 @@ * @{ */
-/* TBD */ +/** + * @brief Returns flashrom version + * @return Flashrom version + */ +const char *flashrom_version_info(void) +{ + return flashrom_version; +} + +/** + * @brief Returns list of supported programmers + * @return List of supported programmers + */ +const char **flashrom_supported_programmers(void) +{ + enum programmer p = 0; + const char **supported_programmers = NULL; + supported_programmers = malloc((PROGRAMMER_INVALID + 1) * sizeof(char*)); + + if (supported_programmers != NULL) { + for (; p < PROGRAMMER_INVALID; ++p) { + supported_programmers[p] = programmer_table[p].name; + } + } else { + msg_gerr("Memory allocation error!\n"); + } + + return supported_programmers; +} + +/** + * @brief Returns list of supported flash chips + * @return List of supported flash chips + */ +flashrom_flashchip_info *flashrom_supported_flash_chips(void) +{ + int i = 0; + flashrom_flashchip_info *supported_flashchips = malloc(flashchips_size * sizeof(flashrom_flashchip_info)); + + if (supported_flashchips != NULL) { + for (; i < flashchips_size; ++i) { + supported_flashchips[i].vendor = flashchips[i].vendor; + supported_flashchips[i].name = flashchips[i].name; + supported_flashchips[i].tested.erase = (flashrom_test_state) flashchips[i].tested.erase; + supported_flashchips[i].tested.probe = (flashrom_test_state) flashchips[i].tested.probe; + supported_flashchips[i].tested.read = (flashrom_test_state) flashchips[i].tested.read; + supported_flashchips[i].tested.write = (flashrom_test_state) flashchips[i].tested.write; + supported_flashchips[i].total_size = flashchips[i].total_size; + } + } else { + msg_gerr("Memory allocation error!\n"); + } + + return supported_flashchips; +} + +/** + * @brief Returns list of supported mainboards + * @return List of supported mainboards + */ +flashrom_board_info *flashrom_supported_boards(void) +{ + int boards_known_size = 0; + int i = 0; + const struct board_info *binfo = boards_known; + + while ((binfo++)->vendor) + ++boards_known_size; + binfo = boards_known; + /* add place for {0} */ + ++boards_known_size; + + flashrom_board_info *supported_boards = malloc(boards_known_size * sizeof(flashrom_board_info)); + + if (supported_boards != NULL) { + for (; i < boards_known_size; ++i) { + supported_boards[i].vendor = binfo[i].vendor; + supported_boards[i].name = binfo[i].name; + supported_boards[i].working = binfo[i].working; + } + } else { + msg_gerr("Memory allocation error!\n"); + } + + return supported_boards; +} + +/** + * @brief Returns list of supported chipsets + * @return List of supported chipsets + */ +flashrom_chipset_info *flashrom_supported_chipsets(void) +{ + int chipset_enables_size = 0; + int i = 0; + const struct penable *chipset = chipset_enables; + + while ((chipset++)->vendor_name) + ++chipset_enables_size; + chipset = chipset_enables; + /* add place for {0}*/ + ++chipset_enables_size; + + flashrom_chipset_info *supported_chipsets = malloc(chipset_enables_size * sizeof(flashrom_chipset_info)); + + if (supported_chipsets != NULL) { + for (; i < chipset_enables_size; ++i) { + supported_chipsets[i].vendor = chipset[i].vendor_name; + supported_chipsets[i].chipset = chipset[i].device_name; + supported_chipsets[i].vendor_id = chipset[i].vendor_id; + supported_chipsets[i].chipset_id = chipset[i].device_id; + supported_chipsets[i].status = chipset[i].status; + } + } else { + msg_gerr("Memory allocation error!\n"); + } + + return supported_chipsets; +} + +/** + * @brief Frees memory allocated by libflashrom API + * @param Pointer to block of memory which should be freed + * @return 0 on success + * 1 on null pointer error + */ +int flashrom_data_free(void *const p) +{ + if (!p) { + msg_gerr("flashrom_data_free - Null pointer!\n"); + return 1; + } else { + free(p); + return 0; + } +}
/** @} */ /* end flashrom-query */
diff --git a/libflashrom.h b/libflashrom.h index 38c95d2..ebba16b 100644 --- a/libflashrom.h +++ b/libflashrom.h @@ -37,6 +37,50 @@ typedef int(flashrom_log_callback)(enum flashrom_log_level, const char *format, va_list); void flashrom_set_log_callback(flashrom_log_callback *);
+/** @ingroup flashrom-query */ +typedef enum { + FLASHROM_TESTED_OK = 0, + FLASHROM_TESTED_NT = 1, + FLASHROM_TESTED_BAD = 2, + FLASHROM_TESTED_DEP = 3, + FLASHROM_TESTED_NA = 4, +} flashrom_test_state; + +typedef struct flashrom_flashchip_info { + const char *vendor; + const char *name; + unsigned int total_size; + struct flashrom_tested { + flashrom_test_state probe; + flashrom_test_state read; + flashrom_test_state erase; + flashrom_test_state write; + } tested; +} flashrom_flashchip_info; + +typedef struct flashrom_board_info { + const char *vendor; + const char *name; + flashrom_test_state working; +} flashrom_board_info; + +typedef struct flashrom_chipset_info { + const char *vendor; + const char *chipset; + uint16_t vendor_id; + uint16_t chipset_id; + flashrom_test_state status; +} flashrom_chipset_info; + +const char *flashrom_version_info(void); +void flashrom_system_info(void); +const char **flashrom_supported_programmers(void); +flashrom_flashchip_info *flashrom_supported_flash_chips(void); +flashrom_board_info *flashrom_supported_boards(void); +flashrom_chipset_info *flashrom_supported_chipsets(void); +int flashrom_data_free(void *const p); + +/** @ingroup flashrom-prog */ struct flashrom_programmer; int flashrom_programmer_init(struct flashrom_programmer **, const char *prog_name, const char *prog_params); int flashrom_programmer_shutdown(struct flashrom_programmer *); diff --git a/libflashrom.map b/libflashrom.map index 3c287ff..d6dd24d 100644 --- a/libflashrom.map +++ b/libflashrom.map @@ -1,7 +1,11 @@ LIBFLASHROM_1.0 { global: + flashrom_board_info; + flashrom_chipset_info; + flashrom_data_free; flashrom_flag_get; flashrom_flag_set; + flashrom_flashchip_info; flashrom_flash_erase; flashrom_flash_getsize; flashrom_flash_probe; @@ -20,5 +24,8 @@ flashrom_programmer_shutdown; flashrom_set_log_callback; flashrom_shutdown; + flashrom_supported_programmers; + flashrom_system_info; + flashrom_version_info; local: *; }; diff --git a/meson.build b/meson.build index 1923fdf..00f4a2f 100644 --- a/meson.build +++ b/meson.build @@ -68,8 +68,6 @@ srcs = []
need_libusb0 = false -need_raw_access = false -need_serial = false
# check for required symbols if cc.has_function('clock_gettime')
Michał Żygowski has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 1:
Copy of https://github.com/flashrom/flashrom/pull/85
Hello ?ukasz Dmitrowski, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/34363
to look at the new patch set (#2).
Change subject: libflashrom: add querying functions with meson integration ......................................................................
libflashrom: add querying functions with meson integration
Work based on lukasz.dmitrowski@gmail.com code
Change-Id: I49041b8fa5700dabe59fef0d2337339d34cd6c6f Signed-off-by: Artur Raglis artur.raglis@3mdeb.com Signed-off-by: Lukasz Dmitrowski lukasz.dmitrowski@gmail.com --- M libflashrom.c M libflashrom.h M libflashrom.map 3 files changed, 187 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/63/34363/2
Mario Limonciello has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 2:
Ping, can someone review this? It's one of the remaining items blocking turning on flashrom support by default in fwupd.
Michał Żygowski has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 2:
David, Felix could you look please at this change? It is required for proper integration of flashrom with fwupd
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 2: Code-Review+1
(1 comment)
Looks good to me, I'm just wondering if flashrom_data_free() is needed.
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.c File libflashrom.c:
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.c@233 PS2, Line 233: int flashrom_data_free(void *const p) Do you really need this function? free()'ing NULL is a valid noop (https://pubs.opengroup.org/onlinepubs/009695399/functions/free.html)
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 2:
(2 comments)
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.c File libflashrom.c:
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.c@109 PS2, Line 109: Flashrom flashrom in lowercase
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.c@116 PS2, Line 116: /** : * @brief Returns list of supported programmers : * @return List of supported programmers : */ I don't think the two lines in this comment should say the same. What does this function return when malloc() fails?
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 2: Code-Review-1
(3 comments)
I missed these.
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.h File libflashrom.h:
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.h@41 PS2, Line 41: typedef Oh no, typedefs
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.h@49 PS2, Line 49: typedef There's more! O_o
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.h@53 PS2, Line 53: struct flashrom_tested { : flashrom_test_state probe; : flashrom_test_state read; : flashrom_test_state erase; : flashrom_test_state write; : } tested; enums on structs?
David Hendricks has uploaded a new patch set (#3) to the change originally created by Michał Żygowski. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
libflashrom: add querying functions with meson integration
Work based on lukasz.dmitrowski@gmail.com code
Change-Id: I49041b8fa5700dabe59fef0d2337339d34cd6c6f Signed-off-by: Artur Raglis artur.raglis@3mdeb.com Signed-off-by: Lukasz Dmitrowski lukasz.dmitrowski@gmail.com Signed-off-by: David Hendricks david.hendricks@gmail.com --- M libflashrom.c M libflashrom.h M libflashrom.map 3 files changed, 193 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/63/34363/3
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 3:
(6 comments)
In the interest of time, I went ahead and made some minor changes based on Angel's comments. I'm not sure what is the right thing to do with flashrom_data_free(), though.
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.h File libflashrom.h:
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.h@41 PS2, Line 41: typedef
Oh no, typedefs
Agreed, I prefer not to use typedefs unless they're really needed. So I got rid of 'em.
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.h@49 PS2, Line 49: typedef
There's more! O_o
Done
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.h@53 PS2, Line 53: struct flashrom_tested { : flashrom_test_state probe; : flashrom_test_state read; : flashrom_test_state erase; : flashrom_test_state write; : } tested;
enums on structs?
This is the same as in flash.h...
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.c File libflashrom.c:
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.c@109 PS2, Line 109: Flashrom
flashrom in lowercase
Done
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.c@116 PS2, Line 116: /** : * @brief Returns list of supported programmers : * @return List of supported programmers : */
I don't think the two lines in this comment should say the same. […]
Fixed here, and other instances.
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.c@233 PS2, Line 233: int flashrom_data_free(void *const p)
Do you really need this function? free()'ing NULL is a valid noop (https://pubs.opengroup. […]
On second thought, it's probably good to have this function in the API. However I wonder if p == NULL should really be considered an error. Thoughts?
David Hendricks has uploaded a new patch set (#4) to the change originally created by Michał Żygowski. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
libflashrom: add querying functions with meson integration
Work based on lukasz.dmitrowski@gmail.com code
Change-Id: I49041b8fa5700dabe59fef0d2337339d34cd6c6f Signed-off-by: Artur Raglis artur.raglis@3mdeb.com Signed-off-by: Lukasz Dmitrowski lukasz.dmitrowski@gmail.com Signed-off-by: David Hendricks david.hendricks@gmail.com --- M libflashrom.c M libflashrom.h M libflashrom.map 3 files changed, 193 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/63/34363/4
Michał Żygowski has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 4:
Thank you David. I will get more info about the remaining issues soon from the author of the change. Will upload a new patchset as soon as possible.
Hello David Hendricks, Piotr Król, Felix Held, Angel Pons, ?ukasz Dmitrowski, David Hendricks, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/34363
to look at the new patch set (#5).
Change subject: libflashrom: add querying functions with meson integration ......................................................................
libflashrom: add querying functions with meson integration
Work based on lukasz.dmitrowski@gmail.com code
Change-Id: I49041b8fa5700dabe59fef0d2337339d34cd6c6f Signed-off-by: Artur Raglis artur.raglis@3mdeb.com Signed-off-by: Lukasz Dmitrowski lukasz.dmitrowski@gmail.com Signed-off-by: David Hendricks david.hendricks@gmail.com --- M libflashrom.c M libflashrom.h M libflashrom.map 3 files changed, 187 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/63/34363/5
Michał Żygowski has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.c File libflashrom.c:
https://review.coreboot.org/c/flashrom/+/34363/2/libflashrom.c@233 PS2, Line 233: int flashrom_data_free(void *const p)
On second thought, it's probably good to have this function in the API. […]
I have removed the check for a null pointer because it is simply adding a dummy code.
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 5: Code-Review+2
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 5:
Please wait a day or two before merging this in case other reviewers have additional feedback.
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 5:
Michał - Was there anything else to be done in this patch? You should be able to merge it now, or I can do it tomorrow.
Michał Żygowski has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 5:
Patch Set 5:
Michał - Was there anything else to be done in this patch? You should be able to merge it now, or I can do it tomorrow.
No, there wasn't. I do not have the permissions to submit changes yet, so I have to rely on you David, in this matter. We can merge for sure.
David Hendricks has submitted this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
libflashrom: add querying functions with meson integration
Work based on lukasz.dmitrowski@gmail.com code
Change-Id: I49041b8fa5700dabe59fef0d2337339d34cd6c6f Signed-off-by: Artur Raglis artur.raglis@3mdeb.com Signed-off-by: Lukasz Dmitrowski lukasz.dmitrowski@gmail.com Signed-off-by: David Hendricks david.hendricks@gmail.com Reviewed-on: https://review.coreboot.org/c/flashrom/+/34363 Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M libflashrom.c M libflashrom.h M libflashrom.map 3 files changed, 187 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified David Hendricks: Looks good to me, approved
diff --git a/libflashrom.c b/libflashrom.c index af62002..dbc5129 100644 --- a/libflashrom.c +++ b/libflashrom.c @@ -104,7 +104,142 @@ * @{ */
-/* TBD */ +/** + * @brief Returns flashrom version + * @return flashrom version + */ +const char *flashrom_version_info(void) +{ + return flashrom_version; +} + +/** + * @brief Returns list of supported programmers + * @return List of supported programmers, or NULL if an error occurred + */ +const char **flashrom_supported_programmers(void) +{ + enum programmer p = 0; + const char **supported_programmers = malloc((PROGRAMMER_INVALID + 1) * sizeof(char*)); + + if (supported_programmers != NULL) { + for (; p < PROGRAMMER_INVALID; ++p) { + supported_programmers[p] = programmer_table[p].name; + } + } else { + msg_gerr("Memory allocation error!\n"); + } + + return supported_programmers; +} + +/** + * @brief Returns list of supported flash chips + * @return List of supported flash chips, or NULL if an error occurred + */ +struct flashrom_flashchip_info *flashrom_supported_flash_chips(void) +{ + int i = 0; + struct flashrom_flashchip_info *supported_flashchips = + malloc(flashchips_size * sizeof(*supported_flashchips)); + + if (supported_flashchips != NULL) { + for (; i < flashchips_size; ++i) { + supported_flashchips[i].vendor = flashchips[i].vendor; + supported_flashchips[i].name = flashchips[i].name; + supported_flashchips[i].tested.erase = + (enum flashrom_test_state)flashchips[i].tested.erase; + supported_flashchips[i].tested.probe = + (enum flashrom_test_state)flashchips[i].tested.probe; + supported_flashchips[i].tested.read = + (enum flashrom_test_state)flashchips[i].tested.read; + supported_flashchips[i].tested.write = + (enum flashrom_test_state)flashchips[i].tested.write; + supported_flashchips[i].total_size = flashchips[i].total_size; + } + } else { + msg_gerr("Memory allocation error!\n"); + } + + return supported_flashchips; +} + +/** + * @brief Returns list of supported mainboards + * @return List of supported mainboards, or NULL if an error occurred + */ +struct flashrom_board_info *flashrom_supported_boards(void) +{ + int boards_known_size = 0; + int i = 0; + const struct board_info *binfo = boards_known; + + while ((binfo++)->vendor) + ++boards_known_size; + binfo = boards_known; + /* add place for {0} */ + ++boards_known_size; + + struct flashrom_board_info *supported_boards = + malloc(boards_known_size * sizeof(*binfo)); + + if (supported_boards != NULL) { + for (; i < boards_known_size; ++i) { + supported_boards[i].vendor = binfo[i].vendor; + supported_boards[i].name = binfo[i].name; + supported_boards[i].working = binfo[i].working; + } + } else { + msg_gerr("Memory allocation error!\n"); + } + + return supported_boards; +} + +/** + * @brief Returns list of supported chipsets + * @return List of supported chipsets, or NULL if an error occurred + */ +struct flashrom_chipset_info *flashrom_supported_chipsets(void) +{ + int chipset_enables_size = 0; + int i = 0; + const struct penable *chipset = chipset_enables; + + while ((chipset++)->vendor_name) + ++chipset_enables_size; + chipset = chipset_enables; + /* add place for {0}*/ + ++chipset_enables_size; + + struct flashrom_chipset_info *supported_chipsets = + malloc(chipset_enables_size * sizeof(*supported_chipsets)); + + if (supported_chipsets != NULL) { + for (; i < chipset_enables_size; ++i) { + supported_chipsets[i].vendor = chipset[i].vendor_name; + supported_chipsets[i].chipset = chipset[i].device_name; + supported_chipsets[i].vendor_id = chipset[i].vendor_id; + supported_chipsets[i].chipset_id = chipset[i].device_id; + supported_chipsets[i].status = chipset[i].status; + } + } else { + msg_gerr("Memory allocation error!\n"); + } + + return supported_chipsets; +} + +/** + * @brief Frees memory allocated by libflashrom API + * @param Pointer to block of memory which should be freed + * @return 0 on success + */ +int flashrom_data_free(void *const p) +{ + free(p); + return 0; +}
/** @} */ /* end flashrom-query */
diff --git a/libflashrom.h b/libflashrom.h index 38c95d2..a0da6df 100644 --- a/libflashrom.h +++ b/libflashrom.h @@ -37,6 +37,50 @@ typedef int(flashrom_log_callback)(enum flashrom_log_level, const char *format, va_list); void flashrom_set_log_callback(flashrom_log_callback *);
+/** @ingroup flashrom-query */ +enum flashrom_test_state { + FLASHROM_TESTED_OK = 0, + FLASHROM_TESTED_NT = 1, + FLASHROM_TESTED_BAD = 2, + FLASHROM_TESTED_DEP = 3, + FLASHROM_TESTED_NA = 4, +}; + +struct flashrom_flashchip_info { + const char *vendor; + const char *name; + unsigned int total_size; + struct flashrom_tested { + enum flashrom_test_state probe; + enum flashrom_test_state read; + enum flashrom_test_state erase; + enum flashrom_test_state write; + } tested; +}; + +struct flashrom_board_info { + const char *vendor; + const char *name; + enum flashrom_test_state working; +}; + +struct flashrom_chipset_info { + const char *vendor; + const char *chipset; + uint16_t vendor_id; + uint16_t chipset_id; + enum flashrom_test_state status; +}; + +const char *flashrom_version_info(void); +void flashrom_system_info(void); +const char **flashrom_supported_programmers(void); +struct flashrom_flashchip_info *flashrom_supported_flash_chips(void); +struct flashrom_board_info *flashrom_supported_boards(void); +struct flashrom_chipset_info *flashrom_supported_chipsets(void); +int flashrom_data_free(void *const p); + +/** @ingroup flashrom-prog */ struct flashrom_programmer; int flashrom_programmer_init(struct flashrom_programmer **, const char *prog_name, const char *prog_params); int flashrom_programmer_shutdown(struct flashrom_programmer *); diff --git a/libflashrom.map b/libflashrom.map index 3c287ff..d6dd24d 100644 --- a/libflashrom.map +++ b/libflashrom.map @@ -1,7 +1,11 @@ LIBFLASHROM_1.0 { global: + flashrom_board_info; + flashrom_chipset_info; + flashrom_data_free; flashrom_flag_get; flashrom_flag_set; + flashrom_flashchip_info; flashrom_flash_erase; flashrom_flash_getsize; flashrom_flash_probe; @@ -20,5 +24,8 @@ flashrom_programmer_shutdown; flashrom_set_log_callback; flashrom_shutdown; + flashrom_supported_programmers; + flashrom_system_info; + flashrom_version_info; local: *; };
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 6:
I guess this is related: https://paste.flashrom.org/view.php?id=3225
Michał Żygowski has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 6:
Thanks Nico, I will look at it and push necessary fix
Michał Żygowski has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 6:
Nico any information on the environment for reproduction?
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 6:
Nico any information on the environment for reproduction?
A little hidden, the paste says:
Board: build error on raspberry pi
I can also reproduce the issue on anything but x86 and mipsel. The problem is that board/chipset_enable simply don't exist on other architectures.
For build testing I use manibuilder[1]. It uses Docker images to test a lot of systems. Alas, it's just rotting on Gerrit, review welcome!
[1] https://review.coreboot.org/c/flashrom/+/23005/ It comes with a README :)
Attention is currently required from: Michał Żygowski. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34363 )
Change subject: libflashrom: add querying functions with meson integration ......................................................................
Patch Set 6:
(1 comment)
File libflashrom.h:
https://review.coreboot.org/c/flashrom/+/34363/comment/73057784_6c695d40 PS6, Line 77: const char **flashrom_supported_programmers(void); I don't understand this API. How is the caller supposed to know the length of the array?