Skip to content

Commit

Permalink
0.9.2.42:
Browse files Browse the repository at this point in the history
	one slice of whitespace canonicalization
	(Anyone who ends up here with "cvs annotate" probably
		wants to look at the "tabby" tagged version.)
  • Loading branch information
William Harold Newman committed Jul 14, 2005
1 parent 3e9cd95 commit 79cc569
Show file tree
Hide file tree
Showing 83 changed files with 5,338 additions and 5,338 deletions.
22 changes: 11 additions & 11 deletions src/runtime/alloc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* allocation routines for C code. For allocation done by Lisp look
* allocation routines for C code. For allocation done by Lisp look
* instead at src/compiler/target/alloc.lisp and .../macros.lisp
*/

Expand Down Expand Up @@ -41,7 +41,7 @@
#if defined LISP_FEATURE_GENCGC
extern lispobj *alloc(int bytes);
lispobj *
pa_alloc(int bytes)
pa_alloc(int bytes)
{
lispobj *result=0;
struct thread *th=arch_os_get_current_thread();
Expand All @@ -51,11 +51,11 @@ pa_alloc(int bytes)
result=alloc(bytes);
SetSymbolValue(PSEUDO_ATOMIC_ATOMIC, make_fixnum(0),th);
if (fixnum_value(SymbolValue(PSEUDO_ATOMIC_INTERRUPTED,th)))
/* even if we gc at this point, the new allocation will be
* protected from being moved, because result is on the c stack
* and points to it */
do_pending_interrupt();
return result;
/* even if we gc at this point, the new allocation will be
* protected from being moved, because result is on the c stack
* and points to it */
do_pending_interrupt();
return result;
}

#else
Expand All @@ -72,8 +72,8 @@ pa_alloc(int bytes)
SET_FREE_POINTER((lispobj *)(result + bytes));

if (GET_GC_TRIGGER() && GET_FREE_POINTER() > GET_GC_TRIGGER()) {
SET_GC_TRIGGER((char *)GET_FREE_POINTER()
- (char *)current_dynamic_space);
SET_GC_TRIGGER((char *)GET_FREE_POINTER()
- (char *)current_dynamic_space);
}
return (lispobj *) result;
}
Expand Down Expand Up @@ -127,7 +127,7 @@ alloc_number(long n)

ptr->digits[0] = n;

return make_lispobj(ptr, OTHER_POINTER_LOWTAG);
return make_lispobj(ptr, OTHER_POINTER_LOWTAG);
}
}

Expand All @@ -149,7 +149,7 @@ alloc_sap(void *ptr)
{
struct sap *sap;
sap=(struct sap *)
alloc_unboxed((int)SAP_WIDETAG, sizeof(struct sap)/sizeof(lispobj) -1);
alloc_unboxed((int)SAP_WIDETAG, sizeof(struct sap)/sizeof(lispobj) -1);
sap->pointer = ptr;
return make_lispobj(sap,OTHER_POINTER_LOWTAG);
}
212 changes: 106 additions & 106 deletions src/runtime/alpha-arch.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,41 +43,41 @@ arch_init(void)
* page size is. */

if (mmap((os_vm_address_t) call_into_lisp_LRA_page,os_vm_page_size,
OS_VM_PROT_ALL,MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED,-1,0)
== (os_vm_address_t) -1)
perror("mmap");
OS_VM_PROT_ALL,MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED,-1,0)
== (os_vm_address_t) -1)
perror("mmap");

/* call_into_lisp_LRA is a collection of trampolines written in asm -
* see alpha-assem.S. We copy it to call_into_lisp_LRA_page where
* VOPs and things can find it. (I don't know why they can't find it
* VOPs and things can find it. (I don't know why they can't find it
* where it was to start with.) */
bcopy(call_into_lisp_LRA,(void *)call_into_lisp_LRA_page,os_vm_page_size);

os_flush_icache((os_vm_address_t)call_into_lisp_LRA_page,
os_vm_page_size);
os_vm_page_size);
return;
}

os_vm_address_t
os_vm_address_t
arch_get_bad_addr (int sig, siginfo_t *code, os_context_t *context)
{
unsigned int badinst;

/* Instructions are 32 bit quantities. */
unsigned int *pc ;
/* fprintf(stderr,"arch_get_bad_addr %d %p %p\n",
sig, code, context); */
sig, code, context); */
pc= (unsigned int *)(*os_context_pc_addr(context));

if (((unsigned long)pc) & 3) {
return NULL; /* In what case would pc be unaligned?? */
return NULL; /* In what case would pc be unaligned?? */
}

if ( (pc < READ_ONLY_SPACE_START ||
pc >= READ_ONLY_SPACE_START+READ_ONLY_SPACE_SIZE) &&
(pc < current_dynamic_space ||
pc >= current_dynamic_space + DYNAMIC_SPACE_SIZE))
return NULL;
pc >= READ_ONLY_SPACE_START+READ_ONLY_SPACE_SIZE) &&
(pc < current_dynamic_space ||
pc >= current_dynamic_space + DYNAMIC_SPACE_SIZE))
return NULL;

return context->uc_mcontext.sc_traparg_a0;
}
Expand Down Expand Up @@ -106,10 +106,10 @@ void arch_set_pseudo_atomic_interrupted(os_context_t *context)
{
/* On coming out of an atomic section, we subtract 1 from
* reg_Alloc, then try to store something at that address. So,
* to signal that it was interrupted and a signal should be handled,
* to signal that it was interrupted and a signal should be handled,
* we set bit 63 of reg_ALLOC here so that the end-of-atomic code
* will raise SIGSEGV (no ram mapped there). We catch the signal
* (see the appropriate *-os.c) and call interrupt_handle_pending()
* (see the appropriate *-os.c) and call interrupt_handle_pending()
* for the saved signal instead */

*os_context_register_addr(context,reg_ALLOC) |= (1L<<63);
Expand All @@ -120,9 +120,9 @@ unsigned long arch_install_breakpoint(void *pc)
unsigned int *ptr = (unsigned int *)pc;
unsigned long result = (unsigned long) *ptr;
*ptr = BREAKPOINT_INST;

os_flush_icache((os_vm_address_t)ptr, sizeof(unsigned long));

return result;
}

Expand All @@ -148,72 +148,72 @@ emulate_branch(os_context_t *context,unsigned long orig_inst)
int reg_a = (orig_inst >> 21) & 0x1f;
int reg_b = (orig_inst >> 16) & 0x1f;
int disp =
(orig_inst&(1<<20)) ?
orig_inst | (-1 << 21) :
orig_inst&0x1fffff;
(orig_inst&(1<<20)) ?
orig_inst | (-1 << 21) :
orig_inst&0x1fffff;
int next_pc = *os_context_pc_addr(context);
int branch = 0; /* was NULL; */
int branch = 0; /* was NULL; */

switch(op) {
case 0x1a: /* jmp, jsr, jsr_coroutine, ret */
*os_context_register_addr(context,reg_a) =
*os_context_pc_addr(context);
*os_context_pc_addr(context) =
*os_context_register_addr(context,reg_b)& ~3;
break;
*os_context_register_addr(context,reg_a) =
*os_context_pc_addr(context);
*os_context_pc_addr(context) =
*os_context_register_addr(context,reg_b)& ~3;
break;
case 0x30: /* br */
*os_context_register_addr(context,reg_a)=*os_context_pc_addr(context);
branch = 1;
break;
*os_context_register_addr(context,reg_a)=*os_context_pc_addr(context);
branch = 1;
break;
case 0x31: /* fbeq */
if (*(os_context_float_register_addr(context,reg_a))==0) branch = 1;
break;
if (*(os_context_float_register_addr(context,reg_a))==0) branch = 1;
break;
case 0x32: /* fblt */
if (*os_context_float_register_addr(context,reg_a)<0) branch = 1;
break;
if (*os_context_float_register_addr(context,reg_a)<0) branch = 1;
break;
case 0x33: /* fble */
if (*os_context_float_register_addr(context,reg_a)<=0) branch = 1;
break;
if (*os_context_float_register_addr(context,reg_a)<=0) branch = 1;
break;
case 0x34: /* bsr */
*os_context_register_addr(context,reg_a)=*os_context_pc_addr(context);
branch = 1;
break;
*os_context_register_addr(context,reg_a)=*os_context_pc_addr(context);
branch = 1;
break;
case 0x35: /* fbne */
if (*os_context_register_addr(context,reg_a)!=0) branch = 1;
break;
if (*os_context_register_addr(context,reg_a)!=0) branch = 1;
break;
case 0x36: /* fbge */
if (*os_context_float_register_addr(context,reg_a)>=0) branch = 1;
break;
if (*os_context_float_register_addr(context,reg_a)>=0) branch = 1;
break;
case 0x37: /* fbgt */
if (*os_context_float_register_addr(context,reg_a)>0) branch = 1;
break;
if (*os_context_float_register_addr(context,reg_a)>0) branch = 1;
break;
case 0x38: /* blbc */
if ((*os_context_register_addr(context,reg_a)&1) == 0) branch = 1;
break;
if ((*os_context_register_addr(context,reg_a)&1) == 0) branch = 1;
break;
case 0x39: /* beq */
if (*os_context_register_addr(context,reg_a)==0) branch = 1;
break;
if (*os_context_register_addr(context,reg_a)==0) branch = 1;
break;
case 0x3a: /* blt */
if (*os_context_register_addr(context,reg_a)<0) branch = 1;
break;
if (*os_context_register_addr(context,reg_a)<0) branch = 1;
break;
case 0x3b: /* ble */
if (*os_context_register_addr(context,reg_a)<=0) branch = 1;
break;
if (*os_context_register_addr(context,reg_a)<=0) branch = 1;
break;
case 0x3c: /* blbs */
if ((*os_context_register_addr(context,reg_a)&1)!=0) branch = 1;
break;
if ((*os_context_register_addr(context,reg_a)&1)!=0) branch = 1;
break;
case 0x3d: /* bne */
if (*os_context_register_addr(context,reg_a)!=0) branch = 1;
break;
if (*os_context_register_addr(context,reg_a)!=0) branch = 1;
break;
case 0x3e: /* bge */
if (*os_context_register_addr(context,reg_a)>=0) branch = 1;
break;
if (*os_context_register_addr(context,reg_a)>=0) branch = 1;
break;
case 0x3f: /* bgt */
if (*os_context_register_addr(context,reg_a)>0) branch = 1;
break;
if (*os_context_register_addr(context,reg_a)>0) branch = 1;
break;
}
if (branch)
next_pc += disp*4;
next_pc += disp*4;
return next_pc;
}

Expand All @@ -222,16 +222,16 @@ static sigset_t orig_sigmask;
/* Perform the instruction that we overwrote with a breakpoint. As we
* don't have a single-step facility, this means we have to:
* - put the instruction back
* - put a second breakpoint at the following instruction,
* - put a second breakpoint at the following instruction,
* set after_breakpoint and continue execution.
*
* When the second breakpoint is hit (very shortly thereafter, we hope)
* sigtrap_handler gets called again, but follows the AfterBreakpoint
* arm, which
* - puts a bpt back in the first breakpoint place (running across a
* sigtrap_handler gets called again, but follows the AfterBreakpoint
* arm, which
* - puts a bpt back in the first breakpoint place (running across a
* breakpoint shouldn't cause it to be uninstalled)
* - replaces the second bpt with the instruction it was meant to be
* - carries on
* - carries on
*
* Clear?
*/
Expand Down Expand Up @@ -260,14 +260,14 @@ void arch_do_displaced_inst(os_context_t *context,unsigned int orig_inst)
os_flush_icache((os_vm_address_t)pc, sizeof(unsigned long));
skipped_break_addr = pc;

/* Figure out where we will end up after running the displaced
/* Figure out where we will end up after running the displaced
* instruction */
if (op == 0x1a || (op&0xf) == 0x30) /* a branch */
/* The cast to long is just to shut gcc up. */
next_pc = (unsigned int *)((long)emulate_branch(context,orig_inst));
/* The cast to long is just to shut gcc up. */
next_pc = (unsigned int *)((long)emulate_branch(context,orig_inst));
else
next_pc = pc+1;
next_pc = pc+1;

/* Set the after breakpoint. */
displaced_after_inst = *next_pc;
*next_pc = BREAKPOINT_INST;
Expand All @@ -291,57 +291,57 @@ sigtrap_handler(int signal, siginfo_t *siginfo, os_context_t *context)
* breakpoint or a "system service" */

if ((*(unsigned int*)(*os_context_pc_addr(context)-4))==BREAKPOINT_INST) {
if (after_breakpoint) {
/* see comments above arch_do_displaced_inst. This is where
* we reinsert the breakpoint that we removed earlier */

*os_context_pc_addr(context) -=4;
*skipped_break_addr = BREAKPOINT_INST;
os_flush_icache((os_vm_address_t)skipped_break_addr,
sizeof(unsigned long));
skipped_break_addr = NULL;
*(unsigned int *)*os_context_pc_addr(context) =
displaced_after_inst;
os_flush_icache((os_vm_address_t)*os_context_pc_addr(context), sizeof(unsigned long));
*os_context_sigmask_addr(context)= orig_sigmask;
after_breakpoint=0; /* false */
return;
} else
code = trap_Breakpoint;
if (after_breakpoint) {
/* see comments above arch_do_displaced_inst. This is where
* we reinsert the breakpoint that we removed earlier */

*os_context_pc_addr(context) -=4;
*skipped_break_addr = BREAKPOINT_INST;
os_flush_icache((os_vm_address_t)skipped_break_addr,
sizeof(unsigned long));
skipped_break_addr = NULL;
*(unsigned int *)*os_context_pc_addr(context) =
displaced_after_inst;
os_flush_icache((os_vm_address_t)*os_context_pc_addr(context), sizeof(unsigned long));
*os_context_sigmask_addr(context)= orig_sigmask;
after_breakpoint=0; /* false */
return;
} else
code = trap_Breakpoint;
} else
/* a "system service" */
/* a "system service" */
code=*((u32 *)(*os_context_pc_addr(context)));

switch (code) {
case trap_PendingInterrupt:
arch_skip_instruction(context);
interrupt_handle_pending(context);
break;
arch_skip_instruction(context);
interrupt_handle_pending(context);
break;

case trap_Halt:
fake_foreign_function_call(context);
lose("%%primitive halt called; the party is over.\n");
fake_foreign_function_call(context);
lose("%%primitive halt called; the party is over.\n");

case trap_Error:
case trap_Cerror:
interrupt_internal_error(signal, siginfo, context, code==trap_Cerror);
break;
interrupt_internal_error(signal, siginfo, context, code==trap_Cerror);
break;

case trap_Breakpoint: /* call lisp-level handler */
case trap_Breakpoint: /* call lisp-level handler */
*os_context_pc_addr(context) -=4;
handle_breakpoint(signal, siginfo, context);
break;
handle_breakpoint(signal, siginfo, context);
break;

case trap_FunEndBreakpoint:
*os_context_pc_addr(context) -=4;
*os_context_pc_addr(context) =
(int)handle_fun_end_breakpoint(signal, siginfo, context);
break;
*os_context_pc_addr(context) =
(int)handle_fun_end_breakpoint(signal, siginfo, context);
break;

default:
fprintf(stderr, "unidentified breakpoint/trap %d\n",code);
interrupt_handle_now(signal, siginfo, context);
break;
fprintf(stderr, "unidentified breakpoint/trap %d\n",code);
interrupt_handle_now(signal, siginfo, context);
break;
}
}

Expand Down
Loading

0 comments on commit 79cc569

Please sign in to comment.