Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/include/linux kernel.h and list.h have...



details:   https://anonhg.NetBSD.org/src/rev/5be6a9747f32
branches:  trunk
changeset: 328358:5be6a9747f32
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Apr 01 15:10:23 2014 +0000

description:
kernel.h and list.h have already been moved to external/bsd/common.

With apologies to future revision control systems for not making it
clear this is effectively a rename.

diffstat:

 sys/external/bsd/drm2/include/linux/kernel.h |  118 ------------
 sys/external/bsd/drm2/include/linux/list.h   |  263 ---------------------------
 2 files changed, 0 insertions(+), 381 deletions(-)

diffs (truncated from 389 to 300 lines):

diff -r aef8d274e47e -r 5be6a9747f32 sys/external/bsd/drm2/include/linux/kernel.h
--- a/sys/external/bsd/drm2/include/linux/kernel.h      Tue Apr 01 15:08:58 2014 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-/*     $NetBSD: kernel.h,v 1.3 2014/03/21 02:25:05 riastradh Exp $     */
-
-/*-
- * Copyright (c) 2013 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Taylor R. Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _LINUX_KERNEL_H_
-#define _LINUX_KERNEL_H_
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <sys/param.h>
-
-#define        __printf        __printflike
-#define        __user
-#define        __must_check    /* __attribute__((warn_unused_result)), if GCC */
-#define        __always_unused __unused
-
-#define        barrier()       __insn_barrier()
-#define        unlikely(X)     __predict_false(X)
-
-/*
- * XXX Linux kludge to work around GCC uninitialized variable warning.
- * Linux does `x = x', which is bollocks.
- */
-#define        uninitialized_var(x)    x = 0
-
-/* XXX These will multiply evaluate their arguments.  */
-#define        max_t(T, X, Y)  MAX(X, Y)
-#define        min_t(T, X, Y)  MIN(X, Y)
-
-/*
- * Rounding to nearest.
- */
-#define        DIV_ROUND_CLOSEST(N, D)                                         \
-       ((0 < (N)) ? (((N) + ((D) / 2)) / (D))                          \
-           : (((N) - ((D) / 2)) / (D)))
-
-/*
- * Rounding to what may or may not be powers of two.
- */
-#define        DIV_ROUND_UP(X, N)      (((X) + (N) - 1) / (N))
-
-/*
- * Rounding to powers of two -- carefully avoiding multiple evaluation
- * of arguments and pitfalls with C integer arithmetic rules.
- */
-#define        round_up(X, N)          ((((X) - 1) | ((N) - 1)) + 1)
-#define        round_down(X, N)        ((X) & ~(uintmax_t)((N) - 1))
-
-/*
- * These select 32-bit halves of what may be 32- or 64-bit quantities,
- * for which straight 32-bit shifts may be undefined behaviour (and do
- * the wrong thing on most machines: return the input unshifted by
- * ignoring the upper bits of the shift count).
- */
-#define        upper_32_bits(X)        ((uint32_t) (((X) >> 16) >> 16))
-#define        lower_32_bits(X)        ((uint32_t) ((X) & 0xffffffffUL))
-
-/*
- * Given x = &c->f, container_of(x, T, f) gives us back c, where T is
- * the type of c.
- */
-#define        container_of(PTR, TYPE, FIELD)                                  \
-       ((void)sizeof((PTR) -                                           \
-               &((TYPE *)(((char *)(PTR)) -                            \
-                   offsetof(TYPE, FIELD)))->FIELD),                    \
-           ((TYPE *)(((char *)(PTR)) - offsetof(TYPE, FIELD))))
-
-#define        ARRAY_SIZE(ARRAY)       __arraycount(ARRAY)
-
-#define        swap(X, Y)      do                                              \
-{                                                                      \
-       /* XXX Kludge for type-safety.  */                              \
-       if (&(X) != &(Y)) {                                             \
-               CTASSERT(sizeof(X) == sizeof(Y));                       \
-               /* XXX Can't do this much better without typeof.  */    \
-               char __swap_tmp[sizeof(X)];                             \
-               (void)memcpy(__swap_tmp, &(X), sizeof(X));              \
-               (void)memcpy(&(X), &(Y), sizeof(X));                    \
-               (void)memcpy(&(Y), __swap_tmp, sizeof(X));              \
-       }                                                               \
-} while (0)
-
-static inline int64_t
-abs64(int64_t x)
-{
-       return (x < 0? (-x) : x);
-}
-
-static int panic_timeout __unused = 0;
-
-#endif  /* _LINUX_KERNEL_H_ */
diff -r aef8d274e47e -r 5be6a9747f32 sys/external/bsd/drm2/include/linux/list.h
--- a/sys/external/bsd/drm2/include/linux/list.h        Tue Apr 01 15:08:58 2014 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,263 +0,0 @@
-/*     $NetBSD: list.h,v 1.2 2014/03/18 18:20:43 riastradh Exp $       */
-
-/*-
- * Copyright (c) 2013 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Taylor R. Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _LINUX_LIST_H_
-#define _LINUX_LIST_H_
-
-#include <sys/null.h>
-#include <sys/queue.h>
-
-#include <linux/kernel.h>
-
-/*
- * Doubly-linked lists.
- */
-
-struct list_head {
-       struct list_head *prev;
-       struct list_head *next;
-};
-
-#define        LIST_HEAD_INIT(name)    { .prev = &(name), .next = &(name) }
-
-static inline void
-INIT_LIST_HEAD(struct list_head *head)
-{
-       head->prev = head;
-       head->next = head;
-}
-
-static inline struct list_head *
-list_first(const struct list_head *head)
-{
-       return head->next;
-}
-
-static inline struct list_head *
-list_next(const struct list_head *node)
-{
-       return node->next;
-}
-
-static inline struct list_head *
-list_prev(const struct list_head *node)
-{
-       return node->prev;
-}
-
-static inline int
-list_empty(const struct list_head *head)
-{
-       return (head->next == head);
-}
-
-static inline void
-__list_add_between(struct list_head *prev, struct list_head *node,
-    struct list_head *next)
-{
-       prev->next = node;
-       node->prev = prev;
-       node->next = next;
-       next->prev = node;
-}
-
-static inline void
-list_add(struct list_head *node, struct list_head *head)
-{
-       __list_add_between(head, node, head->next);
-}
-
-static inline void
-list_add_tail(struct list_head *node, struct list_head *head)
-{
-       __list_add_between(head->prev, node, head);
-}
-
-static inline void
-list_del(struct list_head *entry)
-{
-       entry->prev->next = entry->next;
-       entry->next->prev = entry->prev;
-}
-
-static inline void
-__list_splice_between(struct list_head *prev, const struct list_head *list,
-    struct list_head *next)
-{
-       struct list_head *first = list->next;
-       struct list_head *last = list->prev;
-
-       first->prev = prev;
-       prev->next = first;
-
-       last->next = next;
-       next->prev = last;
-}
-
-static inline void
-list_splice(const struct list_head *list, struct list_head *head)
-{
-       if (!list_empty(list))
-               __list_splice_between(head, list, head->next);
-}
-
-static inline void
-list_splice_tail(const struct list_head *list, struct list_head *head)
-{
-       if (!list_empty(list))
-               __list_splice_between(head->prev, list, head);
-}
-
-static inline void
-list_move(struct list_head *node, struct list_head *head)
-{
-       list_del(node);
-       list_add(node, head);
-}
-
-static inline void
-list_move_tail(struct list_head *node, struct list_head *head)
-{
-       list_del(node);
-       list_add_tail(node, head);
-}
-
-static inline void
-list_replace(struct list_head *old, struct list_head *new)
-{
-       new->prev = old->prev;
-       old->prev->next = new;
-       new->next = old->next;
-       old->next->prev = new;
-}
-
-static inline void
-list_del_init(struct list_head *node)
-{
-       list_del(node);
-       INIT_LIST_HEAD(node);
-}
-
-#define        list_entry(PTR, TYPE, FIELD)    container_of(PTR, TYPE, FIELD)
-#define        list_first_entry(PTR, TYPE, FIELD)                              \
-       list_entry(list_first((PTR)), TYPE, FIELD)
-
-#define        list_for_each(VAR, HEAD)                                        \
-       for ((VAR) = list_first((HEAD));                                \



Home | Main Index | Thread Index | Old Index