Skip to content

Commit

Permalink
xnu-1699.32.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Darwin authored and das committed Jun 4, 2017
1 parent eba9946 commit a625e9d
Show file tree
Hide file tree
Showing 47 changed files with 2,040 additions and 1,270 deletions.
29 changes: 29 additions & 0 deletions bsd/dev/i386/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,24 @@ cpu_extfeatures SYSCTL_HANDLER_ARGS
return SYSCTL_OUT(req, buf, strlen(buf) + 1);
}

static int
cpu_leaf7_features SYSCTL_HANDLER_ARGS
{
__unused struct sysctl_oid *unused_oidp = oidp;
__unused void *unused_arg1 = arg1;
__unused int unused_arg2 = arg2;
char buf[512];

uint32_t leaf7_features = cpuid_info()->cpuid_leaf7_features;
if (leaf7_features == 0)
return ENOENT;

buf[0] = '\0';
cpuid_get_leaf7_feature_names(leaf7_features, buf, sizeof(buf));

return SYSCTL_OUT(req, buf, strlen(buf) + 1);
}

static int
cpu_logical_per_package SYSCTL_HANDLER_ARGS
{
Expand Down Expand Up @@ -305,6 +323,12 @@ SYSCTL_PROC(_machdep_cpu, OID_AUTO, feature_bits, CTLTYPE_QUAD | CTLFLAG_RD | CT
(void *)offsetof(i386_cpu_info_t, cpuid_features), sizeof(uint64_t),
i386_cpu_info, "IU", "CPU features");

SYSCTL_PROC(_machdep_cpu, OID_AUTO, leaf7_feature_bits,
CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_LOCKED,
(void *)offsetof(i386_cpu_info_t, cpuid_leaf7_features),
sizeof(uint32_t),
i386_cpu_info_nonzero, "IU", "CPU Leaf7 features");

SYSCTL_PROC(_machdep_cpu, OID_AUTO, extfeature_bits, CTLTYPE_QUAD | CTLFLAG_RD | CTLFLAG_LOCKED,
(void *)offsetof(i386_cpu_info_t, cpuid_extfeatures), sizeof(uint64_t),
i386_cpu_info, "IU", "CPU extended features");
Expand All @@ -321,6 +345,11 @@ SYSCTL_PROC(_machdep_cpu, OID_AUTO, features, CTLTYPE_STRING | CTLFLAG_RD | CTLF
0, 0,
cpu_features, "A", "CPU feature names");

SYSCTL_PROC(_machdep_cpu, OID_AUTO, leaf7_features,
CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_LOCKED,
0, 0,
cpu_leaf7_features, "A", "CPU Leaf7 feature names");

SYSCTL_PROC(_machdep_cpu, OID_AUTO, extfeatures, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_LOCKED,
0, 0,
cpu_extfeatures, "A", "CPU extended feature names");
Expand Down
24 changes: 23 additions & 1 deletion bsd/hfs/hfs_btreeio.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000-2010 Apple Inc. All rights reserved.
* Copyright (c) 2000-2011 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
Expand Down Expand Up @@ -55,6 +55,28 @@ static int btree_journal_modify_block_end(struct hfsmount *hfsmp, struct buf *bp

void btree_swap_node(struct buf *bp, __unused void *arg);

/*
* Return btree node size for given vnode.
*
* Returns:
* For btree vnode, returns btree node size.
* For non-btree vnodes, returns 0.
*/
u_int16_t get_btree_nodesize(struct vnode *vp)
{
BTreeControlBlockPtr btree;
u_int16_t node_size = 0;

if (vnode_issystem(vp)) {
btree = (BTreeControlBlockPtr) VTOF(vp)->fcbBTCBPtr;
if (btree) {
node_size = btree->nodeSize;
}
}

return node_size;
}

OSStatus SetBTreeBlockSize(FileReference vp, ByteCount blockSize, __unused ItemCount minBlockCount)
{
BTreeControlBlockPtr bTreePtr;
Expand Down
4 changes: 3 additions & 1 deletion bsd/hfs/hfs_btreeio.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
* Copyright (c) 2005-2011 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
Expand Down Expand Up @@ -52,6 +52,8 @@ extern void ModifyBlockStart(FileReference vp, BlockDescPtr blockPtr);

int hfs_create_attr_btree(struct hfsmount *hfsmp, u_int32_t nodesize, u_int32_t nodecnt);

u_int16_t get_btree_nodesize(struct vnode *vp);

#endif /* __APPLE_API_PRIVATE */
#endif /* KERNEL */
#endif /* ! _HFS_BTREEIO_H_ */
Loading

0 comments on commit a625e9d

Please sign in to comment.