| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: mutex.h,v 1.11 2012/08/16 16:49:10 matt Exp $ */ | | 1 | /* $NetBSD: mutex.h,v 1.12 2012/08/31 23:56:15 matt Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Jason R. Thorpe and Andrew Doran. | | 8 | * by Jason R. Thorpe and Andrew Doran. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -53,28 +53,28 @@ struct kmutex { | | | @@ -53,28 +53,28 @@ struct kmutex { |
53 | }; | | 53 | }; |
54 | | | 54 | |
55 | #else /* __MUTEX_PRIVATE */ | | 55 | #else /* __MUTEX_PRIVATE */ |
56 | | | 56 | |
57 | struct kmutex { | | 57 | struct kmutex { |
58 | union { | | 58 | union { |
59 | /* Adaptive mutex */ | | 59 | /* Adaptive mutex */ |
60 | volatile uintptr_t mtxa_owner; /* 0-3 */ | | 60 | volatile uintptr_t mtxa_owner; /* 0-3 */ |
61 | | | 61 | |
62 | /* Spin mutex */ | | 62 | /* Spin mutex */ |
63 | struct { | | 63 | struct { |
64 | volatile uint8_t mtxs_dummy; | | 64 | volatile uint8_t mtxs_dummy; |
65 | ipl_cookie_t mtxs_ipl; | | 65 | ipl_cookie_t mtxs_ipl; |
66 | __cpu_simple_lock_t mtxs_lock; | | | |
67 | volatile uint8_t mtxs_unused; | | 66 | volatile uint8_t mtxs_unused; |
| | | 67 | __cpu_simple_lock_t mtxs_lock; |
68 | } s; | | 68 | } s; |
69 | } u; | | 69 | } u; |
70 | }; | | 70 | }; |
71 | | | 71 | |
72 | #define mtx_owner u.mtxa_owner | | 72 | #define mtx_owner u.mtxa_owner |
73 | #define mtx_ipl u.s.mtxs_ipl | | 73 | #define mtx_ipl u.s.mtxs_ipl |
74 | #define mtx_lock u.s.mtxs_lock | | 74 | #define mtx_lock u.s.mtxs_lock |
75 | | | 75 | |
76 | #if 0 | | 76 | #if 0 |
77 | #define __HAVE_MUTEX_STUBS 1 | | 77 | #define __HAVE_MUTEX_STUBS 1 |
78 | #define __HAVE_SPIN_MUTEX_STUBS 1 | | 78 | #define __HAVE_SPIN_MUTEX_STUBS 1 |
79 | #endif | | 79 | #endif |
80 | #define __HAVE_SIMPLE_MUTEXES 1 | | 80 | #define __HAVE_SIMPLE_MUTEXES 1 |