mutex.h 636 B

123456789101112131415161718
  1. /*
  2. * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. /*
  9. * xchg() based mutex fast path maintains a state of 0 or 1, as opposed to
  10. * atomic dec based which can "count" any number of lock contenders.
  11. * This ideally needs to be fixed in core, but for now switching to dec ver.
  12. */
  13. #if defined(CONFIG_SMP) && (CONFIG_NR_CPUS > 2)
  14. #include <asm-generic/mutex-dec.h>
  15. #else
  16. #include <asm-generic/mutex-xchg.h>
  17. #endif