mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
Make this thread-safe in both libc as well as libc_r.
This commit is contained in:
parent
9e0370f742
commit
f4086bc0cb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=36823
1 changed files with 2 additions and 13 deletions
|
@ -1,4 +1,5 @@
|
|||
/* $NetBSD: cerror.S,v 1.4 1996/11/08 00:52:46 cgd Exp $ */
|
||||
/* $Id$ */
|
||||
/* From: NetBSD: cerror.S,v 1.4 1996/11/08 00:52:46 cgd Exp */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
|
@ -29,21 +30,14 @@
|
|||
|
||||
#include "SYS.h"
|
||||
|
||||
#ifdef _REENTRANT
|
||||
#define FRAME_SIZE 16
|
||||
#define FRAME_RA_OFFSET 0
|
||||
#define FRAME_V0_OFFSET 8
|
||||
#endif
|
||||
|
||||
#ifdef _REENTRANT
|
||||
NESTED(cerror, 0, FRAME_SIZE, ra, IM_RA|IM_V0, 0)
|
||||
#else
|
||||
LEAF(cerror, 0)
|
||||
#endif
|
||||
br t0, L1
|
||||
L1: LDGP(t0)
|
||||
|
||||
#ifdef _REENTRANT
|
||||
lda sp, -FRAME_SIZE(sp)
|
||||
stq ra, FRAME_RA_OFFSET(sp)
|
||||
stq v0, FRAME_V0_OFFSET(sp)
|
||||
|
@ -52,14 +46,9 @@ L1: LDGP(t0)
|
|||
|
||||
ldq t0, FRAME_V0_OFFSET(sp)
|
||||
stl t0, 0(v0)
|
||||
#else
|
||||
stl v0, errno
|
||||
#endif
|
||||
|
||||
ldiq v0, -1
|
||||
#ifdef _REENTRANT
|
||||
ldq ra, FRAME_RA_OFFSET(sp)
|
||||
lda sp, FRAME_SIZE(sp)
|
||||
#endif
|
||||
RET
|
||||
END(cerror)
|
||||
|
|
Loading…
Reference in a new issue