Skip to content

Commit

Permalink
xnu-3789.1.32
Browse files Browse the repository at this point in the history
  • Loading branch information
Darwin authored and das committed Jun 4, 2017
1 parent 7f520aa commit 0ddccd8
Show file tree
Hide file tree
Showing 1,441 changed files with 125,730 additions and 149,146 deletions.
7 changes: 4 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@ SpaceBeforeAssignmentOperators: true
# Assignment = should be seperated by spaces on both sides.

SpaceBeforeParens: ControlStatements
# for control statements a space is required before '{'
# Bad: for(){ statement; }
# Good: for() { statement; }
# for control statements a space is required before '('
# Bad: for() { statement; }
# Good: for () { statement; }
# This setting distinguishes functions() from keywords like 'if' and 'for'.

SpaceInEmptyParentheses: false
# No spaces required for empty ()
Expand Down
3 changes: 3 additions & 0 deletions .upstream_base_commits
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#freebsd = https://github.com/freebsd/freebsd.git
bsd/man/man2/access.2 freebsd lib/libc/sys/access.2 5b882020081a138285227631c46a406c08e17bc8
bsd/man/man7/sticky.7 freebsd share/man/man7/sticky.7 5b882020081a138285227631c46a406c08e17bc8
60 changes: 35 additions & 25 deletions EXTERNAL_HEADERS/Availability.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,36 +130,43 @@
#define __MAC_10_10_2 101002
#define __MAC_10_10_3 101003
#define __MAC_10_11 101100
#define __MAC_10_12 101200
/* __MAC_NA is not defined to a value but is uses as a token by macros to indicate that the API is unavailable */

#define __IPHONE_2_0 20000
#define __IPHONE_2_1 20100
#define __IPHONE_2_2 20200
#define __IPHONE_3_0 30000
#define __IPHONE_3_1 30100
#define __IPHONE_3_2 30200
#define __IPHONE_4_0 40000
#define __IPHONE_4_1 40100
#define __IPHONE_4_2 40200
#define __IPHONE_4_3 40300
#define __IPHONE_5_0 50000
#define __IPHONE_5_1 50100
#define __IPHONE_6_0 60000
#define __IPHONE_6_1 60100
#define __IPHONE_7_0 70000
#define __IPHONE_7_1 70100
#define __IPHONE_8_0 80000
#define __IPHONE_8_1 80100
#define __IPHONE_8_2 80200
#define __IPHONE_8_3 80300
#define __IPHONE_8_4 80400
#define __IPHONE_9_0 90000
#define __IPHONE_2_0 20000
#define __IPHONE_2_1 20100
#define __IPHONE_2_2 20200
#define __IPHONE_3_0 30000
#define __IPHONE_3_1 30100
#define __IPHONE_3_2 30200
#define __IPHONE_4_0 40000
#define __IPHONE_4_1 40100
#define __IPHONE_4_2 40200
#define __IPHONE_4_3 40300
#define __IPHONE_5_0 50000
#define __IPHONE_5_1 50100
#define __IPHONE_6_0 60000
#define __IPHONE_6_1 60100
#define __IPHONE_7_0 70000
#define __IPHONE_7_1 70100
#define __IPHONE_8_0 80000
#define __IPHONE_8_1 80100
#define __IPHONE_8_2 80200
#define __IPHONE_8_3 80300
#define __IPHONE_8_4 80400
#define __IPHONE_9_0 90000
#define __IPHONE_9_1 90100
#define __IPHONE_9_2 90200
#define __IPHONE_10_0 100000
/* __IPHONE_NA is not defined to a value but is uses as a token by macros to indicate that the API is unavailable */

#define __TVOS_9_0 90000
#define __TVOS_9_0 90000
#define __TVOS_9_2 90200
#define __TVOS_10_0 100000

#define __WATCHOS_1_0 10000
#define __WATCHOS_2_0 20000
#define __WATCHOS_1_0 10000
#define __WATCHOS_2_0 20000
#define __WATCHOS_3_0 30000

#include <AvailabilityInternal.h>

Expand Down Expand Up @@ -318,5 +325,8 @@
#define __WATCHOS_DEPRECATED(_start, _dep, _msg)
#endif

#if __has_include(<AvailabilityProhibitedInternal.h>)
#include <AvailabilityProhibitedInternal.h>
#endif

#endif /* __AVAILABILITY__ */
4,175 changes: 4,173 additions & 2 deletions EXTERNAL_HEADERS/AvailabilityInternal.h

Large diffs are not rendered by default.

506 changes: 373 additions & 133 deletions EXTERNAL_HEADERS/AvailabilityMacros.h

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions EXTERNAL_HEADERS/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir


include $(MakeInc_cmd)
include $(MakeInc_def)

Expand Down Expand Up @@ -34,7 +33,7 @@ KERNEL_FILES = \
stdbool.h \
stdint.h

INSTALL_MI_LIST =
INSTALL_MI_LIST =

INSTALL_MI_DIR = .

Expand Down
6 changes: 2 additions & 4 deletions EXTERNAL_HEADERS/architecture/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir


include $(MakeInc_cmd)
include $(MakeInc_def)

Expand All @@ -21,9 +20,9 @@ INSTINC_SUBDIRS_ARM = \
INSTINC_SUBDIRS_ARM64 = \
arm

EXPORT_FILES =
EXPORT_FILES =

INSTALL_MI_LIST =
INSTALL_MI_LIST =

INSTALL_MI_DIR = architecture

Expand All @@ -35,4 +34,3 @@ EXPORT_MI_DIR = architecture

include $(MakeInc_rule)
include $(MakeInc_dir)

10 changes: 3 additions & 7 deletions EXTERNAL_HEADERS/architecture/i386/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir


include $(MakeInc_cmd)
include $(MakeInc_def)

EXPORT_FILES = \
EXPORT_FILES = \
asm_help.h \
cpu.h \
io.h \
Expand All @@ -18,16 +17,13 @@ EXPORT_FILES = \
reg_help.h \
table.h

INSTALL_MD_LIST =

INSTALL_MD_LIST =

INSTALL_MD_DIR =
INSTALL_MD_DIR =

EXPORT_MD_LIST = ${EXPORT_FILES}

EXPORT_MD_DIR = architecture/i386

include $(MakeInc_rule)
include $(MakeInc_dir)


43 changes: 23 additions & 20 deletions EXTERNAL_HEADERS/corecrypto/cc.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,31 @@
The resulting struct can be used to create arrays that are aligned by
a certain amount. */
#define cc_aligned_struct(_alignment_) \
typedef struct { \
uint8_t b[_alignment_]; \
} __attribute__((aligned(_alignment_)))
typedef struct { \
uint8_t b[_alignment_]; \
} CC_ALIGNED(_alignment_)

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

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

#define cc_ctx_decl(_type_, _size_, _name_) \
_type_ _name_[cc_ctx_n(_type_, _size_)]

#if CC_HAS_BZERO
#define cc_zero(_size_,_data_) bzero((_data_), (_size_))
//- WARNING: The _MSC_VER version of cc_ctx_decl() is not compatible with the way *_decl macros are used in CommonCrypto, AppleKeyStore and SecurityFrameworks
// to observe the incompatibilities and errors, use below definition. Corecrypto itself, accepts both deinitions
// #define cc_ctx_decl(_type_, _size_, _name_) _type_ _name_ ## _array[cc_ctx_n(_type_, (_size_))]; _type_ *_name_ = _name_ ## _array
//- 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().
#if defined(_MSC_VER)
#define UNIQUE_ARRAY(data_type, _var_, total_count) data_type* _var_ = (data_type*)_alloca(sizeof(data_type)*(total_count));
#define cc_ctx_decl(_type_, _size_, _name_) UNIQUE_ARRAY(_type_, _name_,cc_ctx_n(_type_, (_size_)))
#else
/* Alternate version if you don't have bzero. */
#define cc_zero(_size_,_data_) memset((_data_),0 ,(_size_))
#define cc_ctx_decl(_type_, _size_, _name_) _type_ _name_ [cc_ctx_n(_type_, _size_)]
#endif

/* bzero is deprecated. memset is the way to go */
/* FWIW, L4, HEXAGON and ARMCC even with gnu compatibility mode don't have bzero */
#define cc_zero(_size_,_data_) memset((_data_),0 ,(_size_))

/* cc_clear:
Set "len" bytes of memory to zero at address "dst".
cc_clear has been developed so that it won't be optimized out.
Expand All @@ -69,19 +74,17 @@ void cc_xor(size_t size, void *r, const void *s, const void *t) {
}
}

/* cc_cmp_safe:
Compare "num" pointed by ptr1 and ptr2, array of identical size.
Functional behavior: Returns 0 if the "num" bytes starting at ptr1 are identical to the "num"
bytes starting at ptr2.
Return !=0 if they are different or if "num" is 0 (empty arrays)
Security: The execution time/cycles is *independent* of the data and therefore guarantees
no leak about the data.
However, the execution time depends on "num".
*/
/*!
@brief cc_cmp_safe(num, pt1, pt2) compares two array ptr1 and ptr2 of num bytes.
@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.
@param num number of bytes in each array
@param ptr1 input array
@param ptr2 input array
@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).
*/
CC_NONNULL2 CC_NONNULL3
int cc_cmp_safe (size_t num, const void * ptr1, const void * ptr2);


/* Exchange S and T of any type. NOTE: Both and S and T are evaluated
mutliple times and MUST NOT be expressions. */
#define CC_SWAP(S,T) do { \
Expand Down
Loading

0 comments on commit 0ddccd8

Please sign in to comment.