ARC: Final cleanups #7: bootup printing look-n-feel consistency

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: signal cleanups #1: kludge in batch copying of pt_regs fixed

when preparing to call user space signal handler, kernel needs to
safe-keep the orig user mode regs in (sigframe->ucontext->sigcontext).
Instead of doing an itemised copy, as an ARC optimization, we do "bulk"
__copy_to_user(). However the layout is not exactly same as pt_regs
so we had to resort to doing a kludgy way of copy which doesn't look
very pretty.

So now we make it exactly same as pt_regs.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: signal cleanups #2: sigreturn == rt_sigreturn

Depending on SA_SIGINFO, handle_signal() sets up user context as
"struct rt_sigframe" vs. "struct sigframe" which differ in siginfo
provided to userspace.

struct rt_sigframe {
   struct siginfo info;    ==> sigaction() with SA_SIGINFO
   struct sigframe frame;  ==> user mode reg state for vanilla signals
};

Due to this different frame layout, the signal handler return path
(sigreturn) needs to restore sigframe context differently, using
rt_sigreturn vs. sigreturn. The decision is made in uClibc

  (flags & SA_SIGINFO) ? __default_rt_sa_restorer : __default_sa_restorer
				^^^^^			^^^^^
			     rt_sigreturn       	sigreturn

Note that rt_sigreturn and sigreturn are semantically same, it's just
the different frame layout which needs to be handled.

This patch uncouples the frame layout from SA_SIGINFO. So we always
setup rt_sigframe and populate it either completely (SA_SIGINFO case)
or just the basic user context (!SA_SIGINFO case, needed by any signal
for restoring the user state post handler is run).

With that in place, sigreturn path need not be different now.

Implementation wise:
-setup_frame() nuked, handle_signal() uncond calls setup_rt_frame()
-sigreturn is simple wrapper over rt_sigreturn (OS ABI still stable,
 thus syscall proper  needs to be preserved for now, but can easily
 go away)
-rt_sigreturn semantically needs to handle alternate ss stuff, which we
 don't want to do for !SA_SIGINFO, thus a "magic" hack

Some cosmetic changes being:
-BLINK/STATUS32 tweaks moved out of setup_ret_from_usr_sighdlr() since
 it applies to pre-handler, not post-handler

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: signal cleanups #3: sigframe->ucontext->sigcontext->oldmask unused

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Fixes to u-boot cmdline handling

-The copying of u-boot cmdline needed to be bytewise (not wordwise)
-Tag which hints that u-boot passed cmdline for kernel was incorrect (tst r1)

[vgupta: Added chk to ensure a NULL cmdline doesn't crash kernel]

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [SMP] IPI interrupt as percpu

Just like TIMER0 make IPI percpu interrupt.
Also fix compilation error with missing include for IS_ERR macro.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [BE] fix bcr_fp for endianness

Like all other structures fix this one.
Add missing macro for edge interrupts.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [build] Yet another breakage when !CONFIG_SMP

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Final cleanups #8: page fault handling API usage

Need to use is_global_init(), do_group_exit()

Others
-Moved vamlloc fault handling into a seperate routine
-Extraneous comments cleanup

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Final cleanups #9: Build warnings (dma.c/unwind.c), extra comments

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: ===== OS ABI v2 ===== asm-generic unistd.h

-Everything needed to switch to asm-generic unistd
-bootup printing to show that OS ABI has changed
-NR_rt_sigreturn value changed thus fixes to create_sigret_stub()
-NR_sigreturn doesn't exist anymore so handler nuked
-NR_mmap defined thus needs a dummy handler

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: ===== OS ABI v2 ===== asm-generic/{fcntl,stat,posix_types}

Since the ABI is changeing due to unistd, we might as well move to
generic versions of these headers althoug this requires corresponding
work in uClibc as well.

stat in particular is interesting as it will allow us to make the stat
family of syscalls a simple pass-thru w/o need for any itermised copy
in userspace, hopefully speeding it up.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: ===== OS ABI v2 ===== pt_regs Modified

pt_regs placeholder changes: SP moved before orig_r0 and orig_r8

Why:
-------------------------------------
pt_regs contains the register info and some kernel internal info
(orig_r0 and orig_r8). The idea of this commit is to aggregate the
register info together, towards start of struct and have all the control
info together towards end.

This way, in future, we can update the kernel control info placeholders
(add/remove) w/o affecting the ABI.

Additionaly it allows to easily do batch copies of pt_regs for say
signal handling and such, w/o worrying about leaking kernel control info
to user space.

This however breaks the user space ABI for tools which rely on pt_regs
layout for retrieving regs values (gdb/strace). Thus they need to be
updated.

Additionally, struct user_regs_struct modified to include struct pt_regs
directly instread of open-coded copy of struct to contain all pt_regs
changes to jus ptrace.h

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: ===== OS ABI v2 ===== Minor other updates

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: struct user_regs_struct cleanups

In user_regs_struct, the opencoded struct pt_regs/callee_regs now
replaced with a actual structures to keep such info centralised to one
single file ptrace.h

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: LTP Build breakage (userspace headers broken)

The commit f6d3b3c3b7f0 (ARC: treewide cleanup: Lindent, checkpatch)
removed the gaurd in pteace.h, caussing a enum in uClibc sys/ptrace.h to
be #defined.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: LTP Build breakage #2: syscall sys_sysfs missing

This is a core kernel bug. Somewhere in the development of
asm-generic/unistd.h, the syscall sys_sysfs (fs/filesystems.c) got lost
while the core syscall still exits.

The workaround for now is to pretend it is ARC syscall

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: OS ABI v2: LTP Runtime regresions

(1) The unhandled syscalls need to be handled with a "ni" handler as
    opposed to just NULL entries which would cause kernel crashes

(2) uClibc passes __IPC_64 flags in sysvipc cmds, which needs to be
    handled using __ARCH_WANT_IPC_PARSE_VERSION, otherwise all such LTP
    tests fail

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: OS ABI v2 verification (elf hdr arch specific e_flags based)

To make the ABI transition less painful, added ABI verification scheme.
Essentially the pairing GNU ld now by-default adds a ABI ver tag in ELF
hdr (in the machine specific e_flags placeholder) which is checked by
kernel.
An absence implies toolchain not built with newer ld (and hence implies
that the rest of tool-chain - uClibc/gdbserver in  particular are not
adhering to the new asm-generic based syscall interface.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: OS ABI v2 verification #2: ABI ver placeholder shifted slightly

The fundamental change was done in binutils to make bigger room for ARC
cpu name in ELF hdr's e_flags. Thus the placeholder for OS ABI ver needs
a slight adjustment

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>