Skip to content

Commit

Permalink
Linux Kernel 3.10.5 compiles and runs (NAME change and possible reboo…
Browse files Browse the repository at this point in the history
…t; .rej cleaned up)

Applied:
/LineageOS/android/kernel/sony/msm8994$ patch -p1 -R <
/home/dj/Downloads/linuxkernelpatches/patch-3.10.5-6

Revert left out:
1) drivers/cpufreq/cpufreq.c - code completely different
2) drivers/net/wireless/wil6210/debugfs.c - code completely different
3) net/wireless/nl80211.c - code modified by Sony

Change-Id: I548bbd92874314a6189573bce4c8ccef409daf9e
  • Loading branch information
djStolen committed Jan 14, 2024
1 parent 4fb11af commit 88a634d
Show file tree
Hide file tree
Showing 111 changed files with 727 additions and 1,144 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
VERSION = 3
PATCHLEVEL = 10
SUBLEVEL = 6
SUBLEVEL = 5
EXTRAVERSION =
NAME = TOSSUG Baby Fish
NAME = Unicycling Gorilla

# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ config ARM
select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER
select HARDIRQS_SW_RESEND
select HAVE_AOUT
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
select HAVE_ARCH_KGDB
select HAVE_ARCH_MMAP_RND_BITS if MMU
Expand Down Expand Up @@ -217,8 +218,7 @@ config VECTORS_BASE
default DRAM_BASE if REMAP_VECTORS_TO_RAM
default 0x00000000
help
The base address of exception vectors. This must be two pages
in size.
The base address of exception vectors.

config ARM_PATCH_PHYS_VIRT
bool "Patch physical to virtual translations at runtime" if EMBEDDED
Expand Down
45 changes: 45 additions & 0 deletions arch/arm/include/asm/a.out-core.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* a.out coredump register dumper
*
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
* Written by David Howells ([email protected])
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public Licence
* as published by the Free Software Foundation; either version
* 2 of the Licence, or (at your option) any later version.
*/

#ifndef _ASM_A_OUT_CORE_H
#define _ASM_A_OUT_CORE_H

#ifdef __KERNEL__

#include <linux/user.h>
#include <linux/elfcore.h>

/*
* fill in the user structure for an a.out core dump
*/
static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
{
struct task_struct *tsk = current;

dump->magic = CMAGIC;
dump->start_code = tsk->mm->start_code;
dump->start_stack = regs->ARM_sp & ~(PAGE_SIZE - 1);

dump->u_tsize = (tsk->mm->end_code - tsk->mm->start_code) >> PAGE_SHIFT;
dump->u_dsize = (tsk->mm->brk - tsk->mm->start_data + PAGE_SIZE - 1) >> PAGE_SHIFT;
dump->u_ssize = 0;

memset(dump->u_debugreg, 0, sizeof(dump->u_debugreg));

if (dump->start_stack < 0x04000000)
dump->u_ssize = (0x04000000 - dump->start_stack) >> PAGE_SHIFT;

dump->regs = *regs;
dump->u_fpvalid = dump_fpu (regs, &dump->u_fp);
}

#endif /* __KERNEL__ */
#endif /* _ASM_A_OUT_CORE_H */
6 changes: 0 additions & 6 deletions arch/arm/include/asm/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,4 @@ struct mm_struct;
extern unsigned long arch_randomize_brk(struct mm_struct *mm);
#define arch_randomize_brk arch_randomize_brk

#ifdef CONFIG_MMU
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
struct linux_binprm;
int arch_setup_additional_pages(struct linux_binprm *, int);
#endif

#endif
3 changes: 0 additions & 3 deletions arch/arm/include/asm/mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
typedef struct {
#ifdef CONFIG_CPU_HAS_ASID
atomic64_t id;
#else
int switch_pending;
#endif
unsigned int vmalloc_seq;
unsigned long sigpage;
} mm_context_t;

#ifdef CONFIG_CPU_HAS_ASID
Expand Down
20 changes: 4 additions & 16 deletions arch/arm/include/asm/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static inline void check_and_switch_context(struct mm_struct *mm,
* on non-ASID CPUs, the old mm will remain valid until the
* finish_arch_post_lock_switch() call.
*/
mm->context.switch_pending = 1;
set_ti_thread_flag(task_thread_info(tsk), TIF_SWITCH_MM);
else
cpu_switch_mm(mm->pgd, mm);
}
Expand All @@ -64,21 +64,9 @@ static inline void check_and_switch_context(struct mm_struct *mm,
finish_arch_post_lock_switch
static inline void finish_arch_post_lock_switch(void)
{
struct mm_struct *mm = current->mm;

if (mm && mm->context.switch_pending) {
/*
* Preemption must be disabled during cpu_switch_mm() as we
* have some stateful cache flush implementations. Check
* switch_pending again in case we were preempted and the
* switch to this mm was already done.
*/
preempt_disable();
if (mm->context.switch_pending) {
mm->context.switch_pending = 0;
cpu_switch_mm(mm->pgd, mm);
}
preempt_enable_no_resched();
if (test_and_clear_thread_flag(TIF_SWITCH_MM)) {
struct mm_struct *mm = current->mm;
cpu_switch_mm(mm->pgd, mm);
}
}

Expand Down
2 changes: 0 additions & 2 deletions arch/arm/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ extern void __cpu_copy_user_highpage(struct page *to, struct page *from,
#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
extern void copy_page(void *to, const void *from);

#ifdef CONFIG_KUSER_HELPERS
#define __HAVE_ARCH_GATE_AREA 1
#endif

#ifdef CONFIG_ARM_LPAE
#include <asm/pgtable-3level-types.h>
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ struct thread_struct {

#define start_thread(regs,pc,sp) \
({ \
unsigned long *stack = (unsigned long *)sp; \
memset(regs->uregs, 0, sizeof(regs->uregs)); \
if (current->personality & ADDR_LIMIT_32BIT) \
regs->ARM_cpsr = USR_MODE; \
Expand All @@ -67,6 +68,9 @@ struct thread_struct {
regs->ARM_cpsr |= PSR_ENDSTATE; \
regs->ARM_pc = pc & ~1; /* pc */ \
regs->ARM_sp = sp; /* sp */ \
regs->ARM_r2 = stack[2]; /* r2 (envp) */ \
regs->ARM_r1 = stack[1]; /* r1 (argv) */ \
regs->ARM_r0 = stack[0]; /* r0 (argc) */ \
nommu_start_thread(regs); \
})

Expand Down
1 change: 1 addition & 0 deletions arch/arm/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
#define TIF_USING_IWMMXT 17
#define TIF_MEMDIE 18 /* is terminating due to OOM killer */
#define TIF_RESTORE_SIGMASK 20
#define TIF_SWITCH_MM 22 /* deferred switch_mm */
#define TIF_MM_RELEASED 23 /* task MM has been released */

#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

header-y += a.out.h
header-y += byteorder.h
header-y += fcntl.h
header-y += hwcap.h
Expand Down
34 changes: 34 additions & 0 deletions arch/arm/include/uapi/asm/a.out.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#ifndef __ARM_A_OUT_H__
#define __ARM_A_OUT_H__

#include <linux/personality.h>
#include <linux/types.h>

struct exec
{
__u32 a_info; /* Use macros N_MAGIC, etc for access */
__u32 a_text; /* length of text, in bytes */
__u32 a_data; /* length of data, in bytes */
__u32 a_bss; /* length of uninitialized data area for file, in bytes */
__u32 a_syms; /* length of symbol table data in file, in bytes */
__u32 a_entry; /* start address */
__u32 a_trsize; /* length of relocation info for text, in bytes */
__u32 a_drsize; /* length of relocation info for data, in bytes */
};

/*
* This is always the same
*/
#define N_TXTADDR(a) (0x00008000)

#define N_TRSIZE(a) ((a).a_trsize)
#define N_DRSIZE(a) ((a).a_drsize)
#define N_SYMSIZE(a) ((a).a_syms)

#define M_ARM 103

#ifndef LIBRARY_START_TEXT
#define LIBRARY_START_TEXT (0x00c00000)
#endif

#endif /* __A_OUT_GNU_H__ */
103 changes: 50 additions & 53 deletions arch/arm/kernel/entry-armv.S
Original file line number Diff line number Diff line change
Expand Up @@ -745,18 +745,6 @@ ENDPROC(__switch_to)
#endif
.endm

.macro kuser_pad, sym, size
.if (. - \sym) & 3
.rept 4 - (. - \sym) & 3
.byte 0
.endr
.endif
.rept (\size - (. - \sym)) / 4
.word 0xe7fddef1
.endr
.endm

#ifdef CONFIG_KUSER_HELPERS
.align 5
.globl __kuser_helper_start
__kuser_helper_start:
Expand Down Expand Up @@ -938,13 +926,18 @@ kuser_cmpxchg64_fixup:
#error "incoherent kernel configuration"
#endif

kuser_pad __kuser_cmpxchg64, 64
/* pad to next slot */
.rept (16 - (. - __kuser_cmpxchg64)/4)
.word 0
.endr

.align 5

__kuser_memory_barrier: @ 0xffff0fa0
smp_dmb arm
usr_ret lr

kuser_pad __kuser_memory_barrier, 32
.align 5

__kuser_cmpxchg: @ 0xffff0fc0

Expand Down Expand Up @@ -1017,14 +1010,13 @@ kuser_cmpxchg32_fixup:

#endif

kuser_pad __kuser_cmpxchg, 32
.align 5

__kuser_get_tls: @ 0xffff0fe0
ldr r0, [pc, #(16 - 8)] @ read TLS, set in kuser_get_tls_init
usr_ret lr
mrc p15, 0, r0, c13, c0, 3 @ 0xffff0fe8 hardware TLS code
kuser_pad __kuser_get_tls, 16
.rep 3
.rep 4
.word 0 @ 0xffff0ff0 software TLS value, then
.endr @ pad up to __kuser_helper_version

Expand All @@ -1034,16 +1026,14 @@ __kuser_helper_version: @ 0xffff0ffc
.globl __kuser_helper_end
__kuser_helper_end:

#endif

THUMB( .thumb )

/*
* Vector stubs.
*
* This code is copied to 0xffff1000 so we can use branches in the
* vectors, rather than ldr's. Note that this code must not exceed
* a page size.
* This code is copied to 0xffff0200 so we can use branches in the
* vectors, rather than ldr's. Note that this code must not
* exceed 0x300 bytes.
*
* Common stub entry macro:
* Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
Expand Down Expand Up @@ -1102,17 +1092,8 @@ ENDPROC(vector_\name)
1:
.endm

.section .stubs, "ax", %progbits
.globl __stubs_start
__stubs_start:
@ This must be the first word
.word vector_swi

vector_rst:
ARM( swi SYS_ERROR0 )
THUMB( svc #0 )
THUMB( nop )
b vector_und

/*
* Interrupt dispatcher
*/
Expand Down Expand Up @@ -1206,16 +1187,6 @@ vector_rst:

.align 5

/*=============================================================================
* Address exception handler
*-----------------------------------------------------------------------------
* These aren't too critical.
* (they're not supposed to happen, and won't happen in 32-bit data mode).
*/

vector_addrexcptn:
b vector_addrexcptn

/*=============================================================================
* Undefined FIQs
*-----------------------------------------------------------------------------
Expand All @@ -1232,19 +1203,45 @@ vector_fiq:
.krait_fixup:
.word msm_krait_need_wfe_fixup

.globl vector_fiq_offset
.equ vector_fiq_offset, vector_fiq
/*=============================================================================
* Address exception handler
*-----------------------------------------------------------------------------
* These aren't too critical.
* (they're not supposed to happen, and won't happen in 32-bit data mode).
*/

vector_addrexcptn:
b vector_addrexcptn

/*
* We group all the following data together to optimise
* for CPUs with separate I & D caches.
*/
.align 5

.LCvswi:
.word vector_swi

.globl __stubs_end
__stubs_end:

.equ stubs_offset, __vectors_start + 0x200 - __stubs_start

.section .vectors, "ax", %progbits
.globl __vectors_start
__vectors_start:
W(b) vector_rst
W(b) vector_und
W(ldr) pc, __vectors_start + 0x1000
W(b) vector_pabt
W(b) vector_dabt
W(b) vector_addrexcptn
W(b) vector_irq
W(b) vector_fiq
ARM( swi SYS_ERROR0 )
THUMB( svc #0 )
THUMB( nop )
W(b) vector_und + stubs_offset
W(ldr) pc, .LCvswi + stubs_offset
W(b) vector_pabt + stubs_offset
W(b) vector_dabt + stubs_offset
W(b) vector_addrexcptn + stubs_offset
W(b) vector_irq + stubs_offset
W(b) vector_fiq + stubs_offset

.globl __vectors_end
__vectors_end:

.data

Expand Down
Loading

0 comments on commit 88a634d

Please sign in to comment.