Commit Graph

8 Commits

Author SHA1 Message Date
Andreas Färber
c3b33b6610 Introduce forth_init() for trampoline initialization
Use init_trampoline() for trampoline variable initialization.

Add calls to a new forth_init() function for each architecture
to invoke it. Idea courtesy of Blue.

This fixes ppc64 compilation by avoiding a casted self-reference.

v2:
* Share init_trampoline() with kernel/bootstrap.c, suggested by Mark.
* Adopt QEMU coding style for new functions.

Cc: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Acked-by: Blue Swirl <blauwirbel@gmail.com>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@954 f158a5a8-5612-0410-a976-696ce0be7e32
2010-11-13 13:04:34 +00:00
Andreas Färber
5131e8c560 Convert cell2pointer() and pointer2cell() macros to inline functions
Inline functions suggested by Blue.

Use const void* for pointer2cell() due to const char* arguments.

Fix a misuse of pointer2cell().

Drop comment on reusing different host bitness code path;
any special handling for different target bitnesses should go
into these new functions.

v2:
* Use QEMU-style indentation for new inline functions.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@951 f158a5a8-5612-0410-a976-696ce0be7e32
2010-11-09 22:50:48 +00:00
Andreas Färber
52d7516592 Partially revert r917: Leave bootstrap functionality in kernel/cross.h
The base_address for native bitwidth smaller than host bitwidth
is available only in kernel/bootstrap.c and thus cannot be used
elsewhere.

The bitwidth equality code path will have to be enhanced
for different cell sizes instead.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@939 f158a5a8-5612-0410-a976-696ce0be7e32
2010-10-31 16:37:33 +00:00
Andreas Färber
e9b37f6048 ppc64: Quickfix for pointer2cell() and cell2pointer()
Add a uintptr_t cast as an interim solution to resolve errors for ppc64,
where pointer size is larger than cell size.

v2:
* Add comment on potential better fix.
  Postpone potential conversion to inline function until investigated.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@931 f158a5a8-5612-0410-a976-696ce0be7e32
2010-10-30 16:15:17 +00:00
Andreas Färber
fbfaaa780f Move cell2pointer and pointer2cell macros
These will be needed elsewhere for ppc64.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@917 f158a5a8-5612-0410-a976-696ce0be7e32
2010-10-24 18:55:59 +00:00
Mark Cave-Ayland
34d5a76f7e Revert the parts of the last commit which changed the exception function to use an exception pointer as it isn't really
required. Update forthstrap to add a new -c option that when specified will direct the Forth kernel console output to a file 
and integrate this into the build system. By default, when a dictionary is built using a base dictionary then a new log file 
called <dict>-console.log will be generated to help debugging if the build fails.

Also update the exception handler in kernel/bootstrap.c so that it matches the entire range of error codes in 
forth/bootstrap/interpreter.fs.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@706 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-25 21:14:00 +00:00
Mark Cave-Ayland
a288b3044b Change the sysdebug exception() callback so that it is now a function pointer, rather than a function. This enables us to setup an appropriate exception handler
for the task in hand; in particular it allows us to distinguish between an error that occurs when attempting to execute a base dictionary, and an error that 
occurs when interpreting source.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@705 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-24 11:49:41 +00:00
Mark Cave-Ayland
c112720b01 Move the kernel header files into include/kernel to synchronise with the code directory structure.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@689 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 14:21:02 +00:00