Skip to content

Commit

Permalink
Merge tag 'csky-for-linus-6.6' of https://github.com/c-sky/csky-linux
Browse files Browse the repository at this point in the history
Pull arch/csky updates from Guo Ren:

 - Fixup compile warnings

 - Fixup update_mmu_cache

* tag 'csky-for-linus-6.6' of https://github.com/c-sky/csky-linux:
  csky: Fixup -Wmissing-prototypes warning
  csky: Make pfn accessors static inlines
  csky: Cast argument to virt_to_pfn() to (void *)
  csky: pgtable: Invalidate stale I-cache lines in update_mmu_cache
  csky: fix old style declaration in module.c
  • Loading branch information
Linus Torvalds committed Aug 29, 2023
2 parents 48d25d3 + c8171a8 commit eaf9f46
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 8 deletions.
2 changes: 1 addition & 1 deletion arch/arc/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ extern int pfn_valid(unsigned long pfn);

#else /* CONFIG_HIGHMEM */

#define ARCH_PFN_OFFSET virt_to_pfn(CONFIG_LINUX_RAM_BASE)
#define ARCH_PFN_OFFSET virt_to_pfn((void *)CONFIG_LINUX_RAM_BASE)

#endif /* CONFIG_HIGHMEM */

Expand Down
4 changes: 1 addition & 3 deletions arch/csky/abiv2/cacheflush.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,

addr = (unsigned long) kmap_atomic(page);

icache_inv_range(address, address + PAGE_SIZE);
dcache_wb_range(addr, addr + PAGE_SIZE);

if (vma->vm_flags & VM_EXEC)
icache_inv_range(addr, addr + PAGE_SIZE);

kunmap_atomic((void *) addr);
}

Expand Down
13 changes: 10 additions & 3 deletions arch/csky/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@

#include <linux/pfn.h>

#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)

#define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && \
(void *)(kaddr) < high_memory)

Expand Down Expand Up @@ -80,6 +77,16 @@ extern unsigned long va_pa_offset;

#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0))

static inline unsigned long virt_to_pfn(const void *kaddr)
{
return __pa(kaddr) >> PAGE_SHIFT;
}

static inline void * pfn_to_virt(unsigned long pfn)
{
return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT);
}

#define MAP_NR(x) PFN_DOWN((unsigned long)(x) - PAGE_OFFSET - \
PHYS_OFFSET_OFFSET)
#define virt_to_page(x) (mem_map + MAP_NR(x))
Expand Down
2 changes: 2 additions & 0 deletions arch/csky/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,7 @@ static inline unsigned long regs_get_register(struct pt_regs *regs,
return *(unsigned long *)((unsigned long)regs + offset);
}

asmlinkage int syscall_trace_enter(struct pt_regs *regs);
asmlinkage void syscall_trace_exit(struct pt_regs *regs);
#endif /* __ASSEMBLY__ */
#endif /* __ASM_CSKY_PTRACE_H */
2 changes: 2 additions & 0 deletions arch/csky/include/asm/sections.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@

extern char _start[];

asmlinkage void csky_start(unsigned int unused, void *dtb_start);

#endif /* __ASM_SECTIONS_H */
15 changes: 15 additions & 0 deletions arch/csky/include/asm/traps.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,19 @@ do { \

void csky_alignment(struct pt_regs *regs);

asmlinkage void do_trap_unknown(struct pt_regs *regs);
asmlinkage void do_trap_zdiv(struct pt_regs *regs);
asmlinkage void do_trap_buserr(struct pt_regs *regs);
asmlinkage void do_trap_misaligned(struct pt_regs *regs);
asmlinkage void do_trap_bkpt(struct pt_regs *regs);
asmlinkage void do_trap_illinsn(struct pt_regs *regs);
asmlinkage void do_trap_fpe(struct pt_regs *regs);
asmlinkage void do_trap_priv(struct pt_regs *regs);
asmlinkage void trap_c(struct pt_regs *regs);

asmlinkage void do_notify_resume(struct pt_regs *regs,
unsigned long thread_info_flags);

void trap_init(void);

#endif /* __ASM_CSKY_TRAPS_H */
2 changes: 1 addition & 1 deletion arch/csky/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static void jsri_2_lrw_jsr(uint32_t *location)
}
}
#else
static void inline jsri_2_lrw_jsr(uint32_t *location)
static inline void jsri_2_lrw_jsr(uint32_t *location)
{
return;
}
Expand Down
11 changes: 11 additions & 0 deletions arch/csky/kernel/vdso/vgettimeofday.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,35 @@
#include <linux/time.h>
#include <linux/types.h>

extern
int __vdso_clock_gettime(clockid_t clock,
struct old_timespec32 *ts);
int __vdso_clock_gettime(clockid_t clock,
struct old_timespec32 *ts)
{
return __cvdso_clock_gettime32(clock, ts);
}

int __vdso_clock_gettime64(clockid_t clock,
struct __kernel_timespec *ts);
int __vdso_clock_gettime64(clockid_t clock,
struct __kernel_timespec *ts)
{
return __cvdso_clock_gettime(clock, ts);
}

extern
int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
struct timezone *tz);
int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
struct timezone *tz)
{
return __cvdso_gettimeofday(tv, tz);
}

extern
int __vdso_clock_getres(clockid_t clock_id,
struct old_timespec32 *res);
int __vdso_clock_getres(clockid_t clock_id,
struct old_timespec32 *res)
{
Expand Down

0 comments on commit eaf9f46

Please sign in to comment.