summaryrefslogtreecommitdiff
path: root/usr/src/lib/libc/amd64/unwind
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libc/amd64/unwind')
-rw-r--r--usr/src/lib/libc/amd64/unwind/call_frame_inst.c46
-rw-r--r--usr/src/lib/libc/amd64/unwind/eh_frame.c18
-rw-r--r--usr/src/lib/libc/amd64/unwind/thrp_unwind.c10
-rw-r--r--usr/src/lib/libc/amd64/unwind/unwind.c40
4 files changed, 56 insertions, 58 deletions
diff --git a/usr/src/lib/libc/amd64/unwind/call_frame_inst.c b/usr/src/lib/libc/amd64/unwind/call_frame_inst.c
index 70f6ebab46..f803556066 100644
--- a/usr/src/lib/libc/amd64/unwind/call_frame_inst.c
+++ b/usr/src/lib/libc/amd64/unwind/call_frame_inst.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,8 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -31,7 +31,7 @@
*/
#ifndef _LIBCRUN_
-#include "synonyms.h"
+#include "lint.h"
#endif
#include <sys/types.h>
#include "stack_unwind.h"
@@ -144,19 +144,19 @@ fix_cfa(struct _Unwind_Context *ctx, struct register_state *rs)
{
switch (rs[CF_ADDR].rule) {
default:
- ctx->cfa = 0;
+ ctx->cfa = 0;
break;
case register_rule: /* CFA = offset + source_reg */
ctx->cfa = (ctx->current_regs)[rs[CF_ADDR].source_reg] +
- rs[CF_ADDR].offset;
+ rs[CF_ADDR].offset;
break;
case constant_rule: /* CFA = offset */
ctx->cfa = rs[CF_ADDR].offset;
break;
case indirect_rule: /* CFA = *(offset + source_reg) */
ctx->cfa = *(uint64_t *)
- (ctx->current_regs[rs[CF_ADDR].source_reg] +
- rs[CF_ADDR].offset);
+ (ctx->current_regs[rs[CF_ADDR].source_reg] +
+ rs[CF_ADDR].offset);
break;
}
ctx->entry_regs[SP_RSP] = ctx->cfa;
@@ -168,19 +168,19 @@ fix_ra(struct _Unwind_Context *ctx, struct register_state *rs)
switch (rs[RET_ADD].rule) {
case undefined_rule:
default:
- ctx->ra = 0;
+ ctx->ra = 0;
break;
case offset_rule: /* RA = *(offset + CFA) */
ctx->ra = *(uint64_t *)(ctx->cfa + rs[RET_ADD].offset);
break;
case register_rule: /* RA = offset + source_reg */
ctx->ra = ctx->current_regs[rs[RET_ADD].source_reg] +
- rs[RET_ADD].offset;
+ rs[RET_ADD].offset;
break;
case indirect_rule: /* RA = *(offset + source_reg) */
ctx->ra = *(uint64_t *)
- (ctx->current_regs[rs[RET_ADD].source_reg] +
- rs[RET_ADD].offset);
+ (ctx->current_regs[rs[RET_ADD].source_reg] +
+ rs[RET_ADD].offset);
break;
}
}
@@ -194,23 +194,23 @@ fix_reg(struct _Unwind_Context *ctx, struct register_state *rs, int index)
break;
case offset_rule: /* target_reg = *(offset + CFA) */
ctx->entry_regs[index] = *(uint64_t *)
- (ctx->cfa + rs[index].offset);
+ (ctx->cfa + rs[index].offset);
break;
case is_offset_rule: /* target_reg = offset + CFA */
ctx->entry_regs[index] = ctx->cfa + rs[index].offset;
break;
case register_rule: /* target_reg = offset + source_reg */
ctx->entry_regs[index] =
- ctx->current_regs[rs[index].source_reg] +
- rs[index].offset;
+ ctx->current_regs[rs[index].source_reg] +
+ rs[index].offset;
break;
case constant_rule: /* target_reg = offset */
ctx->entry_regs[index] = rs[index].offset;
break;
case indirect_rule: /* target_reg = *(offset + source_reg) */
ctx->entry_regs[index] = *(uint64_t *)
- (ctx->current_regs[rs[index].source_reg] +
- rs[index].offset);
+ (ctx->current_regs[rs[index].source_reg] +
+ rs[index].offset);
break;
}
}
@@ -249,7 +249,7 @@ _Unw_Rollback_Registers(struct eh_frame_fields *f,
return (0);
}
ctx->entry_regs[FP_RBP] = ((uint64_t *)
- (ctx->current_regs[FP_RBP]))[0];
+ (ctx->current_regs[FP_RBP]))[0];
ctx->cfa = ctx->current_regs[FP_RBP] + 16;
ctx->entry_regs[SP_RSP] = ctx->cfa;
ctx->entry_regs[GPR_RBX] = ctx->current_regs[GPR_RBX];
@@ -264,13 +264,13 @@ _Unw_Rollback_Registers(struct eh_frame_fields *f,
for (i = 0; i < 18; i++)
func_start_state[i] = nop;
first_pc = interpret_ops(f->cie_ops, f->cie_ops_end,
- f->cie_reloc, ctx->func, ctx->pc, func_start_state, 0,
- f->data_align, f->code_align, f->code_enc);
+ f->cie_reloc, ctx->func, ctx->pc, func_start_state, 0,
+ f->data_align, f->code_align, f->code_enc);
for (i = 0; i < 18; i++)
func_state[i] = func_start_state[i];
(void) interpret_ops(f->fde_ops, f->fde_ops_end,
- f->fde_reloc, first_pc, ctx->pc, func_state, func_start_state,
- f->data_align, f->code_align, f->code_enc);
+ f->fde_reloc, first_pc, ctx->pc, func_state, func_start_state,
+ f->data_align, f->code_align, f->code_enc);
fix_cfa(ctx, func_state);
if (ctx->cfa < ctx->current_regs[SP_RSP]) {
diff --git a/usr/src/lib/libc/amd64/unwind/eh_frame.c b/usr/src/lib/libc/amd64/unwind/eh_frame.c
index 8e3490b318..b4dcad7b24 100644
--- a/usr/src/lib/libc/amd64/unwind/eh_frame.c
+++ b/usr/src/lib/libc/amd64/unwind/eh_frame.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,8 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -31,7 +31,7 @@
*/
#ifndef _LIBCRUN_
-#include "synonyms.h"
+#include "lint.h"
#endif
#include <sys/types.h>
#include <limits.h>
@@ -92,13 +92,13 @@ _Unw_Decode_FDE(struct eh_frame_fields *f, struct _Unwind_Context *ctx)
fde_data = ctx->fde;
data = fde_data;
fde_end = (void *)(((intptr_t)fde_data) + 4 +
- _Unw_get_val(&data, 0, UNUM32, 1, 1, 0));
+ _Unw_get_val(&data, 0, UNUM32, 1, 1, 0));
reloc = 0;
base = ((intptr_t)data) + reloc;
cie_data = (void *)(base - _Unw_get_val(&data, 0, UNUM32, 1, 1, 0));
cdata = cie_data;
cie_end = (void *)(((intptr_t)cie_data) + 4 +
- _Unw_get_val(&cdata, 0, UNUM32, 1, 1, 0));
+ _Unw_get_val(&cdata, 0, UNUM32, 1, 1, 0));
creloc = 0;
/* data mapping has happened */
@@ -111,7 +111,7 @@ _Unw_Decode_FDE(struct eh_frame_fields *f, struct _Unwind_Context *ctx)
(void) _Unw_get_val(&cdata, creloc, UNUM8, 1, 1, 0);
/* LINTED alignment */
(*((uint64_t *)(&(augment[0])))) =
- _Unw_get_val(&cdata, creloc, ZTSTRING, 1, 1, 0);
+ _Unw_get_val(&cdata, creloc, ZTSTRING, 1, 1, 0);
f->code_align = _Unw_get_val(&cdata, creloc, ULEB128, 1, 1, 0);
f->data_align = _Unw_get_val(&cdata, creloc, SLEB128, 1, 1, 0);
(void) _Unw_get_val(&cdata, creloc, UNUM8, 1, 1, 0);
@@ -371,7 +371,7 @@ locate_fde_for_pc(uint64_t pc, int enc,
pi + (((pj - pi) >> (log_size + 1)) << log_size);
/* Don't use (pi+pj)>>1 */
get_table_ent_val(pr, table_end, enc, reloc, base,
- &range_start, &range_end, &fde);
+ &range_start, &range_end, &fde);
/* Return fde if tpc is in this range. */
diff --git a/usr/src/lib/libc/amd64/unwind/thrp_unwind.c b/usr/src/lib/libc/amd64/unwind/thrp_unwind.c
index 365cbf77be..648a93894d 100644
--- a/usr/src/lib/libc/amd64/unwind/thrp_unwind.c
+++ b/usr/src/lib/libc/amd64/unwind/thrp_unwind.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,14 +18,15 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
-#include "synonyms.h"
+#include "lint.h"
#include "thr_uberdata.h"
#include "stack_unwind.h"
#include "reg_num.h"
diff --git a/usr/src/lib/libc/amd64/unwind/unwind.c b/usr/src/lib/libc/amd64/unwind/unwind.c
index 1fb774a28e..788d7b2d68 100644
--- a/usr/src/lib/libc/amd64/unwind/unwind.c
+++ b/usr/src/lib/libc/amd64/unwind/unwind.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -21,7 +20,7 @@
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -131,22 +130,21 @@
#define _Unwind_SetGR _SUNW_Unwind_SetGR
#define _Unwind_SetIP _SUNW_Unwind_SetIP
#else
-#pragma weak _Unwind_DeleteException = _SUNW_Unwind_DeleteException
-#pragma weak _Unwind_ForcedUnwind = _SUNW_Unwind_ForcedUnwind
-#pragma weak _Unwind_GetCFA = _SUNW_Unwind_GetCFA
-#pragma weak _Unwind_GetGR = _SUNW_Unwind_GetGR
-#pragma weak _Unwind_GetIP = _SUNW_Unwind_GetIP
-#pragma weak _Unwind_GetLanguageSpecificData = \
- _SUNW_Unwind_GetLanguageSpecificData
-#pragma weak _Unwind_GetRegionStart = _SUNW_Unwind_GetRegionStart
-#pragma weak _Unwind_RaiseException = _SUNW_Unwind_RaiseException
-#pragma weak _Unwind_Resume = _SUNW_Unwind_Resume
-#pragma weak _Unwind_SetGR = _SUNW_Unwind_SetGR
-#pragma weak _Unwind_SetIP = _SUNW_Unwind_SetIP
-
-#include "synonyms.h"
+#pragma weak _SUNW_Unwind_DeleteException = _Unwind_DeleteException
+#pragma weak _SUNW_Unwind_ForcedUnwind = _Unwind_ForcedUnwind
+#pragma weak _SUNW_Unwind_GetCFA = _Unwind_GetCFA
+#pragma weak _SUNW_Unwind_GetGR = _Unwind_GetGR
+#pragma weak _SUNW_Unwind_GetIP = _Unwind_GetIP
+#pragma weak _SUNW_Unwind_GetLanguageSpecificData = \
+ _Unwind_GetLanguageSpecificData
+#pragma weak _SUNW_Unwind_GetRegionStart = _Unwind_GetRegionStart
+#pragma weak _SUNW_Unwind_RaiseException = _Unwind_RaiseException
+#pragma weak _SUNW_Unwind_Resume = _Unwind_Resume
+#pragma weak _SUNW_Unwind_SetGR = _Unwind_SetGR
+#pragma weak _SUNW_Unwind_SetIP = _Unwind_SetIP
#endif
+#include "lint.h"
#include <string.h>
#include "stack_unwind.h"
#include "reg_num.h"
@@ -376,7 +374,7 @@ _Unwind_ForcedUnwind_Body(struct _Unwind_Exception *exception_object,
finish_capture(ctx, resume);
if (resume && down_one(ctx, ctx))
- return (_URC_FATAL_PHASE2_ERROR);
+ return (_URC_FATAL_PHASE2_ERROR);
do {
again = 0;
@@ -418,8 +416,8 @@ _Unwind_ForcedUnwind_Body(struct _Unwind_Exception *exception_object,
case _URC_END_OF_STACK:
ctx->cfa = ctx->ra = ctx->pc = 0;
res = (*stop)(1, phase,
- exception_object->exception_class,
- exception_object, ctx, stop_parameter);
+ exception_object->exception_class,
+ exception_object, ctx, stop_parameter);
return (_URC_END_OF_STACK);
break;
default: