Skip to content
Permalink
Browse files
7805 want faster clock_gettime
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Joshua M. Clulow <jmc@joyent.com>
Reviewed by: Ryan Zezeski <rpz@joyent.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Garrett D'Amore <garrett@damore.org>
  • Loading branch information
pfmooney authored and rmustacc committed Feb 27, 2017
1 parent 2074ce0 commit 2428aad8462660fad2b105777063fea6f4192308
Showing 49 changed files with 1,982 additions and 82 deletions.
@@ -23,7 +23,7 @@
* Use is subject to license terms.
*/
/*
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright 2016 Joyent, Inc.
*/

/*
@@ -818,7 +818,8 @@ static struct aux_id aux_arr[] = {
{ AT_SUN_BRANDNAME, "AT_SUN_BRANDNAME", at_str },
{ AT_SUN_BRAND_AUX1, "AT_SUN_BRAND_AUX1", at_null },
{ AT_SUN_BRAND_AUX2, "AT_SUN_BRAND_AUX2", at_null },
{ AT_SUN_BRAND_AUX3, "AT_SUN_BRAND_AUX3", at_null }
{ AT_SUN_BRAND_AUX3, "AT_SUN_BRAND_AUX3", at_null },
{ AT_SUN_COMMPAGE, "AT_SUN_COMMPAGE", at_null }
};

#define N_AT_ENTS (sizeof (aux_arr) / sizeof (struct aux_id))
@@ -25,7 +25,7 @@
*/
/*
* Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright 2016 Joyent, Inc.
*/

/*
@@ -105,19 +105,20 @@ conv_cnote_auxv_type(Word type, Conv_fmt_flags_t fmt_flags,
static const conv_ds_msg_t ds_types_2000_2011 = {
CONV_DS_MSG_INIT(2000, types_2000_2011) };

static const Msg types_2014_2023[] = {
static const Msg types_2014_2024[] = {
MSG_AUXV_AT_SUN_EXECNAME, MSG_AUXV_AT_SUN_MMU,
MSG_AUXV_AT_SUN_LDDATA, MSG_AUXV_AT_SUN_AUXFLAGS,
MSG_AUXV_AT_SUN_EMULATOR, MSG_AUXV_AT_SUN_BRANDNAME,
MSG_AUXV_AT_SUN_BRAND_AUX1, MSG_AUXV_AT_SUN_BRAND_AUX2,
MSG_AUXV_AT_SUN_BRAND_AUX3, MSG_AUXV_AT_SUN_HWCAP2,
MSG_AUXV_AT_SUN_COMMPAGE
};
static const conv_ds_msg_t ds_types_2014_2023 = {
CONV_DS_MSG_INIT(2014, types_2014_2023) };
static const conv_ds_msg_t ds_types_2014_2024 = {
CONV_DS_MSG_INIT(2014, types_2014_2024) };

static const conv_ds_t *ds[] = {
CONV_DS_ADDR(ds_types_0_22), CONV_DS_ADDR(ds_types_2000_2011),
CONV_DS_ADDR(ds_types_2014_2023), NULL };
CONV_DS_ADDR(ds_types_2014_2024), NULL };

return (conv_map_ds(ELFOSABI_NONE, EM_NONE, type, ds, fmt_flags,
inv_buf));
@@ -24,7 +24,7 @@
# Use is subject to license terms.
#
# Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
# Copyright (c) 2013, Joyent, Inc. All rights reserved.
# Copyright 2016 Joyent, Inc.
#

@ MSG_NT_PRSTATUS "[ NT_PRSTATUS ]"
@@ -101,6 +101,8 @@
@ MSG_AUXV_AT_SUN_BRAND_AUX2 "SUN_BRAND_AUX2"
@ MSG_AUXV_AT_SUN_BRAND_AUX3 "SUN_BRAND_AUX3"
@ MSG_AUXV_AT_SUN_HWCAP2 "SUN_HWCAP2"
@ MSG_AUXV_AT_SUN_COMMPAGE "SUN_COMMPAGE"


@ MSG_CC_CONTENT_STACK "STACK"
@ MSG_CC_CONTENT_HEAP "HEAP"
@@ -22,7 +22,7 @@
/*
* Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2014 Garrett D'Amore <garrett@damore.org>
* Copyright 2015 Joyent, Inc.
* Copyright 2016 Joyent, Inc.
*/

/*
@@ -721,6 +721,21 @@ isalnum(int c)
return ((isalpha(c) || isdigit(c)) ? 1 : 0);
}

#if defined(__i386) || defined(__amd64)
/*
* Instead of utilizing the comm page for clock_gettime, rtld uses the raw
* syscall instead. Doing so decreases the surface of symbols needed from libc
* for a modest performance cost.
*/
extern int __clock_gettime_sys(clockid_t, struct timespec *);

int
__clock_gettime(clockid_t clock_id, struct timespec *tp)
{
return (__clock_gettime_sys(clock_id, tp));
}
#endif /* defined(__i386) || defined(__amd64) */

/*
* In a similar vein to the is* functions above, we also have to define our own
* version of strerror, as it is implemented in terms of the locale aware
@@ -0,0 +1,33 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright 2016 Joyent, Inc.
#

#
# This Makefile is shared between both libc and other consumers
#

COMMPAGE_OBJS = \
cp_subr.o \
cp_main.o

COMMPAGE_OFFSETS_SRC = $(SRC)/lib/commpage/common/offsets.in
COMMPAGE_OFFSETS_H = cp_offsets.h

CLEANFILES += $(COMMPAGE_OFFSETS_H)

pics/cp_main.o := CPPFLAGS += -I$(SRC)/uts/i86pc
pics/cp_subr.o := ASFLAGS += -I$(SRC)/uts/i86pc -I./
$(COMMPAGE_OFFSETS_H) := CPPFLAGS += -I$(SRC)/uts/i86pc

COMMPAGE_CPPFLAGS = -I$(SRC)/lib/commpage/common
@@ -0,0 +1,29 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright 2016 Joyent, Inc.
#

#
# This Makefile is shared between both libc and other consumers
#

pics/%.o: $(SRC)/lib/commpage/common/%.c
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)

pics/%.o: $(SRC)/lib/commpage/$(TARGET_ARCH)/%.s $(COMMPAGE_OFFSETS_H)
$(COMPILE.s) -o $@ $<
$(POST_PROCESS_O)

$(COMMPAGE_OFFSETS_H): $(COMMPAGE_OFFSETS_SRC)
$(OFFSETS_CREATE) <$(COMMPAGE_OFFSETS_SRC) >$@

0 comments on commit 2428aad

Please sign in to comment.