1dba28784SAugustin Cavalier /* 2dba28784SAugustin Cavalier * Copyright 2012, Jérôme Duval, korli@users.berlios.de. 38267c193SAugustin Cavalier * Copyright 2018, Haiku, Inc. 4dba28784SAugustin Cavalier * All rights reserved. Distributed under the terms of the MIT License. 5dba28784SAugustin Cavalier */ 6dba28784SAugustin Cavalier 7dba28784SAugustin Cavalier extern "C" { 8dba28784SAugustin Cavalier #include <compat/sys/systm.h> 9dba28784SAugustin Cavalier #include <compat/sys/kernel.h> 10dba28784SAugustin Cavalier } 11dba28784SAugustin Cavalier 12dba28784SAugustin Cavalier #include <thread.h> 13dba28784SAugustin Cavalier 14dba28784SAugustin Cavalier 15dba28784SAugustin Cavalier int _pause(const char * waitMessage,int timeout)16dba28784SAugustin Cavalier_pause(const char* waitMessage, int timeout) 17dba28784SAugustin Cavalier { 18dba28784SAugustin Cavalier KASSERT(timeout != 0, ("pause: timeout required")); 19*c70ec71dSAugustin Cavalier return snooze(TICKS_2_USEC(timeout)); 20dba28784SAugustin Cavalier } 21dba28784SAugustin Cavalier 22dba28784SAugustin Cavalier 23dba28784SAugustin Cavalier void critical_enter(void)24dba28784SAugustin Cavaliercritical_enter(void) 25dba28784SAugustin Cavalier { 26dba28784SAugustin Cavalier thread_pin_to_current_cpu(thread_get_current_thread()); 27dba28784SAugustin Cavalier } 28dba28784SAugustin Cavalier 29dba28784SAugustin Cavalier 30dba28784SAugustin Cavalier void critical_exit(void)31dba28784SAugustin Cavaliercritical_exit(void) 32dba28784SAugustin Cavalier { 33dba28784SAugustin Cavalier thread_unpin_from_current_cpu(thread_get_current_thread()); 34dba28784SAugustin Cavalier } 35dba28784SAugustin Cavalier 36dba28784SAugustin Cavalier 37dba28784SAugustin Cavalier void freeenv(char * env)38dba28784SAugustin Cavalierfreeenv(char *env) 39dba28784SAugustin Cavalier { 40dba28784SAugustin Cavalier } 41dba28784SAugustin Cavalier 42dba28784SAugustin Cavalier 43dba28784SAugustin Cavalier char * getenv(const char * name)44dba28784SAugustin Cavaliergetenv(const char *name) 45dba28784SAugustin Cavalier { 46dba28784SAugustin Cavalier return NULL; 47dba28784SAugustin Cavalier } 48dba28784SAugustin Cavalier 49dba28784SAugustin Cavalier 50dba28784SAugustin Cavalier char * kern_getenv(const char * name)51dba28784SAugustin Cavalierkern_getenv(const char *name) 52dba28784SAugustin Cavalier { 53dba28784SAugustin Cavalier return NULL; 54dba28784SAugustin Cavalier } 55dba28784SAugustin Cavalier 56