-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
170 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* Copyright (C) 1991-2018 Free Software Foundation, Inc. | ||
This file is part of the GNU C Library. | ||
The GNU C Library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
The GNU C Library 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 | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with the GNU C Library; if not, see | ||
<http://www.gnu.org/licenses/>. */ | ||
|
||
#ifndef _SIGNAL_H | ||
#define _SIGNAL_H | ||
|
||
#define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) | ||
typedef struct | ||
{ | ||
unsigned long int __val[_SIGSET_NWORDS]; | ||
} __sigset_t; | ||
|
||
typedef __sigset_t sigset_t; | ||
|
||
struct sigaction | ||
{ | ||
/* Signal handler. */ | ||
#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED | ||
union | ||
{ | ||
/* Used if SA_SIGINFO is not set. */ | ||
void (*sa_handler) (int); | ||
/* Used if SA_SIGINFO is set. */ | ||
void (*sa_sigaction) (int, siginfo_t *, void *); | ||
} | ||
__sigaction_handler; | ||
#define sa_handler __sigaction_handler.sa_handler | ||
#define sa_sigaction __sigaction_handler.sa_sigaction | ||
#else | ||
void (*sa_handler) (int); | ||
#endif | ||
|
||
/* Additional set of signals to be blocked. */ | ||
__sigset_t sa_mask; | ||
|
||
/* Special flags. */ | ||
int sa_flags; | ||
|
||
/* Restore handler. */ | ||
void (*sa_restorer) (void); | ||
}; | ||
|
||
#define __SI_MAX_SIZE 128 | ||
#define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) | ||
|
||
typedef struct | ||
{ | ||
int si_signo; /* Signal number. */ | ||
|
||
int si_errno; /* If non-zero, an errno value associated with | ||
this signal, as defined in <errno.h>. */ | ||
int si_code; /* Signal code. */ | ||
|
||
int __pad0; | ||
int _pad[__SI_PAD_SIZE]; | ||
} siginfo_t; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
enclave { | ||
|
||
trusted { | ||
/* define ECALLs here. */ | ||
|
||
}; | ||
|
||
untrusted { | ||
int u_getpid_ocall(); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
enclave { | ||
include "signal.h" | ||
|
||
trusted { | ||
/* define ECALLs here. */ | ||
public int t_signal_handler_ecall([in]const siginfo_t *info); | ||
}; | ||
|
||
untrusted { | ||
int u_sigaction_ocall([out]int *error, | ||
int signum, | ||
[in] const struct sigaction *act, | ||
[out] struct sigaction *oldact, | ||
uint64_t enclave_id); | ||
|
||
int u_sigprocmask_ocall([out]int *error, | ||
int signum, | ||
[in] const sigset_t *set, | ||
[out] sigset_t *oldset); | ||
|
||
int u_raise_ocall(int signum) allow(t_signal_handler_ecall); | ||
|
||
void u_signal_clear_ocall(uint64_t enclave_id); | ||
}; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters