Pass structs by reference if you expect the callee to modify them.
authorSimon Schubert <corecode@dragonflybsd.org>
Mon, 22 Jan 2007 19:37:05 +0000 (19:37 +0000)
committerSimon Schubert <corecode@dragonflybsd.org>
Mon, 22 Jan 2007 19:37:05 +0000 (19:37 +0000)
commitc7eb058947eaf16922ece8a4cee2026c9b8fb2fa
tree42f4731f3dd0b98271b8f486aab66eaf199791b5
parentc7401c3b80412c359ed8b5e013193d26246297d2
Pass structs by reference if you expect the callee to modify them.

This fixes kernel boot with gcc41.  The gpfault people were seeing comes from
vm86_bioscall() in init386().  The cause is that the assembler code passes the
struct vm86frame by value, i.e. simply creating it on the stack.  This worked
up to gcc34, but gcc41 now optimizes stores to unused memory locations away,
whis is allowed per the standards.  This led to an uninitialized stack frame
which in turn panicked the box.

Oooohh...-please-commit-by: dillon@
15 files changed:
sys/cpu/i386/include/cpu.h
sys/kern/kern_intr.c
sys/kern/lwkt_ipiq.c
sys/platform/pc32/apic/apic_vector.s
sys/platform/pc32/apic/apicvar.h
sys/platform/pc32/i386/exception.s
sys/platform/pc32/i386/trap.c
sys/platform/pc32/i386/vm86.c
sys/platform/pc32/i386/vm86bios.s
sys/platform/pc32/icu/icu_vector.s
sys/platform/pc32/isa/ipl.s
sys/platform/vkernel/i386/fork_tramp.s
sys/platform/vkernel/i386/trap.c
sys/platform/vkernel/include/md_var.h
sys/sys/thread.h