diff options
author | Agustina Arzille <avarzille@riseup.net> | 2016-04-04 19:16:31 -0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-04-15 18:17:59 +0200 |
commit | 2e69ebf6999102c27c21615b610400a0d922e8c9 (patch) | |
tree | f74126f2e1b0902bf866400940b19ddb932b1d6f /kern/gsync.h | |
parent | 962d56bd3720f10e38ee48df8654c5a6d413a394 (diff) | |
download | gnumach-2e69ebf6999102c27c21615b610400a0d922e8c9.tar.gz gnumach-2e69ebf6999102c27c21615b610400a0d922e8c9.tar.bz2 gnumach-2e69ebf6999102c27c21615b610400a0d922e8c9.zip |
Lightweight synchronization mechanism
* Makefrag.am (libkernel_a_SOURCES): Add kern/gsync.c and kern/gsync.h.
* include/mach/gnumach.defs (gsync_wait, gsync_wake, gsync_requeue): New
routines.
* include/mach/kern_return.h (KERN_TIMEDOUT, KERN_INTERRUPTED): New error
codes.
* kern/gsync.c: New file.
* kern/gsync.h: New file.
* kern/startup.c: Include <kern/gsync.h>
(setup_main): Call gsync_setup.
Diffstat (limited to 'kern/gsync.h')
-rw-r--r-- | kern/gsync.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/kern/gsync.h b/kern/gsync.h new file mode 100644 index 00000000..aafb6495 --- /dev/null +++ b/kern/gsync.h @@ -0,0 +1,41 @@ +/* Copyright (C) 2016 Free Software Foundation, Inc. + Contributed by Agustina Arzille <avarzille@riseup.net>, 2016. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either + version 3 of the license, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, see + <http://www.gnu.org/licenses/>. +*/ + +#ifndef _KERN_GSYNC_H_ +#define _KERN_GSYNC_H_ 1 + +#define GSYNC_SHARED 0x01 +#define GSYNC_QUAD 0x02 +#define GSYNC_TIMED 0x04 +#define GSYNC_BROADCAST 0x08 +#define GSYNC_MUTATE 0x10 + +#include <mach/mach_types.h> + +void gsync_setup (void); + +kern_return_t gsync_wait (task_t task, vm_offset_t addr, + unsigned int lo, unsigned int hi, natural_t msec, int flags); + +kern_return_t gsync_wake (task_t task, + vm_offset_t addr, unsigned int val, int flags); + +kern_return_t gsync_requeue (task_t task, vm_offset_t src_addr, + vm_offset_t dst_addr, boolean_t wake_one, int flags); + +#endif |