freebsd-dev/sys/boot/uboot/lib
Maxim Sobolev 15e862e33c Provide bug4bug workaround for certain dumbiness of the u-boot's API_env_enum
function, which is expected to set returned env to NULL upon reaching the end
of the environment list but fails to do so in certain cases. The respective
u-boot code looks like the following (HEAD at the time of this commit):

--- api.c ---
 496 static int API_env_enum(va_list ap)
 ...
 510                 *next = last;
 511
 512                 for (i = 0; env_get_char(i) != '\0'; i = n + 1) {
 513                         for (n = i; env_get_char(n) != '\0'; ++n) {
 514                                 if (n >= CONFIG_ENV_SIZE) {
 515                                         /* XXX shouldn't we set *next = NULL?? */
 516                                         return 0;
 517                                 }
 518                         }
-------------

The net result is that any unfortunate user of the loader's ub_env_enum()
function hitting this condition would be trapped in the infinite loop, as
the main use pattern of ub_env_enum() is basically the following:

while ((env = ub_env_enum(env)) != NULL) { DO STUFF }

Which would stuck forever with the last element.
2015-06-19 22:24:58 +00:00
..
api_public.h Enhance the mechanism that lets you configure the ubldr boot device by 2014-03-11 22:02:49 +00:00
console.c
copy.c Fix bug in the ubldr introduced in the rev.283035. The new code 2015-06-19 17:00:36 +00:00
devicename.c Use disk_fmtdev() and disk_parsedev() functions from the new DISK API. 2012-09-09 11:32:06 +00:00
disk.c Enhance the mechanism that lets you configure the ubldr boot device by 2014-03-11 22:02:49 +00:00
elf_freebsd.c An ARM kernel can be loaded at any 2MB boundary, make ubldr aware of that. 2015-05-17 19:59:05 +00:00
glue.c Provide bug4bug workaround for certain dumbiness of the u-boot's API_env_enum 2015-06-19 22:24:58 +00:00
glue.h Fix fdt_platform_fixups() mem region handling. It turns out u-boot puts 2015-03-17 21:15:24 +00:00
libuboot.h An ARM kernel can be loaded at any 2MB boundary, make ubldr aware of that. 2015-05-17 19:59:05 +00:00
Makefile Move the definitions of the fdt functions from a uboot header to a new fdt 2014-11-01 10:50:18 +00:00
module.c Print error message if autoload fails due to missing DTB blob, otherwise 2015-05-26 20:32:14 +00:00
net.c Add a routine to obtain netboot parameters from the U-Boot env vars. Call 2015-05-18 16:12:41 +00:00
reboot.c
time.c