Skip to content

Commit

Permalink
openrisc: use qspinlocks and qrwlocks
Browse files Browse the repository at this point in the history
Enable OpenRISC to use qspinlocks and qrwlocks for upcoming SMP support.

Signed-off-by: Stafford Horne <shorne@gmail.com>
  • Loading branch information
Stafford Horne committed Nov 3, 2017
1 parent 489e0f8 commit b5f8217
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions arch/openrisc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ config OPENRISC
select OR1K_PIC
select CPU_NO_EFFICIENT_FFS if !OPENRISC_HAVE_INST_FF1
select NO_BOOTMEM
select ARCH_USE_QUEUED_SPINLOCKS
select ARCH_USE_QUEUED_RWLOCKS

config CPU_BIG_ENDIAN
def_bool y
Expand Down
4 changes: 4 additions & 0 deletions arch/openrisc/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ generic-y += module.h
generic-y += pci.h
generic-y += percpu.h
generic-y += preempt.h
generic-y += qspinlock_types.h
generic-y += qspinlock.h
generic-y += qrwlock_types.h
generic-y += qrwlock.h
generic-y += sections.h
generic-y += segment.h
generic-y += string.h
Expand Down
12 changes: 11 additions & 1 deletion arch/openrisc/include/asm/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
#ifndef __ASM_OPENRISC_SPINLOCK_H
#define __ASM_OPENRISC_SPINLOCK_H

#error "or32 doesn't do SMP yet"
#include <asm/qspinlock.h>

#include <asm/qrwlock.h>

#define arch_read_lock_flags(lock, flags) arch_read_lock(lock)
#define arch_write_lock_flags(lock, flags) arch_write_lock(lock)

#define arch_spin_relax(lock) cpu_relax()
#define arch_read_relax(lock) cpu_relax()
#define arch_write_relax(lock) cpu_relax()


#endif
7 changes: 7 additions & 0 deletions arch/openrisc/include/asm/spinlock_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef _ASM_OPENRISC_SPINLOCK_TYPES_H
#define _ASM_OPENRISC_SPINLOCK_TYPES_H

#include <asm/qspinlock_types.h>
#include <asm/qrwlock_types.h>

#endif /* _ASM_OPENRISC_SPINLOCK_TYPES_H */

0 comments on commit b5f8217

Please sign in to comment.