freebsd-dev/stand/uboot/lib
Ian Lepore 5a75fc4b11 Make uboot_devdesc properly alias disk_devdesc, so that parsing the u-boot
loaderdev variable works correctly.

The uboot_devdesc struct is variously cast back and forth between
uboot_devdesc and disk_devdesc as pointers are handed off through various
opaque interfaces.  uboot_devdesc attempted to mimic the layout of
disk_devdesc by having a devdesc struct, followed by a union of some
device-specific stuff that included a struct that contains the same fields
as a disk_devdesc.  However, one of those fields inside the struct is 64-bit
which causes the entire union to be 64-bit aligned -- 32 bits of padding
is added between the struct devdesc and the union, so the whole mess ends
up NOT properly mimicking a disk_devdesc after all.  (In disk_devdesc there
is also 32 bits of padding, but it shows up immediately before the d_offset
field, rather than before the whole collection of d_* fields.)

This fixes the problem by using an anonymous union to overlay the devdesc
field uboot network devices need with the disk_devdesc that uboot storage
devices need.  This is a different solution than the one contributed with
the PR (so if anything goes wrong, the blame goes to me), but 95% of the
credit for this fix goes to Pawel Worach and Manuel Stuhn who analyzed the
problem and proposed a fix.

PR:		233097
2019-02-18 04:44:52 +00:00
..
api_public.h
console.c
copy.c The libstand's panic() appends its own '\n' to the message, so that users of the API 2018-11-29 18:37:48 +00:00
devicename.c Remove d_type from devdesc. It's not needed as we can fetch it from 2018-03-12 21:39:59 +00:00
disk.c Use the actual struct devdesc at the start of all *_devdesc structs 2018-03-12 21:39:49 +00:00
elf_freebsd.c Prefer uintXX_t to u_intXX_t 2018-03-13 16:33:00 +00:00
glue.c Tag unreachable places as such. I left the while (1); in place since 2018-01-26 22:22:21 +00:00
glue.h Now that exit is __dead2, we need to tag ub_exit() as __dead2. To do 2018-01-26 21:50:59 +00:00
libuboot.h Make uboot_devdesc properly alias disk_devdesc, so that parsing the u-boot 2019-02-18 04:44:52 +00:00
Makefile Eliminate bsd.stand.mk and -fPIC 32-bit intel builds 2018-02-16 00:17:32 +00:00
module.c
net.c The libstand's panic() appends its own '\n' to the message, so that users of the API 2018-11-29 18:37:48 +00:00
reboot.c
time.c