Skip to content

Commit

Permalink
* resolv/res_debug.c (latlon2ul): Use ISO C function declaration.
Browse files Browse the repository at this point in the history
	(precsize_aton): Likewise.
	(precsize_ntoa): Likewise.

	* resolv/gethnamaddr.c (_gethtbyname): Remove extra prototype.
	(gethostbyname2): Likewise.
	(gethostbyaddr): Likewise.
	(getanswer): Use ISO C function declaration.
  • Loading branch information
Ulrich Drepper committed Dec 30, 2005
1 parent 3ddf714 commit db0a00d
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 119 deletions.
11 changes: 11 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
2005-12-29 Andreas Jaeger <aj@suse.de>

* resolv/res_debug.c (latlon2ul): Use ISO C function declaration.
(precsize_aton): Likewise.
(precsize_ntoa): Likewise.

* resolv/gethnamaddr.c (_gethtbyname): Remove extra prototype.
(gethostbyname2): Likewise.
(gethostbyaddr): Likewise.
(getanswer): Use ISO C function declaration.

2005-12-29 Kaz Kojima <kkojima@rr.iij4u.or.jp>

* sysdeps/sh/sysdep.h: Add cfi instrumentation to asm fragments.
Expand Down
6 changes: 6 additions & 0 deletions nptl/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2005-12-29 Kaz Kojima <kkojima@rr.iij4u.or.jp>

* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
.eh_frame section, use cfi_* directives.
* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.

2005-12-30 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
Expand Down
24 changes: 24 additions & 0 deletions nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@
.type __lll_mutex_lock_wait,@function
.hidden __lll_mutex_lock_wait
.align 5
cfi_startproc
__lll_mutex_lock_wait:
mov.l r8, @-r15
cfi_adjust_cfa_offset(4)
cfi_rel_offset (r8, 0)
mov r4, r6
mov r5, r8
mov #0, r7 /* No timeout. */
Expand All @@ -59,6 +62,7 @@ __lll_mutex_lock_wait:
mov.l @r15+, r8
ret
mov r2, r0
cfi_endproc
.size __lll_mutex_lock_wait,.-__lll_mutex_lock_wait


Expand All @@ -67,6 +71,7 @@ __lll_mutex_lock_wait:
.type __lll_mutex_timedlock_wait,@function
.hidden __lll_mutex_timedlock_wait
.align 5
cfi_startproc
__lll_mutex_timedlock_wait:
/* Check for a valid timeout value. */
mov.l @(4,r6), r1
Expand All @@ -75,14 +80,21 @@ __lll_mutex_timedlock_wait:
bt 3f

mov.l r10, @-r15
cfi_adjust_cfa_offset(4)
cfi_rel_offset (r10, 0)
mov.l r9, @-r15
cfi_adjust_cfa_offset(4)
cfi_rel_offset (r9, 0)
mov.l r8, @-r15
cfi_adjust_cfa_offset(4)
cfi_rel_offset (r8, 0)
mov r4, r10
mov r6, r9
mov r5, r8

/* Stack frame for the timespec and timeval structs. */
add #-8, r15
cfi_adjust_cfa_offset(8)

1:
/* Get current time. */
Expand Down Expand Up @@ -162,6 +174,7 @@ __lll_mutex_timedlock_wait:
5:
bra 6b
mov #ETIMEDOUT, r0
cfi_endproc

.L1k:
.word 1000
Expand All @@ -178,6 +191,7 @@ __lll_mutex_timedlock_wait:
.type lll_unlock_wake_cb,@function
.hidden lll_unlock_wake_cb
.align 5
cfi_startproc
lll_unlock_wake_cb:
DEC (@r4, r2)
tst r2, r2
Expand All @@ -195,6 +209,7 @@ lll_unlock_wake_cb:
1:
rts
nop
cfi_endproc
.size lll_unlock_wake_cb,.-lll_unlock_wake_cb
#endif

Expand All @@ -203,6 +218,7 @@ lll_unlock_wake_cb:
.type __lll_mutex_unlock_wake,@function
.hidden __lll_mutex_unlock_wake
.align 5
cfi_startproc
__lll_mutex_unlock_wake:
mov #FUTEX_WAKE, r5
mov #1, r6 /* Wake one thread. */
Expand All @@ -214,6 +230,7 @@ __lll_mutex_unlock_wake:
SYSCALL_INST_PAD
rts
nop
cfi_endproc
.size __lll_mutex_unlock_wake,.-__lll_mutex_unlock_wake


Expand All @@ -222,14 +239,20 @@ __lll_mutex_unlock_wake:
.type __lll_timedwait_tid,@function
.hidden __lll_timedwait_tid
.align 5
cfi_startproc
__lll_timedwait_tid:
mov.l r9, @-r15
cfi_adjust_cfa_offset(4)
cfi_rel_offset (r9, 0)
mov.l r8, @-r15
cfi_adjust_cfa_offset(4)
cfi_rel_offset (r8, 0)
mov r4, r8
mov r5, r9

/* Stack frame for the timespec and timeval structs. */
add #-8, r15
cfi_adjust_cfa_offset(8)

2:
/* Get current time. */
Expand Down Expand Up @@ -292,6 +315,7 @@ __lll_timedwait_tid:
6:
bra 3b
mov #ETIMEDOUT, r0
cfi_endproc

.L1k2:
.word 1000
Expand Down
122 changes: 19 additions & 103 deletions nptl/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -49,27 +49,32 @@
.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
.Lpseudo_cancel: \
sts.l pr,@-r15; \
.LCFI0: \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (pr, 0); \
add _IMM16,r15; \
cfi_adjust_cfa_offset (16); \
SAVE_ARGS_##args; \
.LCFI1: \
CENABLE; \
LOAD_ARGS_##args; \
add _IMP16,r15; \
.LCFI2: \
cfi_adjust_cfa_offset (-16); \
lds.l @r15+,pr; \
.LCFI3: \
cfi_adjust_cfa_offset (-4); \
cfi_restore (pr); \
DO_CALL(syscall_name, args); \
SYSCALL_INST_PAD; \
sts.l pr,@-r15; \
.LCFI4: \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (pr, 0); \
mov.l r0,@-r15; \
.LCFI5: \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (r0, 0); \
CDISABLE; \
mov.l @r15+,r0; \
.LCFI6: \
cfi_adjust_cfa_offset (-4); \
lds.l @r15+,pr; \
.LCFI7: \
cfi_adjust_cfa_offset (-4); \
cfi_restore (pr); \
mov r0,r1; \
mov _IMM12,r2; \
shad r2,r1; \
Expand All @@ -78,106 +83,17 @@
bf .Lpseudo_end; \
.Lsyscall_error: \
SYSCALL_ERROR_HANDLER; \
.Lpseudo_end: \
/* Create unwinding information for the syscall wrapper. */ \
.section .eh_frame,"a",@progbits; \
.Lframe1: \
.ualong .LECIE1-.LSCIE1; \
.LSCIE1: \
.ualong 0x0; \
.byte 0x1; \
AUGMENTATION_STRING; \
.uleb128 0x1; \
.sleb128 -4; \
.byte 0x11; \
AUGMENTATION_PARAM; \
.byte 0xc; \
.uleb128 0xf; \
.uleb128 0x0; \
.align 2; \
.LECIE1: \
.LSFDE1: \
.ualong .LEFDE1-.LASFDE1; \
.LASFDE1: \
.ualong .LASFDE1-.Lframe1; \
START_SYMBOL_REF; \
.ualong .Lpseudo_end - .Lpseudo_start; \
AUGMENTATION_PARAM_FDE; \
.byte 0x4; \
.ualong .LCFI0-.Lpseudo_start; \
.byte 0xe; \
.uleb128 0x4; \
.byte 0x91; \
.uleb128 0x1; \
.byte 0x4; \
.ualong .LCFI1-.LCFI0; \
.byte 0xe; \
.uleb128 0x14; \
FRAME_REG_##args; \
.byte 0x4; \
.ualong .LCFI2-.LCFI1; \
.byte 0xe; \
.uleb128 0x4; \
.byte 0x4; \
.ualong .LCFI3-.LCFI2; \
.byte 0xe; \
.uleb128 0x0; \
.byte 0xd1; \
.byte 0x4; \
.ualong .LCFI4-.LCFI3; \
.byte 0xe; \
.uleb128 0x4; \
.byte 0x91; \
.uleb128 0x1; \
.byte 0x4; \
.ualong .LCFI5-.LCFI4; \
.byte 0xe; \
.uleb128 0x8; \
.byte 0x80; \
.uleb128 0x2; \
.byte 0x4; \
.ualong .LCFI6-.LCFI5; \
.byte 0xe; \
.uleb128 0x4; \
.byte 0xc0; \
.byte 0x4; \
.ualong .LCFI7-.LCFI6; \
.byte 0xe; \
.uleb128 0x0; \
.byte 0xd1; \
.align 2; \
.LEFDE1: \
.previous

# ifdef SHARED
# define AUGMENTATION_STRING .string "zR"
# define AUGMENTATION_PARAM .uleb128 1; .byte 0x1b
# define AUGMENTATION_PARAM_FDE .uleb128 0
# define START_SYMBOL_REF .long .Lpseudo_start-.
# else
# define AUGMENTATION_STRING .ascii "\0"
# define AUGMENTATION_PARAM
# define AUGMENTATION_PARAM_FDE
# define START_SYMBOL_REF .long .Lpseudo_start
# endif

# define FRAME_REG_0 /* Nothing. */
# define FRAME_REG_1 FRAME_REG_0; .byte 0x84; .uleb128 5
# define FRAME_REG_2 FRAME_REG_1; .byte 0x85; .uleb128 4
# define FRAME_REG_3 FRAME_REG_2; .byte 0x86; .uleb128 3
# define FRAME_REG_4 FRAME_REG_3; .byte 0x87; .uleb128 2
# define FRAME_REG_5 FRAME_REG_4
# define FRAME_REG_6 FRAME_REG_5
.Lpseudo_end:

# undef PSEUDO_END
# define PSEUDO_END(sym) \
END (sym)

# define SAVE_ARGS_0 /* Nothing. */
# define SAVE_ARGS_1 SAVE_ARGS_0; mov.l r4,@(0,r15)
# define SAVE_ARGS_2 SAVE_ARGS_1; mov.l r5,@(4,r15)
# define SAVE_ARGS_3 SAVE_ARGS_2; mov.l r6,@(8,r15)
# define SAVE_ARGS_4 SAVE_ARGS_3; mov.l r7,@(12,r15)
# define SAVE_ARGS_1 SAVE_ARGS_0; mov.l r4,@(0,r15); cfi_offset (r4,-4)
# define SAVE_ARGS_2 SAVE_ARGS_1; mov.l r5,@(4,r15); cfi_offset (r5,-8)
# define SAVE_ARGS_3 SAVE_ARGS_2; mov.l r6,@(8,r15); cfi_offset (r6,-12)
# define SAVE_ARGS_4 SAVE_ARGS_3; mov.l r7,@(12,r15); cfi_offset (r7,-16)
# define SAVE_ARGS_5 SAVE_ARGS_4
# define SAVE_ARGS_6 SAVE_ARGS_5

Expand Down
9 changes: 1 addition & 8 deletions resolv/gethnamaddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,7 @@ Dprintf(msg, num)


static struct hostent *
getanswer(answer, anslen, qname, qtype)
const querybuf *answer;
int anslen;
const char *qname;
int qtype;
getanswer (const querybuf *answer, int anslen, const char *qname, int qtype)
{
register const HEADER *hp;
register const u_char *cp;
Expand Down Expand Up @@ -522,7 +518,6 @@ gethostbyname2(name, af)
char *bp;
int n, size, type, len;
struct hostent *ret;
extern struct hostent *_gethtbyname2();

if (__res_maybe_init (&_res, 0) == -1) {
__set_h_errno (NETDB_INTERNAL);
Expand Down Expand Up @@ -666,7 +661,6 @@ gethostbyaddr(addr, len, af)
u_long old_options;
char hname2[MAXDNAME+1];
#endif /*SUNSECURITY*/
extern struct hostent *_gethtbyaddr();

if (__res_maybe_init (&_res, 0) == -1) {
__set_h_errno (NETDB_INTERNAL);
Expand Down Expand Up @@ -879,7 +873,6 @@ struct hostent *
_gethtbyname(name)
const char *name;
{
extern struct hostent *_gethtbyname2();
struct hostent *hp;

if (_res.options & RES_USE_INET6) {
Expand Down
10 changes: 3 additions & 7 deletions resolv/res_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,7 @@ static const unsigned int poweroften[10]=

/* takes an XeY precision/size value, returns a string representation. */
static const char *
precsize_ntoa(prec)
u_int8_t prec;
precsize_ntoa (u_int8_t prec)
{
static char retbuf[sizeof "90000000.00"]; /* XXX nonreentrant */
unsigned long val;
Expand All @@ -644,8 +643,7 @@ precsize_ntoa(prec)

/* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer. */
static u_int8_t
precsize_aton(strptr)
const char **strptr;
precsize_aton (const char **strptr)
{
unsigned int mval = 0, cmval = 0;
u_int8_t retval = 0;
Expand Down Expand Up @@ -686,9 +684,7 @@ precsize_aton(strptr)

/* converts ascii lat/lon to unsigned encoded 32-bit number. moves pointer. */
static u_int32_t
latlon2ul(latlonstrptr,which)
const char **latlonstrptr;
int *which;
latlon2ul (const char **latlonstrptr, int *which)
{
const char *cp;
u_int32_t retval;
Expand Down
Loading

0 comments on commit db0a00d

Please sign in to comment.