Andrew Scull | 8d9e121 | 2019-04-05 13:52:55 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 The Hafnium Authors. |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #pragma once |
| 18 | |
| 19 | #include "hf/arch/std.h" |
Andrew Scull | 2b5fbad | 2019-04-05 13:55:56 +0100 | [diff] [blame] | 20 | |
| 21 | typedef size_t rsize_t; |
| 22 | |
| 23 | #define RSIZE_MAX SIZE_MAX |
| 24 | |
| 25 | /* |
| 26 | * Only the safer versions of these functions are exposed to reduce the chance |
| 27 | * of misusing the versions without bounds checking or null pointer checks. |
| 28 | * |
| 29 | * These functions don't return errno_t as per the specification and implicity |
| 30 | * have a constraint handler that panics. |
| 31 | */ |
| 32 | void memset_s(void *dest, rsize_t destsz, int ch, rsize_t count); |
Andrew Scull | a1aa2ba | 2019-04-05 11:49:02 +0100 | [diff] [blame^] | 33 | void memcpy_s(void *dest, rsize_t destsz, const void *src, rsize_t count); |