Skip to content

Commit

Permalink
Merge tag 'cris-for-linus-3.8' of git://jni.nu/cris
Browse files Browse the repository at this point in the history
Pull CRIS changes from Jesper Nilsson.

... mainly the UAPI disintegration.

* tag 'cris-for-linus-3.8' of git://jni.nu/cris:
  UAPI: Fix up empty files in arch/cris/
  CRIS: locking: fix the return value of arch_read_trylock()
  CRIS: use kbuild.h instead of defining macros in asm-offset.c
  UAPI: (Scripted) Disintegrate arch/cris/include/asm
  UAPI: (Scripted) Disintegrate arch/cris/include/arch-v32/arch
  UAPI: (Scripted) Disintegrate arch/cris/include/arch-v10/arch
  • Loading branch information
torvalds committed Dec 20, 2012
2 parents 1ffab3d + 77c8006 commit 0c54450
Show file tree
Hide file tree
Showing 55 changed files with 689 additions and 645 deletions.
5 changes: 1 addition & 4 deletions arch/cris/include/arch-v10/arch/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
header-y += user.h
header-y += svinto.h
header-y += sv_addr_ag.h
header-y += sv_addr.agh
# CRISv10 arch
3 changes: 1 addition & 2 deletions arch/cris/include/arch-v32/arch/Kbuild
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
header-y += user.h
header-y += cryptocop.h
# CRISv32 arch
116 changes: 1 addition & 115 deletions arch/cris/include/arch-v32/arch/cryptocop.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,124 +2,12 @@
* The device /dev/cryptocop is accessible using this driver using
* CRYPTOCOP_MAJOR (254) and minor number 0.
*/

#ifndef CRYPTOCOP_H
#define CRYPTOCOP_H

#include <linux/uio.h>


#define CRYPTOCOP_SESSION_ID_NONE (0)

typedef unsigned long long int cryptocop_session_id;

/* cryptocop ioctls */
#define ETRAXCRYPTOCOP_IOCTYPE (250)

#define CRYPTOCOP_IO_CREATE_SESSION _IOWR(ETRAXCRYPTOCOP_IOCTYPE, 1, struct strcop_session_op)
#define CRYPTOCOP_IO_CLOSE_SESSION _IOW(ETRAXCRYPTOCOP_IOCTYPE, 2, struct strcop_session_op)
#define CRYPTOCOP_IO_PROCESS_OP _IOWR(ETRAXCRYPTOCOP_IOCTYPE, 3, struct strcop_crypto_op)
#define CRYPTOCOP_IO_MAXNR (3)

typedef enum {
cryptocop_cipher_des = 0,
cryptocop_cipher_3des = 1,
cryptocop_cipher_aes = 2,
cryptocop_cipher_m2m = 3, /* mem2mem is essentially a NULL cipher with blocklength=1 */
cryptocop_cipher_none
} cryptocop_cipher_type;

typedef enum {
cryptocop_digest_sha1 = 0,
cryptocop_digest_md5 = 1,
cryptocop_digest_none
} cryptocop_digest_type;

typedef enum {
cryptocop_csum_le = 0,
cryptocop_csum_be = 1,
cryptocop_csum_none
} cryptocop_csum_type;

typedef enum {
cryptocop_cipher_mode_ecb = 0,
cryptocop_cipher_mode_cbc,
cryptocop_cipher_mode_none
} cryptocop_cipher_mode;

typedef enum {
cryptocop_3des_eee = 0,
cryptocop_3des_eed = 1,
cryptocop_3des_ede = 2,
cryptocop_3des_edd = 3,
cryptocop_3des_dee = 4,
cryptocop_3des_ded = 5,
cryptocop_3des_dde = 6,
cryptocop_3des_ddd = 7
} cryptocop_3des_mode;

/* Usermode accessible (ioctl) operations. */
struct strcop_session_op{
cryptocop_session_id ses_id;

cryptocop_cipher_type cipher; /* AES, DES, 3DES, m2m, none */

cryptocop_cipher_mode cmode; /* ECB, CBC, none */
cryptocop_3des_mode des3_mode;

cryptocop_digest_type digest; /* MD5, SHA1, none */

cryptocop_csum_type csum; /* BE, LE, none */

unsigned char *key;
size_t keylen;
};

#define CRYPTOCOP_CSUM_LENGTH (2)
#define CRYPTOCOP_MAX_DIGEST_LENGTH (20) /* SHA-1 20, MD5 16 */
#define CRYPTOCOP_MAX_IV_LENGTH (16) /* (3)DES==8, AES == 16 */
#define CRYPTOCOP_MAX_KEY_LENGTH (32)

struct strcop_crypto_op{
cryptocop_session_id ses_id;

/* Indata. */
unsigned char *indata;
size_t inlen; /* Total indata length. */

/* Cipher configuration. */
unsigned char do_cipher:1;
unsigned char decrypt:1; /* 1 == decrypt, 0 == encrypt */
unsigned char cipher_explicit:1;
size_t cipher_start;
size_t cipher_len;
/* cipher_iv is used if do_cipher and cipher_explicit and the cipher
mode is CBC. The length is controlled by the type of cipher,
e.g. DES/3DES 8 octets and AES 16 octets. */
unsigned char cipher_iv[CRYPTOCOP_MAX_IV_LENGTH];
/* Outdata. */
unsigned char *cipher_outdata;
size_t cipher_outlen;

/* digest configuration. */
unsigned char do_digest:1;
size_t digest_start;
size_t digest_len;
/* Outdata. The actual length is determined by the type of the digest. */
unsigned char digest[CRYPTOCOP_MAX_DIGEST_LENGTH];

/* Checksum configuration. */
unsigned char do_csum:1;
size_t csum_start;
size_t csum_len;
/* Outdata. */
unsigned char csum[CRYPTOCOP_CSUM_LENGTH];
};
#include <uapi/arch-v32/arch/cryptocop.h>



#ifdef __KERNEL__

/********** The API to use from inside the kernel. ************/

#include <arch/hwregs/dma.h>
Expand Down Expand Up @@ -267,6 +155,4 @@ int cryptocop_job_queue_insert_crypto(struct cryptocop_operation *operation);

int cryptocop_job_queue_insert_user_job(struct cryptocop_operation *operation);

#endif /* __KERNEL__ */

#endif /* CRYPTOCOP_H */
2 changes: 1 addition & 1 deletion arch/cris/include/arch-v32/arch/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static inline int arch_write_trylock(arch_rwlock_t *rw)
ret = 1;
}
arch_spin_unlock(&rw->slock);
return 1;
return ret;
}

#define _raw_read_lock_flags(lock, flags) _raw_read_lock(lock)
Expand Down
5 changes: 0 additions & 5 deletions arch/cris/include/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
include include/asm-generic/Kbuild.asm

header-y += arch-v10/
header-y += arch-v32/

header-y += ethernet.h
header-y += etraxgpio.h
header-y += rs485.h
header-y += sync_serial.h

generic-y += clkdev.h
generic-y += exec.h
Expand Down
5 changes: 1 addition & 4 deletions arch/cris/include/asm/ptrace.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
#ifndef _CRIS_PTRACE_H
#define _CRIS_PTRACE_H

#include <arch/ptrace.h>
#include <uapi/asm/ptrace.h>

#ifdef __KERNEL__

/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
#define PTRACE_GETREGS 12
#define PTRACE_SETREGS 13

#define profile_pc(regs) instruction_pointer(regs)

#endif /* __KERNEL__ */

#endif /* _CRIS_PTRACE_H */
121 changes: 1 addition & 120 deletions arch/cris/include/asm/signal.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
#ifndef _ASM_CRIS_SIGNAL_H
#define _ASM_CRIS_SIGNAL_H

#include <linux/types.h>
#include <uapi/asm/signal.h>

/* Avoid too many header ordering problems. */
struct siginfo;

#ifdef __KERNEL__
/* Most things should be clean enough to redefine this at will, if care
is taken to make libc match. */

Expand All @@ -20,95 +16,6 @@ typedef struct {
unsigned long sig[_NSIG_WORDS];
} sigset_t;

#else
/* Here we must cater to libcs that poke about in kernel headers. */

#define NSIG 32
typedef unsigned long sigset_t;

#endif /* __KERNEL__ */

#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
#define SIGILL 4
#define SIGTRAP 5
#define SIGABRT 6
#define SIGIOT 6
#define SIGBUS 7
#define SIGFPE 8
#define SIGKILL 9
#define SIGUSR1 10
#define SIGSEGV 11
#define SIGUSR2 12
#define SIGPIPE 13
#define SIGALRM 14
#define SIGTERM 15
#define SIGSTKFLT 16
#define SIGCHLD 17
#define SIGCONT 18
#define SIGSTOP 19
#define SIGTSTP 20
#define SIGTTIN 21
#define SIGTTOU 22
#define SIGURG 23
#define SIGXCPU 24
#define SIGXFSZ 25
#define SIGVTALRM 26
#define SIGPROF 27
#define SIGWINCH 28
#define SIGIO 29
#define SIGPOLL SIGIO
/*
#define SIGLOST 29
*/
#define SIGPWR 30
#define SIGSYS 31
#define SIGUNUSED 31

/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX _NSIG

/*
* SA_FLAGS values:
*
* SA_ONSTACK indicates that a registered stack_t will be used.
* SA_RESTART flag to get restarting signals (which were the default long ago)
* SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
* SA_RESETHAND clears the handler when the signal is delivered.
* SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
* SA_NODEFER prevents the current signal from being masked in the handler.
*
* SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
* Unix names RESETHAND and NODEFER respectively.
*/

#define SA_NOCLDSTOP 0x00000001u
#define SA_NOCLDWAIT 0x00000002u
#define SA_SIGINFO 0x00000004u
#define SA_ONSTACK 0x08000000u
#define SA_RESTART 0x10000000u
#define SA_NODEFER 0x40000000u
#define SA_RESETHAND 0x80000000u

#define SA_NOMASK SA_NODEFER
#define SA_ONESHOT SA_RESETHAND

#define SA_RESTORER 0x04000000

/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2

#define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192

#include <asm-generic/signal-defs.h>

#ifdef __KERNEL__
struct old_sigaction {
__sighandler_t sa_handler;
old_sigset_t sa_mask;
Expand All @@ -126,32 +33,6 @@ struct sigaction {
struct k_sigaction {
struct sigaction sa;
};
#else
/* Here we must cater to libcs that poke about in kernel headers. */

struct sigaction {
union {
__sighandler_t _sa_handler;
void (*_sa_sigaction)(int, struct siginfo *, void *);
} _u;
sigset_t sa_mask;
unsigned long sa_flags;
void (*sa_restorer)(void);
};

#define sa_handler _u._sa_handler
#define sa_sigaction _u._sa_sigaction

#endif /* __KERNEL__ */

typedef struct sigaltstack {
void *ss_sp;
int ss_flags;
size_t ss_size;
} stack_t;

#ifdef __KERNEL__
#include <asm/sigcontext.h>
#endif /* __KERNEL__ */

#endif
3 changes: 1 addition & 2 deletions arch/cris/include/asm/swab.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#ifndef _CRIS_SWAB_H
#define _CRIS_SWAB_H

#ifdef __KERNEL__
#include <arch/swab.h>
#endif /* __KERNEL__ */
#include <uapi/asm/swab.h>

#endif /* _CRIS_SWAB_H */
43 changes: 1 addition & 42 deletions arch/cris/include/asm/termios.h
Original file line number Diff line number Diff line change
@@ -1,47 +1,8 @@
#ifndef _CRIS_TERMIOS_H
#define _CRIS_TERMIOS_H

#include <asm/termbits.h>
#include <asm/ioctls.h>
#include <asm/rs485.h>
#include <linux/serial.h>
#include <uapi/asm/termios.h>

struct winsize {
unsigned short ws_row;
unsigned short ws_col;
unsigned short ws_xpixel;
unsigned short ws_ypixel;
};

#define NCC 8
struct termio {
unsigned short c_iflag; /* input mode flags */
unsigned short c_oflag; /* output mode flags */
unsigned short c_cflag; /* control mode flags */
unsigned short c_lflag; /* local mode flags */
unsigned char c_line; /* line discipline */
unsigned char c_cc[NCC]; /* control characters */
};

/* modem lines */
#define TIOCM_LE 0x001
#define TIOCM_DTR 0x002
#define TIOCM_RTS 0x004
#define TIOCM_ST 0x008
#define TIOCM_SR 0x010
#define TIOCM_CTS 0x020
#define TIOCM_CAR 0x040
#define TIOCM_RNG 0x080
#define TIOCM_DSR 0x100
#define TIOCM_CD TIOCM_CAR
#define TIOCM_RI TIOCM_RNG
#define TIOCM_OUT1 0x2000
#define TIOCM_OUT2 0x4000
#define TIOCM_LOOP 0x8000

/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */

#ifdef __KERNEL__

/* intr=^C quit=^\ erase=del kill=^U
eof=^D vtime=\0 vmin=\1 sxtc=\0
Expand Down Expand Up @@ -87,6 +48,4 @@ struct termio {
#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))

#endif /* __KERNEL__ */

#endif /* _CRIS_TERMIOS_H */
Loading

0 comments on commit 0c54450

Please sign in to comment.