Skip to content

Commit 0ddccd8

Browse files
Darwindas
Darwin
authored andcommitted
1 parent 7f520aa commit 0ddccd8

File tree

1,441 files changed

+125730
-149146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,441 files changed

+125730
-149146
lines changed

.clang-format

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,10 @@ SpaceBeforeAssignmentOperators: true
105105
# Assignment = should be seperated by spaces on both sides.
106106

107107
SpaceBeforeParens: ControlStatements
108-
# for control statements a space is required before '{'
109-
# Bad: for(){ statement; }
110-
# Good: for() { statement; }
108+
# for control statements a space is required before '('
109+
# Bad: for() { statement; }
110+
# Good: for () { statement; }
111+
# This setting distinguishes functions() from keywords like 'if' and 'for'.
111112

112113
SpaceInEmptyParentheses: false
113114
# No spaces required for empty ()

.upstream_base_commits

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#freebsd = https://github.com/freebsd/freebsd.git
2+
bsd/man/man2/access.2 freebsd lib/libc/sys/access.2 5b882020081a138285227631c46a406c08e17bc8
3+
bsd/man/man7/sticky.7 freebsd share/man/man7/sticky.7 5b882020081a138285227631c46a406c08e17bc8

EXTERNAL_HEADERS/Availability.h

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -130,36 +130,43 @@
130130
#define __MAC_10_10_2 101002
131131
#define __MAC_10_10_3 101003
132132
#define __MAC_10_11 101100
133+
#define __MAC_10_12 101200
133134
/* __MAC_NA is not defined to a value but is uses as a token by macros to indicate that the API is unavailable */
134135

135-
#define __IPHONE_2_0 20000
136-
#define __IPHONE_2_1 20100
137-
#define __IPHONE_2_2 20200
138-
#define __IPHONE_3_0 30000
139-
#define __IPHONE_3_1 30100
140-
#define __IPHONE_3_2 30200
141-
#define __IPHONE_4_0 40000
142-
#define __IPHONE_4_1 40100
143-
#define __IPHONE_4_2 40200
144-
#define __IPHONE_4_3 40300
145-
#define __IPHONE_5_0 50000
146-
#define __IPHONE_5_1 50100
147-
#define __IPHONE_6_0 60000
148-
#define __IPHONE_6_1 60100
149-
#define __IPHONE_7_0 70000
150-
#define __IPHONE_7_1 70100
151-
#define __IPHONE_8_0 80000
152-
#define __IPHONE_8_1 80100
153-
#define __IPHONE_8_2 80200
154-
#define __IPHONE_8_3 80300
155-
#define __IPHONE_8_4 80400
156-
#define __IPHONE_9_0 90000
136+
#define __IPHONE_2_0 20000
137+
#define __IPHONE_2_1 20100
138+
#define __IPHONE_2_2 20200
139+
#define __IPHONE_3_0 30000
140+
#define __IPHONE_3_1 30100
141+
#define __IPHONE_3_2 30200
142+
#define __IPHONE_4_0 40000
143+
#define __IPHONE_4_1 40100
144+
#define __IPHONE_4_2 40200
145+
#define __IPHONE_4_3 40300
146+
#define __IPHONE_5_0 50000
147+
#define __IPHONE_5_1 50100
148+
#define __IPHONE_6_0 60000
149+
#define __IPHONE_6_1 60100
150+
#define __IPHONE_7_0 70000
151+
#define __IPHONE_7_1 70100
152+
#define __IPHONE_8_0 80000
153+
#define __IPHONE_8_1 80100
154+
#define __IPHONE_8_2 80200
155+
#define __IPHONE_8_3 80300
156+
#define __IPHONE_8_4 80400
157+
#define __IPHONE_9_0 90000
158+
#define __IPHONE_9_1 90100
159+
#define __IPHONE_9_2 90200
160+
#define __IPHONE_10_0 100000
157161
/* __IPHONE_NA is not defined to a value but is uses as a token by macros to indicate that the API is unavailable */
158162

159-
#define __TVOS_9_0 90000
163+
#define __TVOS_9_0 90000
164+
#define __TVOS_9_2 90200
165+
#define __TVOS_10_0 100000
160166

161-
#define __WATCHOS_1_0 10000
162-
#define __WATCHOS_2_0 20000
167+
#define __WATCHOS_1_0 10000
168+
#define __WATCHOS_2_0 20000
169+
#define __WATCHOS_3_0 30000
163170

164171
#include <AvailabilityInternal.h>
165172

@@ -318,5 +325,8 @@
318325
#define __WATCHOS_DEPRECATED(_start, _dep, _msg)
319326
#endif
320327

328+
#if __has_include(<AvailabilityProhibitedInternal.h>)
329+
#include <AvailabilityProhibitedInternal.h>
330+
#endif
321331

322332
#endif /* __AVAILABILITY__ */

EXTERNAL_HEADERS/AvailabilityInternal.h

Lines changed: 4173 additions & 2 deletions
Large diffs are not rendered by default.

EXTERNAL_HEADERS/AvailabilityMacros.h

Lines changed: 373 additions & 133 deletions
Large diffs are not rendered by default.

EXTERNAL_HEADERS/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
33
export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
44
export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
55

6-
76
include $(MakeInc_cmd)
87
include $(MakeInc_def)
98

@@ -34,7 +33,7 @@ KERNEL_FILES = \
3433
stdbool.h \
3534
stdint.h
3635

37-
INSTALL_MI_LIST =
36+
INSTALL_MI_LIST =
3837

3938
INSTALL_MI_DIR = .
4039

EXTERNAL_HEADERS/architecture/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
33
export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
44
export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
55

6-
76
include $(MakeInc_cmd)
87
include $(MakeInc_def)
98

@@ -21,9 +20,9 @@ INSTINC_SUBDIRS_ARM = \
2120
INSTINC_SUBDIRS_ARM64 = \
2221
arm
2322

24-
EXPORT_FILES =
23+
EXPORT_FILES =
2524

26-
INSTALL_MI_LIST =
25+
INSTALL_MI_LIST =
2726

2827
INSTALL_MI_DIR = architecture
2928

@@ -35,4 +34,3 @@ EXPORT_MI_DIR = architecture
3534

3635
include $(MakeInc_rule)
3736
include $(MakeInc_dir)
38-

EXTERNAL_HEADERS/architecture/i386/Makefile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
33
export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
44
export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
55

6-
76
include $(MakeInc_cmd)
87
include $(MakeInc_def)
98

10-
EXPORT_FILES = \
9+
EXPORT_FILES = \
1110
asm_help.h \
1211
cpu.h \
1312
io.h \
@@ -18,16 +17,13 @@ EXPORT_FILES = \
1817
reg_help.h \
1918
table.h
2019

20+
INSTALL_MD_LIST =
2121

22-
INSTALL_MD_LIST =
23-
24-
INSTALL_MD_DIR =
22+
INSTALL_MD_DIR =
2523

2624
EXPORT_MD_LIST = ${EXPORT_FILES}
2725

2826
EXPORT_MD_DIR = architecture/i386
2927

3028
include $(MakeInc_rule)
3129
include $(MakeInc_dir)
32-
33-

EXTERNAL_HEADERS/corecrypto/cc.h

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,31 @@
2929
The resulting struct can be used to create arrays that are aligned by
3030
a certain amount. */
3131
#define cc_aligned_struct(_alignment_) \
32-
typedef struct { \
33-
uint8_t b[_alignment_]; \
34-
} __attribute__((aligned(_alignment_)))
32+
typedef struct { \
33+
uint8_t b[_alignment_]; \
34+
} CC_ALIGNED(_alignment_)
3535

3636
/* number of array elements used in a cc_ctx_decl */
3737
#define cc_ctx_n(_type_, _size_) ((_size_ + sizeof(_type_) - 1) / sizeof(_type_))
3838

3939
/* sizeof of a context declared with cc_ctx_decl */
4040
#define cc_ctx_sizeof(_type_, _size_) sizeof(_type_[cc_ctx_n(_type_, _size_)])
4141

42-
#define cc_ctx_decl(_type_, _size_, _name_) \
43-
_type_ _name_[cc_ctx_n(_type_, _size_)]
44-
45-
#if CC_HAS_BZERO
46-
#define cc_zero(_size_,_data_) bzero((_data_), (_size_))
42+
//- WARNING: The _MSC_VER version of cc_ctx_decl() is not compatible with the way *_decl macros are used in CommonCrypto, AppleKeyStore and SecurityFrameworks
43+
// to observe the incompatibilities and errors, use below definition. Corecrypto itself, accepts both deinitions
44+
// #define cc_ctx_decl(_type_, _size_, _name_) _type_ _name_ ## _array[cc_ctx_n(_type_, (_size_))]; _type_ *_name_ = _name_ ## _array
45+
//- Never use sizeof() operator for the variables declared with cc_ctx_decl(), because it is not be compatible with the _MSC_VER version of cc_ctx_decl().
46+
#if defined(_MSC_VER)
47+
#define UNIQUE_ARRAY(data_type, _var_, total_count) data_type* _var_ = (data_type*)_alloca(sizeof(data_type)*(total_count));
48+
#define cc_ctx_decl(_type_, _size_, _name_) UNIQUE_ARRAY(_type_, _name_,cc_ctx_n(_type_, (_size_)))
4749
#else
48-
/* Alternate version if you don't have bzero. */
49-
#define cc_zero(_size_,_data_) memset((_data_),0 ,(_size_))
50+
#define cc_ctx_decl(_type_, _size_, _name_) _type_ _name_ [cc_ctx_n(_type_, _size_)]
5051
#endif
5152

53+
/* bzero is deprecated. memset is the way to go */
54+
/* FWIW, L4, HEXAGON and ARMCC even with gnu compatibility mode don't have bzero */
55+
#define cc_zero(_size_,_data_) memset((_data_),0 ,(_size_))
56+
5257
/* cc_clear:
5358
Set "len" bytes of memory to zero at address "dst".
5459
cc_clear has been developed so that it won't be optimized out.
@@ -69,19 +74,17 @@ void cc_xor(size_t size, void *r, const void *s, const void *t) {
6974
}
7075
}
7176

72-
/* cc_cmp_safe:
73-
Compare "num" pointed by ptr1 and ptr2, array of identical size.
74-
Functional behavior: Returns 0 if the "num" bytes starting at ptr1 are identical to the "num"
75-
bytes starting at ptr2.
76-
Return !=0 if they are different or if "num" is 0 (empty arrays)
77-
Security: The execution time/cycles is *independent* of the data and therefore guarantees
78-
no leak about the data.
79-
However, the execution time depends on "num".
80-
*/
77+
/*!
78+
@brief cc_cmp_safe(num, pt1, pt2) compares two array ptr1 and ptr2 of num bytes.
79+
@discussion The execution time/cycles is independent of the data and therefore guarantees no leak about the data. However, the execution time depends on num.
80+
@param num number of bytes in each array
81+
@param ptr1 input array
82+
@param ptr2 input array
83+
@return returns 0 if the num bytes starting at ptr1 are identical to the num bytes starting at ptr2 and 1 if they are different or if num is 0 (empty arrays).
84+
*/
8185
CC_NONNULL2 CC_NONNULL3
8286
int cc_cmp_safe (size_t num, const void * ptr1, const void * ptr2);
8387

84-
8588
/* Exchange S and T of any type. NOTE: Both and S and T are evaluated
8689
mutliple times and MUST NOT be expressions. */
8790
#define CC_SWAP(S,T) do { \

0 commit comments

Comments
 (0)