From cee246254050beb0770a8ab9cdff03f44c2db3c9 Mon Sep 17 00:00:00 2001 From: jb Date: Fri, 28 Mar 2008 00:28:45 +0000 Subject: Remove the last 3 files I missed. These have been repo copied to the new location under a cddl part of the tree following the core@ license review. --- sys/contrib/opensolaris/common/acl/acl_common.c | 217 --------------------- sys/contrib/opensolaris/common/acl/acl_common.h | 56 ------ .../opensolaris/common/atomic/amd64/atomic.S | 68 ------- 3 files changed, 341 deletions(-) delete mode 100644 sys/contrib/opensolaris/common/acl/acl_common.c delete mode 100644 sys/contrib/opensolaris/common/acl/acl_common.h delete mode 100644 sys/contrib/opensolaris/common/atomic/amd64/atomic.S (limited to 'sys/contrib') diff --git a/sys/contrib/opensolaris/common/acl/acl_common.c b/sys/contrib/opensolaris/common/acl/acl_common.c deleted file mode 100644 index 2f32e7a..0000000 --- a/sys/contrib/opensolaris/common/acl/acl_common.c +++ /dev/null @@ -1,217 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include -#include -#include -#if defined(_KERNEL) -#include -#include -#else -#include -#include -#include -#include -#define ASSERT assert -#endif - - -ace_t trivial_acl[] = { - {-1, 0, ACE_OWNER, ACE_ACCESS_DENIED_ACE_TYPE}, - {-1, ACE_WRITE_ACL|ACE_WRITE_OWNER|ACE_WRITE_ATTRIBUTES| - ACE_WRITE_NAMED_ATTRS, ACE_OWNER, ACE_ACCESS_ALLOWED_ACE_TYPE}, - {-1, 0, ACE_GROUP|ACE_IDENTIFIER_GROUP, ACE_ACCESS_DENIED_ACE_TYPE}, - {-1, 0, ACE_GROUP|ACE_IDENTIFIER_GROUP, ACE_ACCESS_ALLOWED_ACE_TYPE}, - {-1, ACE_WRITE_ACL|ACE_WRITE_OWNER| ACE_WRITE_ATTRIBUTES| - ACE_WRITE_NAMED_ATTRS, ACE_EVERYONE, ACE_ACCESS_DENIED_ACE_TYPE}, - {-1, ACE_READ_ACL|ACE_READ_ATTRIBUTES|ACE_READ_NAMED_ATTRS| - ACE_SYNCHRONIZE, ACE_EVERYONE, ACE_ACCESS_ALLOWED_ACE_TYPE} -}; - - -void -adjust_ace_pair(ace_t *pair, mode_t mode) -{ - if (mode & S_IROTH) - pair[1].a_access_mask |= ACE_READ_DATA; - else - pair[0].a_access_mask |= ACE_READ_DATA; - if (mode & S_IWOTH) - pair[1].a_access_mask |= - ACE_WRITE_DATA|ACE_APPEND_DATA; - else - pair[0].a_access_mask |= - ACE_WRITE_DATA|ACE_APPEND_DATA; - if (mode & S_IXOTH) - pair[1].a_access_mask |= ACE_EXECUTE; - else - pair[0].a_access_mask |= ACE_EXECUTE; -} - -/* - * ace_trivial: - * determine whether an ace_t acl is trivial - * - * Trivialness implys that the acl is composed of only - * owner, group, everyone entries. ACL can't - * have read_acl denied, and write_owner/write_acl/write_attributes - * can only be owner@ entry. - */ -int -ace_trivial(ace_t *acep, int aclcnt) -{ - int i; - int owner_seen = 0; - int group_seen = 0; - int everyone_seen = 0; - - for (i = 0; i != aclcnt; i++) { - switch (acep[i].a_flags & 0xf040) { - case ACE_OWNER: - if (group_seen || everyone_seen) - return (1); - owner_seen++; - break; - case ACE_GROUP|ACE_IDENTIFIER_GROUP: - if (everyone_seen || owner_seen == 0) - return (1); - group_seen++; - break; - - case ACE_EVERYONE: - if (owner_seen == 0 || group_seen == 0) - return (1); - everyone_seen++; - break; - default: - return (1); - - } - - if (acep[i].a_flags & (ACE_FILE_INHERIT_ACE| - ACE_DIRECTORY_INHERIT_ACE|ACE_NO_PROPAGATE_INHERIT_ACE| - ACE_INHERIT_ONLY_ACE)) - return (1); - - /* - * Special check for some special bits - * - * Don't allow anybody to deny reading basic - * attributes or a files ACL. - */ - if ((acep[i].a_access_mask & - (ACE_READ_ACL|ACE_READ_ATTRIBUTES)) && - (acep[i].a_type == ACE_ACCESS_DENIED_ACE_TYPE)) - return (1); - - /* - * Allow on owner@ to allow - * write_acl/write_owner/write_attributes - */ - if (acep[i].a_type == ACE_ACCESS_ALLOWED_ACE_TYPE && - (!(acep[i].a_flags & ACE_OWNER) && (acep[i].a_access_mask & - (ACE_WRITE_OWNER|ACE_WRITE_ACL|ACE_WRITE_ATTRIBUTES)))) - return (1); - } - - if ((owner_seen == 0) || (group_seen == 0) || (everyone_seen == 0)) - return (1); - - return (0); -} - - -/* - * Generic shellsort, from K&R (1st ed, p 58.), somewhat modified. - * v = Ptr to array/vector of objs - * n = # objs in the array - * s = size of each obj (must be multiples of a word size) - * f = ptr to function to compare two objs - * returns (-1 = less than, 0 = equal, 1 = greater than - */ -void -ksort(caddr_t v, int n, int s, int (*f)()) -{ - int g, i, j, ii; - unsigned int *p1, *p2; - unsigned int tmp; - - /* No work to do */ - if (v == NULL || n <= 1) - return; - - /* Sanity check on arguments */ - ASSERT(((uintptr_t)v & 0x3) == 0 && (s & 0x3) == 0); - ASSERT(s > 0); - for (g = n / 2; g > 0; g /= 2) { - for (i = g; i < n; i++) { - for (j = i - g; j >= 0 && - (*f)(v + j * s, v + (j + g) * s) == 1; - j -= g) { - p1 = (void *)(v + j * s); - p2 = (void *)(v + (j + g) * s); - for (ii = 0; ii < s / 4; ii++) { - tmp = *p1; - *p1++ = *p2; - *p2++ = tmp; - } - } - } - } -} - -/* - * Compare two acls, all fields. Returns: - * -1 (less than) - * 0 (equal) - * +1 (greater than) - */ -int -cmp2acls(void *a, void *b) -{ - aclent_t *x = (aclent_t *)a; - aclent_t *y = (aclent_t *)b; - - /* Compare types */ - if (x->a_type < y->a_type) - return (-1); - if (x->a_type > y->a_type) - return (1); - /* Equal types; compare id's */ - if (x->a_id < y->a_id) - return (-1); - if (x->a_id > y->a_id) - return (1); - /* Equal ids; compare perms */ - if (x->a_perm < y->a_perm) - return (-1); - if (x->a_perm > y->a_perm) - return (1); - /* Totally equal */ - return (0); -} diff --git a/sys/contrib/opensolaris/common/acl/acl_common.h b/sys/contrib/opensolaris/common/acl/acl_common.h deleted file mode 100644 index 2227ad7..0000000 --- a/sys/contrib/opensolaris/common/acl/acl_common.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _ACL_ACL_UTILS_H -#define _ACL_ACL_UTILS_H - -#pragma ident "%Z%%M% %I% %E% SMI" - - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -extern ace_t trivial_acl[6]; - -extern int acltrivial(const char *); -extern void adjust_ace_pair(ace_t *pair, mode_t mode); -extern int ace_trivial(ace_t *acep, int aclcnt); -void ksort(caddr_t v, int n, int s, int (*f)()); -int cmp2acls(void *a, void *b); - - - - -#ifdef __cplusplus -} -#endif - -#endif /* _ACL_ACL_UTILS_H */ diff --git a/sys/contrib/opensolaris/common/atomic/amd64/atomic.S b/sys/contrib/opensolaris/common/atomic/amd64/atomic.S deleted file mode 100644 index 2e62aa4..0000000 --- a/sys/contrib/opensolaris/common/atomic/amd64/atomic.S +++ /dev/null @@ -1,68 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .ident "%Z%%M% %I% %E% SMI" - - .file "%M%" - -#define _ASM -#include - - ENTRY(atomic_add_64_nv) - movq (%rdi), %rax -1: - movq %rsi, %rcx - addq %rax, %rcx - lock - cmpxchgq %rcx, (%rdi) - jne 1b - movq %rcx, %rax - ret - SET_SIZE(atomic_add_64_nv) - - ENTRY(atomic_or_8_nv) - movb (%rdi), %al // %al = old value -1: - movb %sil, %cl - orb %al, %cl // %cl = new value - lock - cmpxchgb %cl, (%rdi) // try to stick it in - jne 1b - movzbl %cl, %eax // return new value - ret - SET_SIZE(atomic_or_8_nv) - - ENTRY(atomic_cas_64) - movq %rsi, %rax - lock - cmpxchgq %rdx, (%rdi) - ret - SET_SIZE(atomic_cas_64) - - ENTRY(membar_producer) - sfence - ret - SET_SIZE(membar_producer) -- cgit v1.1