summaryrefslogtreecommitdiffstats
path: root/usr.bin/doscmd
diff options
context:
space:
mode:
authorcracauer <cracauer@FreeBSD.org>1999-07-07 06:44:53 +0000
committercracauer <cracauer@FreeBSD.org>1999-07-07 06:44:53 +0000
commit5c2c4901ff68f78897c8e15ed6c37b62641418ad (patch)
tree5526aef6f220231802afc98862ee9a9dd91dc829 /usr.bin/doscmd
parent136f27c25b81b9d271a3128db889d7578aec631f (diff)
downloadFreeBSD-src-5c2c4901ff68f78897c8e15ed6c37b62641418ad.zip
FreeBSD-src-5c2c4901ff68f78897c8e15ed6c37b62641418ad.tar.gz
Break lines to be < 80 chars. This has been done only to that file in
doscmd that was affected by the SA_SIGINFO changes (which made many lines longer). This application is in need for general code reformatting and warning fixes. Submitted by: Warner Losh <imp@village.org>
Diffstat (limited to 'usr.bin/doscmd')
-rw-r--r--usr.bin/doscmd/trap.c41
1 files changed, 25 insertions, 16 deletions
diff --git a/usr.bin/doscmd/trap.c b/usr.bin/doscmd/trap.c
index edf8997..f810750 100644
--- a/usr.bin/doscmd/trap.c
+++ b/usr.bin/doscmd/trap.c
@@ -29,7 +29,7 @@
*
* BSDI trap.c,v 2.3 1996/04/08 19:33:08 bostic Exp
*
- * $Id: trap.c,v 1.2 1997/09/30 22:04:05 jlemon Exp $
+ * $Id: trap.c,v 1.3 1999/07/06 07:15:10 cracauer Exp $
*/
#include "doscmd.h"
@@ -74,7 +74,8 @@ fake_int(regcontext_t *REGS, int intnum)
}
user_int:
- debug (D_TRAPS|intnum, "INT %02x:%02x [%04x:%04x] %04x %04x %04x %04x from %04x:%04x\n",
+ debug (D_TRAPS|intnum,
+ "INT %02x:%02x [%04x:%04x] %04x %04x %04x %04x from %04x:%04x\n",
intnum, R_AH, ivec[intnum] >> 16, ivec[intnum] & 0xffff,
R_AX, R_BX, R_CX, R_DX, R_CS, R_IP);
@@ -184,7 +185,8 @@ sigurg(struct sigframe *sf)
addr = (u_char *)GETPTR(sc->sc_cs, sc->sc_eip);
rep = 1;
- debug (D_TRAPS2, "%04x:%04x [%02x]", GET16(sc->sc_cs), GET16(sc->sc_eip), addr[0]);
+ debug (D_TRAPS2, "%04x:%04x [%02x]", GET16(sc->sc_cs),
+ GET16(sc->sc_eip), addr[0]);
switch (addr[0]) {
case TRACETRAP:
ipadvance(sc,1);
@@ -294,7 +296,8 @@ sigbus(struct sigframe *sf)
if (sf->sf_arg2 != 0) {
fatal("SIGBUS code %d, trapno: %d, err: %d\n",
- sf->sf_arg2, sf->sf_siginfo.si_sc.sc_trapno, sf->sf_siginfo.si_sc.sc_err);
+ sf->sf_arg2, sf->sf_siginfo.si_sc.sc_trapno,
+ sf->sf_siginfo.si_sc.sc_err);
}
addr = (u_char *)GETPTR(R_CS, R_IP);
@@ -311,7 +314,8 @@ sigbus(struct sigframe *sf)
goto out;
}
/* printf("%p\n", addr); fflush(stdout); */
- debug (D_TRAPS2, "%04x:%04x [%02x %02x %02x] ", R_CS, R_IP, (int)addr[0], (int)addr[1], (int)addr[2]);
+ debug (D_TRAPS2, "%04x:%04x [%02x %02x %02x] ", R_CS, R_IP,
+ (int)addr[0], (int)addr[1], (int)addr[2]);
#if 0
if ((int)addr[0] == 0x67) {
int i;
@@ -327,7 +331,7 @@ sigbus(struct sigframe *sf)
}
#endif
- switch (addr[0]) { /* what was that again dear? */
+ switch (addr[0]) { /* what was that again dear? */
case CLI:
debug (D_TRAPS2, "cli\n");
@@ -348,14 +352,15 @@ sigbus(struct sigframe *sf)
case PUSHF:
debug (D_TRAPS2, "pushf <- 0x%x\n", R_EFLAGS);
R_IP++;
- N_PUSH((R_FLAGS & ~PSL_I) | (R_EFLAGS & PSL_VIF ? PSL_I : 0), REGS);
+ N_PUSH((R_FLAGS & ~PSL_I) | (R_EFLAGS & PSL_VIF ? PSL_I : 0),
+ REGS);
break;
case IRET:
- R_IP = N_POP(REGS); /* get new cs:ip off the stack */
+ R_IP = N_POP(REGS); /* get new cs:ip off the stack */
R_CS = N_POP(REGS);
debug (D_TRAPS2, "iret to %04x:%04x ", R_CS, R_IP);
- /* FALLTHROUGH */ /* 'safe' flag pop operation */
+ /* FALLTHROUGH */ /* 'safe' flag pop operation */
case POPF:
/* XXX */
@@ -363,13 +368,17 @@ sigbus(struct sigframe *sf)
if (addr[0] == POPF)
R_IP++;
-
- tempflags = N_POP(REGS); /* get flags from stack */
- okflags = (PSL_ALLCC | PSL_T | PSL_D | PSL_V); /* flags we consider OK */
- R_FLAGS = ((R_FLAGS & ~okflags) | /* keep state of non-OK flags */
- (tempflags & okflags)); /* pop state of OK flags */
-
- IntState = tempflags & PSL_I; /* restore pseudo PSL_I flag */
+ /* get flags from stack */
+ tempflags = N_POP(REGS);
+ /* flags we consider OK */
+ okflags = (PSL_ALLCC | PSL_T | PSL_D | PSL_V);
+ /* keep state of non-OK flags */
+ R_FLAGS = ((R_FLAGS & ~okflags) |
+ /* pop state of OK flags */
+ (tempflags & okflags));
+
+ /* restore pseudo PSL_I flag */
+ IntState = tempflags & PSL_I;
debug(D_TRAPS2, "popf -> 0x%x\n", R_EFLAGS);
break;
OpenPOWER on IntegriCloud