Skip to content

Commit 4caf875

Browse files
Julien Thierryctmarinas
authored andcommitted
arm64: Rename get_thread_info()
The assembly macro get_thread_info() actually returns a task_struct and is analogous to the current/get_current macro/function. While it could be argued that thread_info sits at the start of task_struct and the intention could have been to return a thread_info, instances of loads from/stores to the address obtained from get_thread_info() use offsets that are generated with offsetof(struct task_struct, [...]). Rename get_thread_info() to state it returns a task_struct. Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Julien Thierry <julien.thierry@arm.com> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 47224e5 commit 4caf875

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

arch/arm64/include/asm/asm-uaccess.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
.endm
2525

2626
.macro __uaccess_ttbr0_enable, tmp1, tmp2
27-
get_thread_info \tmp1
27+
get_current_task \tmp1
2828
ldr \tmp1, [\tmp1, #TSK_TI_TTBR0] // load saved TTBR0_EL1
2929
mrs \tmp2, ttbr1_el1
3030
extr \tmp2, \tmp2, \tmp1, #48

arch/arm64/include/asm/assembler.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,9 @@ USER(\label, ic ivau, \tmp2) // invalidate I line PoU
528528
.endm
529529

530530
/*
531-
* Return the current thread_info.
531+
* Return the current task_struct.
532532
*/
533-
.macro get_thread_info, rd
533+
.macro get_current_task, rd
534534
mrs \rd, sp_el0
535535
.endm
536536

@@ -713,7 +713,7 @@ USER(\label, ic ivau, \tmp2) // invalidate I line PoU
713713

714714
.macro if_will_cond_yield_neon
715715
#ifdef CONFIG_PREEMPT
716-
get_thread_info x0
716+
get_current_task x0
717717
ldr x0, [x0, #TSK_TI_PREEMPT]
718718
sub x0, x0, #PREEMPT_DISABLE_OFFSET
719719
cbz x0, .Lyield_\@

arch/arm64/kernel/entry.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ alternative_cb_end
185185

186186
.else
187187
add x21, sp, #S_FRAME_SIZE
188-
get_thread_info tsk
188+
get_current_task tsk
189189
/* Save the task's original addr_limit and set USER_DS */
190190
ldr x20, [tsk, #TSK_TI_ADDR_LIMIT]
191191
str x20, [sp, #S_ORIG_ADDR_LIMIT]
@@ -1104,7 +1104,7 @@ ENTRY(ret_from_fork)
11041104
cbz x19, 1f // not a kernel thread
11051105
mov x0, x20
11061106
blr x19
1107-
1: get_thread_info tsk
1107+
1: get_current_task tsk
11081108
b ret_to_user
11091109
ENDPROC(ret_from_fork)
11101110
NOKPROBE(ret_from_fork)

0 commit comments

Comments
 (0)