Deleted Added
full compact
kern_mutex.c (196226) kern_mutex.c (196334)
1/*-
2 * Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 20 unchanged lines hidden (view full) ---

29 * and BSDI $Id: synch_machdep.c,v 2.3.2.39 2000/04/27 03:10:25 cp Exp $
30 */
31
32/*
33 * Machine independent bits of mutex implementation.
34 */
35
36#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 20 unchanged lines hidden (view full) ---

29 * and BSDI $Id: synch_machdep.c,v 2.3.2.39 2000/04/27 03:10:25 cp Exp $
30 */
31
32/*
33 * Machine independent bits of mutex implementation.
34 */
35
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/sys/kern/kern_mutex.c 196226 2009-08-14 21:46:54Z bz $");
37__FBSDID("$FreeBSD: head/sys/kern/kern_mutex.c 196334 2009-08-17 16:17:21Z attilio $");
38
39#include "opt_adaptive_mutexes.h"
40#include "opt_ddb.h"
41#include "opt_global.h"
42#include "opt_kdtrace.h"
43#include "opt_sched.h"
44
45#include <sys/param.h>

--- 732 unchanged lines hidden (view full) ---

778void
779mtx_init(struct mtx *m, const char *name, const char *type, int opts)
780{
781 struct lock_class *class;
782 int flags;
783
784 MPASS((opts & ~(MTX_SPIN | MTX_QUIET | MTX_RECURSE |
785 MTX_NOWITNESS | MTX_DUPOK | MTX_NOPROFILE)) == 0);
38
39#include "opt_adaptive_mutexes.h"
40#include "opt_ddb.h"
41#include "opt_global.h"
42#include "opt_kdtrace.h"
43#include "opt_sched.h"
44
45#include <sys/param.h>

--- 732 unchanged lines hidden (view full) ---

778void
779mtx_init(struct mtx *m, const char *name, const char *type, int opts)
780{
781 struct lock_class *class;
782 int flags;
783
784 MPASS((opts & ~(MTX_SPIN | MTX_QUIET | MTX_RECURSE |
785 MTX_NOWITNESS | MTX_DUPOK | MTX_NOPROFILE)) == 0);
786 ASSERT_ATOMIC_LOAD(m->mtx_lock, ("%s: mtx_lock not aligned for %s: %p",
787 __func__, name, &m->mtx_lock));
786 ASSERT_ATOMIC_LOAD_PTR(m->mtx_lock,
787 ("%s: mtx_lock not aligned for %s: %p", __func__, name,
788 &m->mtx_lock));
788
789#ifdef MUTEX_DEBUG
790 /* Diagnostic and error correction */
791 mtx_validate(m);
792#endif
793
794 /* Determine lock class and lock flags. */
795 if (opts & MTX_SPIN)

--- 118 unchanged lines hidden ---
789
790#ifdef MUTEX_DEBUG
791 /* Diagnostic and error correction */
792 mtx_validate(m);
793#endif
794
795 /* Determine lock class and lock flags. */
796 if (opts & MTX_SPIN)

--- 118 unchanged lines hidden ---