This should simplify hanging an interpreter off this simple little top
loop. That is, userland H3sm was using cooked mode, so this is nice.
This is the top loop code, which is x86 assembly and H3sm
subroutines...
.................................................................
abort_H3sm:
call buffer
top_loop_of_H3sm:
# stick a sleep in here.
# Do not melt the CPU, do not slow down
# the test cycle.
call timespec
call pdup
call pplusc
call pplusc
call nanosleep
call twopdrop
call drop
HANDOFF
call zero # FD
call read
call literal
.byte 4
.int 0x30
call plus
call emit
ELL( top_loop_of_H3sm)
...................................................................
emit is similar to Forth EMIT. It is a one-byte write().
buffer and timespec put addresses on
the H3sm pointer stack. nanosleep and read are H3sm stack-passing
wrappers for the syscalls. HANDOFF is a macro for a stack-push-wrapped
schedule(). It's a macro because I suspect I'm going to have to sprinkle
it judiciously around H3sm. The nanosleep keeps my load average normal.
Rick Hohensee
www.clienux.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/