From: William H. N. <wil...@ai...> - 2002-01-29 19:32:59
|
On Tue, Jan 29, 2002 at 04:13:49PM +0000, Daniel Barlow wrote: > Here are some of the things I'm currently speculating about. Would > patches for these be accepted? > > 1) Make greater use of $arch-$os-os.c: any function in $arch-arch.c whose > contents are decided entirely or substantially by a #ifdef some_os > (e.g. arch_set_pseudo_atomic_interrupted in alpha-arch.c), or vice > versa anything in $os-os.c bracketed entirely by #ifdef some_arch > (like sigsegv_handler in linux-os.c) is a candidate for being moved > into $arch-$os-os.c. {arch,os}_install_interrupt_handlers, too > > 2) Add some machine-independent way to set the fpu status, ideally using > the same definitions as the Lisp side does (so, they need to be > exported in sbcl.h) > > (I did consider making the FPU settings avilable only to C and having > the Lisp code do FFI calls to get at it, but that seems incredibly > wasteful for something which typically only really wants to set a register) > > 3) Linux 2.0 has been available for as long as anyone can remember: we > may as well retire the (broken, anyway) mmap-in-16M-chunks and ask for > our dynamic spaces all in one chunk. > > 4) (more ambitious) have some lisp->c translation code generate the > data structures that monitor.c and all the related ldb stuff, so it > doesn't need to be maintained in parallel by hand All of these sound good to me. In the case of 1, I'd also remark that when the natural minimal #ifdef doesn't surround the entire construct (where by construct I mean the thing you'd move to another file, a function definition or structure definition or whatever) then I'd also encourage patches which separate out the smaller architecture-dependent piece, then provide per-architecture definitions of the architecture-dependent piece. I was going to use "struct call_info" as an example, but on reflection I think my first impulse there would be to try to make all architectures use what the Alpha currently uses, machine pointers like struct call_frame *frame; instead of pointers punned into fixed-size words like u32 frame So maybe a better example would be memory_fault_handler() in bsd-os.c, where instead of writing FreeBSD and OpenBSD variants of memory_fault_handler(), I'd suggest rewriting it as static void memory_fault_handler(int signal, siginfo_t *siginfo, void *void_context) { /* This is the part that is #ifdef'ed in the current sources. */ void fault_addr = os_siginfo_fault_address(siginfo); /* This part is system-independent. */ if (!gencgc_handle_wp_violation(fault_addr)) { interrupt_handle_now(signal, siginfo, void_context); } } and then implementing FreeBSD and OpenBSD variants of os_siginfo_fault_address(). > And feel free to add more ideas as you think of them ... The lack of Lisp->C translation of layouts and other information, as in point 4, is a special case of general failure of the code to propagate layout information cleanly. Any cleanups which help move toward the ideal where a change in a layout in objdef.lisp would just work everywhere would be great. (As per the KLUDGE notes at the head of objdef.lisp, the failure to propagate changes isn't just a failure to propagate them into ldb, but a failure to propagate them to vital mainstream non-debugger parts of the system too.) -- William Harold Newman <wil...@ai...> "Look on my works, ye Mighty, and despair!" -- Ozymandias, King of Kings PGP key fingerprint 85 CE 1C BA 79 8D 51 8C B9 25 FB EE E0 C3 E5 7C |