[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH 4/7] lib/nolibc: Add type definitions for timer support


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Thu, 5 Apr 2018 19:00:37 +0300
  • Cc: simon.kuenzer@xxxxxxxxx
  • Delivery-date: Thu, 05 Apr 2018 16:00:54 +0000
  • Ironport-phdr: 9a23:+7c7hRQjrwncbFcgqkg42CpojNpsv+yvbD5Q0YIujvd0So/mwa6yZBKN2/xhgRfzUJnB7Loc0qyK6/umATRIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfb1/IA+qoQnNq8IbnZZsJqEtxxXTv3BGYf5WxWRmJVKSmxbz+MK994N9/ipTpvws6ddOXb31cKokQ7NYCi8mM30u683wqRbDVwqP6WACXWgQjxFFHhLK7BD+Xpf2ryv6qu9w0zSUMMHqUbw5Xymp4qF2QxHqlSgHLSY0/mHJhMJtgqxVoxWvqB5xw4PPfI2ZKOBzcr/HcN8GWWZMWNtaWSxbAoO7aosCF/QMPeFDr4nhplsOqwa1Cw+xBOP31z9Dm3j70rE90+Q6DQHG3QogE8gKsHTJtNX1KbwfXvyuzKXS1TXDcuhZ1S3n6IjPax0sp+yHU7FoccfJ1EUiGB7Jgk+TpIHlJT+ZyPoBvmqB4+duTe6jlmEqpxxrrjWsxsogkJfFi4wbx1ze6Cl0z5g5KNulQ0Bhe9GkCoFftySCOotzRcMtXn9ntT4hyr0DpZ67ZC8KyIk7xxLHa/yIbYyI4hX7WeaPJDd3nnNleLalixmu6kis0PX8VtSv31pQtCpFlcHAtnEL1xPN9siKUuZx80i81TqV1A3e6vtILV4qmafZMZIszKY8lp8JvkTCGi/2ll/2jKiTdkg85ueo7P/nYqnnpp+aLYN0jhz+MrwzmsGkHes4KRICX3CG+eunzrHj50r5TK1QjvIqiqnZrIzaJcMDq668Ag9V1Icj6xGkDzu/zdsXg2cHI0xBeB+ci4jpOkrOIOzjDfuljFWjjjFry+rBPr37DZXHNmLDn6v5fbZh905czxI+zcte55JRDbEBJuj/WkzstNPGCB84MhK7w/z8BdV7yIwRRWaPDbWCP6/Ir1CI+7FnH+7ZYY4TuTHmbvQo+fPqpXs4gkMGO7mk290Qcn/rMO5hJhCyZmHwg9FJNXoSo0JqR+vxlFyEFzpOf2uaVLl6/iwxTpihW9SQDruxiaCMiX/oVqZdYXpLXwiB
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

Add missing types for timer support with nolibc.

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 lib/nolibc/include/sys/select.h   |  5 +++-
 lib/nolibc/include/sys/time.h     |  8 ++-----
 lib/nolibc/include/sys/timespec.h | 50 +++++++++++++++++++++++++++++++++++++++
 lib/nolibc/include/sys/types.h    |  6 +++++
 4 files changed, 62 insertions(+), 7 deletions(-)
 create mode 100644 lib/nolibc/include/sys/timespec.h

diff --git a/lib/nolibc/include/sys/select.h b/lib/nolibc/include/sys/select.h
index b5c389b..c0b254e 100644
--- a/lib/nolibc/include/sys/select.h
+++ b/lib/nolibc/include/sys/select.h
@@ -32,12 +32,15 @@
 #ifndef __SYS_SELECT_H__
 #define __SYS_SELECT_H__
 
-#include <sys/time.h>
+#include <sys/timespec.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+
+typedef unsigned long sigset_t;
+
 typedef unsigned long __fd_mask;
 
 /*
diff --git a/lib/nolibc/include/sys/time.h b/lib/nolibc/include/sys/time.h
index 3c45581..1eeea10 100644
--- a/lib/nolibc/include/sys/time.h
+++ b/lib/nolibc/include/sys/time.h
@@ -42,13 +42,9 @@
 extern "C" {
 #endif
 
-typedef long time_t;
-typedef long suseconds_t;
+#include <sys/timespec.h>
 
-struct timespec {
-       time_t      tv_sec;
-       long        tv_nsec;
-};
+typedef long suseconds_t;
 
 struct timezone;
 
diff --git a/lib/nolibc/include/sys/timespec.h 
b/lib/nolibc/include/sys/timespec.h
new file mode 100644
index 0000000..89f1ef5
--- /dev/null
+++ b/lib/nolibc/include/sys/timespec.h
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Authors: Costin Lupu <costin.lupu@xxxxxxxxx>
+ *
+ * Copyright (c) 2018, NEC Europe Ltd., NEC Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holder nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
+ */
+
+#ifndef __SYS_TIMESPEC_H__
+#define __SYS_TIMESPEC_H__
+
+typedef long time_t;
+
+struct timespec {
+       time_t      tv_sec;
+       long        tv_nsec;
+};
+
+struct itimerspec {
+       struct timespec  it_interval;
+       struct timespec  it_value;
+};
+
+#endif /* __SYS_TIMESPEC_H__ */
diff --git a/lib/nolibc/include/sys/types.h b/lib/nolibc/include/sys/types.h
index 1d61dc6..8383a9c 100644
--- a/lib/nolibc/include/sys/types.h
+++ b/lib/nolibc/include/sys/types.h
@@ -47,6 +47,12 @@ typedef __sz   size_t;
 typedef __ssz  ssize_t;
 typedef __off  off_t;
 
+#include <sys/select.h>
+
+typedef        unsigned long clockid_t;
+
+typedef        unsigned long timer_t;
+
 #ifdef __cplusplus
 }
 #endif
-- 
2.1.4


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.