[package] kernel: remove references to TARGET_ubicom32
[openwrt.git] / toolchain / kernel-headers / patches-2.6.30 / 100-ubicom32_headers.patch
1 --- /dev/null
2 +++ b/arch/ubicom32/include/asm/a.out.h
3 @@ -0,0 +1,47 @@
4 +/*
5 + * arch/ubicom32/include/asm/a.out.h
6 + *   Definitions for Ubicom32 a.out executable format.
7 + *
8 + * (C) Copyright 2009, Ubicom, Inc.
9 + *
10 + * This file is part of the Ubicom32 Linux Kernel Port.
11 + *
12 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
13 + * it and/or modify it under the terms of the GNU General Public License
14 + * as published by the Free Software Foundation, either version 2 of the
15 + * License, or (at your option) any later version.
16 + *
17 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
18 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
19 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
20 + * the GNU General Public License for more details.
21 + *
22 + * You should have received a copy of the GNU General Public License
23 + * along with the Ubicom32 Linux Kernel Port.  If not, 
24 + * see <http://www.gnu.org/licenses/>.
25 + *
26 + * Ubicom32 implementation derived from (with many thanks):
27 + *   arch/m68knommu
28 + *   arch/blackfin
29 + *   arch/parisc
30 + */
31 +#ifndef _ASM_UBICOM32_A_OUT_H
32 +#define _ASM_UBICOM32_A_OUT_H
33 +
34 +struct exec
35 +{
36 +  unsigned long a_info;                /* Use macros N_MAGIC, etc for access */
37 +  unsigned a_text;             /* length of text, in bytes */
38 +  unsigned a_data;             /* length of data, in bytes */
39 +  unsigned a_bss;              /* length of uninitialized data area for file, in bytes */
40 +  unsigned a_syms;             /* length of symbol table data in file, in bytes */
41 +  unsigned a_entry;            /* start address */
42 +  unsigned a_trsize;           /* length of relocation info for text, in bytes */
43 +  unsigned a_drsize;           /* length of relocation info for data, in bytes */
44 +};
45 +
46 +#define N_TRSIZE(a)    ((a).a_trsize)
47 +#define N_DRSIZE(a)    ((a).a_drsize)
48 +#define N_SYMSIZE(a)   ((a).a_syms)
49 +
50 +#endif /* _ASM_UBICOM32_A_OUT_H */
51 --- /dev/null
52 +++ b/arch/ubicom32/include/asm/auxvec.h
53 @@ -0,0 +1,32 @@
54 +/*
55 + * arch/ubicom32/include/asm/auxvec.h
56 + *   Symbolic values for the entries in the auxiliary table
57 + *   put on the initial stack.
58 + *
59 + * (C) Copyright 2009, Ubicom, Inc.
60 + *
61 + * This file is part of the Ubicom32 Linux Kernel Port.
62 + *
63 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
64 + * it and/or modify it under the terms of the GNU General Public License
65 + * as published by the Free Software Foundation, either version 2 of the
66 + * License, or (at your option) any later version.
67 + *
68 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
69 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
70 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
71 + * the GNU General Public License for more details.
72 + *
73 + * You should have received a copy of the GNU General Public License
74 + * along with the Ubicom32 Linux Kernel Port.  If not, 
75 + * see <http://www.gnu.org/licenses/>.
76 + *
77 + * Ubicom32 implementation derived from (with many thanks):
78 + *   arch/m68knommu
79 + *   arch/blackfin
80 + *   arch/parisc
81 + */
82 +#ifndef _ASM_UBICOM32_AUXVEC_H
83 +#define _ASM_UBICOM32_AUXVEC_H
84 +
85 +#endif /* _ASM_UBICOM32_AUXVEC_H */
86 --- /dev/null
87 +++ b/arch/ubicom32/include/asm/bitops.h
88 @@ -0,0 +1,41 @@
89 +/*
90 + * arch/ubicom32/include/asm/bitops.h
91 + *   Bit manipulation definitions for Ubicom32 architecture.
92 + *
93 + * (C) Copyright 2009, Ubicom, Inc.
94 + *
95 + * This file is part of the Ubicom32 Linux Kernel Port.
96 + *
97 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
98 + * it and/or modify it under the terms of the GNU General Public License
99 + * as published by the Free Software Foundation, either version 2 of the
100 + * License, or (at your option) any later version.
101 + *
102 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
103 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
104 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
105 + * the GNU General Public License for more details.
106 + *
107 + * You should have received a copy of the GNU General Public License
108 + * along with the Ubicom32 Linux Kernel Port.  If not, 
109 + * see <http://www.gnu.org/licenses/>.
110 + *
111 + * Ubicom32 implementation derived from (with many thanks):
112 + *   arch/m68knommu
113 + *   arch/blackfin
114 + *   arch/parisc
115 + */
116 +#ifndef _ASM_UBICOM32_BITOPS_H
117 +#define _ASM_UBICOM32_BITOPS_H
118 +
119 +/*
120 + * Copyright 1992, Linus Torvalds.
121 + */
122 +
123 +#include <linux/compiler.h>
124 +#include <asm/byteorder.h>     /* swab32 */
125 +
126 +#include <asm-generic/bitops/fls.h>
127 +#include <asm-generic/bitops/fls64.h>
128 +
129 +#endif /* _ASM_UBICOM32_BITOPS_H */
130 --- /dev/null
131 +++ b/arch/ubicom32/include/asm/board.h
132 @@ -0,0 +1,34 @@
133 +/*
134 + * arch/ubicom32/include/asm/board.h
135 + *   Board init and revision definitions for Ubicom32 architecture.
136 + *
137 + * (C) Copyright 2009, Ubicom, Inc.
138 + *
139 + * This file is part of the Ubicom32 Linux Kernel Port.
140 + *
141 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
142 + * it and/or modify it under the terms of the GNU General Public License
143 + * as published by the Free Software Foundation, either version 2 of the
144 + * License, or (at your option) any later version.
145 + *
146 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
147 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
148 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
149 + * the GNU General Public License for more details.
150 + *
151 + * You should have received a copy of the GNU General Public License
152 + * along with the Ubicom32 Linux Kernel Port.  If not, 
153 + * see <http://www.gnu.org/licenses/>.
154 + *
155 + * Ubicom32 implementation derived from (with many thanks):
156 + *   arch/m68knommu
157 + *   arch/blackfin
158 + *   arch/parisc
159 + */
160 +#ifndef _ASM_UBICOM32_BOARD_H
161 +#define _ASM_UBICOM32_BOARD_H
162 +
163 +extern const char *board_get_revision(void);
164 +extern void __init board_init(void);
165 +
166 +#endif /* _ASM_UBICOM32_BOARD_H */
167 --- /dev/null
168 +++ b/arch/ubicom32/include/asm/byteorder.h
169 @@ -0,0 +1,35 @@
170 +/*
171 + * arch/ubicom32/include/asm/byteorder.h
172 + *   Byte order swapping utility routines.
173 + *
174 + * (C) Copyright 2009, Ubicom, Inc.
175 + *
176 + * This file is part of the Ubicom32 Linux Kernel Port.
177 + *
178 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
179 + * it and/or modify it under the terms of the GNU General Public License
180 + * as published by the Free Software Foundation, either version 2 of the
181 + * License, or (at your option) any later version.
182 + *
183 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
184 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
185 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
186 + * the GNU General Public License for more details.
187 + *
188 + * You should have received a copy of the GNU General Public License
189 + * along with the Ubicom32 Linux Kernel Port.  If not, 
190 + * see <http://www.gnu.org/licenses/>.
191 + *
192 + * Ubicom32 implementation derived from (with many thanks):
193 + *   arch/m68knommu
194 + *   arch/blackfin
195 + *   arch/parisc
196 + */
197 +#ifndef _ASM_UBICOM32_BYTEORDER_H
198 +#define _ASM_UBICOM32_BYTEORDER_H
199 +
200 +#include <linux/types.h>
201 +#include <linux/byteorder/big_endian.h>
202 +
203 +#endif /* _ASM_UBICOM32_BYTEORDER_H */
204 +
205 --- /dev/null
206 +++ b/arch/ubicom32/include/asm/elf.h
207 @@ -0,0 +1,167 @@
208 +/*
209 + * arch/ubicom32/include/asm/elf.h
210 + *   Definitions for elf executable format for Ubicom32 architecture.
211 + *
212 + * (C) Copyright 2009, Ubicom, Inc.
213 + *
214 + * This file is part of the Ubicom32 Linux Kernel Port.
215 + *
216 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
217 + * it and/or modify it under the terms of the GNU General Public License
218 + * as published by the Free Software Foundation, either version 2 of the
219 + * License, or (at your option) any later version.
220 + *
221 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
222 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
223 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
224 + * the GNU General Public License for more details.
225 + *
226 + * You should have received a copy of the GNU General Public License
227 + * along with the Ubicom32 Linux Kernel Port.  If not,
228 + * see <http://www.gnu.org/licenses/>.
229 + *
230 + * Ubicom32 implementation derived from (with many thanks):
231 + *   arch/m68knommu
232 + *   arch/blackfin
233 + *   arch/parisc
234 + */
235 +#ifndef _ASM_UBICOM32_ELF_H
236 +#define _ASM_UBICOM32_ELF_H
237 +
238 +/*
239 + * ELF register definitions..
240 + */
241 +
242 +#include <asm/ptrace.h>
243 +#include <asm/user.h>
244 +
245 +/*
246 + * Processor specific flags for the ELF header e_flags field.
247 + */
248 +#define EF_UBICOM32_V3         0x00000001      /* -fmarch=ubicom32v3 */
249 +#define EF_UBICOM32_V4         0x00000002      /* -fmarch=ubicom32v4 */
250 +#define EF_UBICOM32_PIC                0x80000000      /* -fpic */
251 +#define EF_UBICOM32_FDPIC      0x40000000      /* -mfdpic */
252 +
253 +/*
254 + * Ubicom32 ELF relocation types
255 + */
256 +#define R_UBICOM32_NONE                        0
257 +#define R_UBICOM32_16                  1
258 +#define R_UBICOM32_32                  2
259 +#define R_UBICOM32_LO16                        3
260 +#define R_UBICOM32_HI16                        4
261 +#define R_UBICOM32_21_PCREL            5
262 +#define R_UBICOM32_24_PCREL            6
263 +#define R_UBICOM32_HI24                        7
264 +#define R_UBICOM32_LO7_S               8
265 +#define R_UBICOM32_LO7_2_S             9
266 +#define R_UBICOM32_LO7_4_S             10
267 +#define R_UBICOM32_LO7_D               11
268 +#define R_UBICOM32_LO7_2_D             12
269 +#define R_UBICOM32_LO7_4_D             13
270 +#define R_UBICOM32_32_HARVARD          14
271 +#define R_UBICOM32_LO7_CALLI           15
272 +#define R_UBICOM32_LO16_CALLI          16
273 +#define R_UBICOM32_GOT_HI24            17
274 +#define R_UBICOM32_GOT_LO7_S           18
275 +#define R_UBICOM32_GOT_LO7_2_S         19
276 +#define R_UBICOM32_GOT_LO7_4_S         20
277 +#define R_UBICOM32_GOT_LO7_D           21
278 +#define R_UBICOM32_GOT_LO7_2_D         22
279 +#define R_UBICOM32_GOT_LO7_4_D         23
280 +#define R_UBICOM32_FUNCDESC_GOT_HI24    24
281 +#define R_UBICOM32_FUNCDESC_GOT_LO7_S   25
282 +#define R_UBICOM32_FUNCDESC_GOT_LO7_2_S 26
283 +#define R_UBICOM32_FUNCDESC_GOT_LO7_4_S 27
284 +#define R_UBICOM32_FUNCDESC_GOT_LO7_D   28
285 +#define R_UBICOM32_FUNCDESC_GOT_LO7_2_D 29
286 +#define R_UBICOM32_FUNCDESC_GOT_LO7_4_D 30
287 +#define R_UBICOM32_GOT_LO7_CALLI        31
288 +#define R_UBICOM32_FUNCDESC_GOT_LO7_CALLI 32
289 +#define R_UBICOM32_FUNCDESC_VALUE       33
290 +#define R_UBICOM32_FUNCDESC             34
291 +#define R_UBICOM32_GOTOFFSET_LO         35
292 +#define R_UBICOM32_GOTOFFSET_HI         36
293 +#define R_UBICOM32_FUNCDESC_GOTOFFSET_LO 37
294 +#define R_UBICOM32_FUNCDESC_GOTOFFSET_HI 38
295 +#define R_UBICOM32_GNU_VTINHERIT        200
296 +#define R_UBICOM32_GNU_VTENTRY          201
297 +
298 +typedef unsigned long elf_greg_t;
299 +
300 +#define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t))
301 +typedef elf_greg_t elf_gregset_t[ELF_NGREG];
302 +
303 +typedef struct user_ubicom32fp_struct elf_fpregset_t;
304 +
305 +/*
306 + * This is used to ensure we don't load something for the wrong architecture.
307 + */
308 +#define elf_check_arch(x) ((x)->e_machine == EM_UBICOM32)
309 +
310 +#define elf_check_fdpic(x) ((x)->e_flags & EF_UBICOM32_FDPIC)
311 +
312 +#define elf_check_const_displacement(x) ((x)->e_flags & EF_UBICOM32_PIC)
313 +
314 +/*
315 + * These are used to set parameters in the core dumps.
316 + */
317 +#define ELF_CLASS      ELFCLASS32
318 +#define ELF_DATA       ELFDATA2MSB
319 +#define ELF_ARCH       EM_UBICOM32
320 +
321 +/* For SVR4/m68k the function pointer to be registered with `atexit' is
322 +   passed in %a1.  Although my copy of the ABI has no such statement, it
323 +   is actually used on ASV.  */
324 +#define ELF_PLAT_INIT(_r, load_addr)   _r->a1 = 0
325 +
326 +#define ELF_FDPIC_PLAT_INIT(_regs, _exec_map_addr, _interp_map_addr,   \
327 +                           _dynamic_addr)                              \
328 +       do {                                                            \
329 +               _regs->dn[1]    = _exec_map_addr;                       \
330 +               _regs->dn[2]    = _interp_map_addr;                     \
331 +               _regs->dn[3]    = _dynamic_addr;                        \
332 +               _regs->an[1]    = 0; /* dl_fini will be set by ldso */  \
333 +       } while (0)
334 +
335 +#define USE_ELF_CORE_DUMP
336 +#define ELF_EXEC_PAGESIZE      4096
337 +
338 +#ifdef __KERNEL__
339 +#ifdef CONFIG_UBICOM32_V4
340 +#define ELF_FDPIC_CORE_EFLAGS  (EF_UBICOM32_FDPIC | EF_UBICOM32_V4)
341 +#elif defined CONFIG_UBICOM32_V3
342 +#define ELF_FDPIC_CORE_EFLAGS  (EF_UBICOM32_FDPIC | EF_UBICOM32_V3)
343 +#else
344 +#error Unknown/Unsupported ubicom32 architecture.
345 +#endif
346 +#endif
347 +
348 +/* This is the location that an ET_DYN program is loaded if exec'ed.  Typical
349 +   use of this is to invoke "./ld.so someprog" to test out a new version of
350 +   the loader.  We need to make sure that it is out of the way of the program
351 +   that it will "exec", and that there is sufficient room for the brk.  */
352 +
353 +#define ELF_ET_DYN_BASE         0xD0000000UL
354 +
355 +/*
356 + * For Ubicom32, the elf_gregset_t and struct pt_regs are the same size
357 + * data structure so a copy is performed instead of providing the
358 + * ELF_CORE_COPY_REGS macro.
359 + */
360 +
361 +/* This yields a mask that user programs can use to figure out what
362 +   instruction set this cpu supports.  */
363 +
364 +#define ELF_HWCAP      (0)
365 +
366 +/* This yields a string that ld.so will use to load implementation
367 +   specific libraries for optimization.  This is more specific in
368 +   intent than poking at uname or /proc/cpuinfo.  */
369 +
370 +#define ELF_PLATFORM  (NULL)
371 +
372 +#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
373 +
374 +#endif /* _ASM_UBICOM32_ELF_H */
375 --- /dev/null
376 +++ b/arch/ubicom32/include/asm/errno.h
377 @@ -0,0 +1,33 @@
378 +/*
379 + * arch/ubicom32/include/asm/errno.h
380 + *   Generic errno.h for Ubicom32 architecture.
381 + *
382 + * (C) Copyright 2009, Ubicom, Inc.
383 + *
384 + * This file is part of the Ubicom32 Linux Kernel Port.
385 + *
386 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
387 + * it and/or modify it under the terms of the GNU General Public License
388 + * as published by the Free Software Foundation, either version 2 of the
389 + * License, or (at your option) any later version.
390 + *
391 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
392 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
393 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
394 + * the GNU General Public License for more details.
395 + *
396 + * You should have received a copy of the GNU General Public License
397 + * along with the Ubicom32 Linux Kernel Port.  If not, 
398 + * see <http://www.gnu.org/licenses/>.
399 + *
400 + * Ubicom32 implementation derived from (with many thanks):
401 + *   arch/m68knommu
402 + *   arch/blackfin
403 + *   arch/parisc
404 + */
405 +#ifndef _ASM_UBICOM32_ERRNO_H
406 +#define _ASM_UBICOM32_ERRNO_H
407 +
408 +#include <asm-generic/errno.h>
409 +
410 +#endif /* _ASM_UBICOM32_ERRNO_H */
411 --- /dev/null
412 +++ b/arch/ubicom32/include/asm/fcntl.h
413 @@ -0,0 +1,38 @@
414 +/*
415 + * arch/ubicom32/include/asm/fcntl.h
416 + *   File control bit definitions for Ubicom32 architecture.
417 + *
418 + * (C) Copyright 2009, Ubicom, Inc.
419 + *
420 + * This file is part of the Ubicom32 Linux Kernel Port.
421 + *
422 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
423 + * it and/or modify it under the terms of the GNU General Public License
424 + * as published by the Free Software Foundation, either version 2 of the
425 + * License, or (at your option) any later version.
426 + *
427 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
428 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
429 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
430 + * the GNU General Public License for more details.
431 + *
432 + * You should have received a copy of the GNU General Public License
433 + * along with the Ubicom32 Linux Kernel Port.  If not, 
434 + * see <http://www.gnu.org/licenses/>.
435 + *
436 + * Ubicom32 implementation derived from (with many thanks):
437 + *   arch/m68knommu
438 + *   arch/blackfin
439 + *   arch/parisc
440 + */
441 +#ifndef _ASM_UBICOM32_FCNTL_H
442 +#define _ASM_UBICOM32_FCNTL_H
443 +
444 +#define O_DIRECTORY    040000  /* must be a directory */
445 +#define O_NOFOLLOW     0100000 /* don't follow links */
446 +#define O_DIRECT       0200000 /* direct disk access hint - currently ignored */
447 +#define O_LARGEFILE    0400000
448 +
449 +#include <asm-generic/fcntl.h>
450 +
451 +#endif /* _ASM_UBICOM32_FCNTL_H */
452 --- /dev/null
453 +++ b/arch/ubicom32/include/asm/flat.h
454 @@ -0,0 +1,73 @@
455 +/*
456 + * arch/ubicom32/include/asm/flat.h
457 + *   Definitions to support flat-format executables.
458 + *
459 + * (C) Copyright 2009, Ubicom, Inc.
460 + *
461 + * This file is part of the Ubicom32 Linux Kernel Port.
462 + *
463 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
464 + * it and/or modify it under the terms of the GNU General Public License
465 + * as published by the Free Software Foundation, either version 2 of the
466 + * License, or (at your option) any later version.
467 + *
468 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
469 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
470 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
471 + * the GNU General Public License for more details.
472 + *
473 + * You should have received a copy of the GNU General Public License
474 + * along with the Ubicom32 Linux Kernel Port.  If not, 
475 + * see <http://www.gnu.org/licenses/>.
476 + *
477 + * Ubicom32 implementation derived from (with many thanks):
478 + *   arch/m68knommu
479 + *   arch/blackfin
480 + *   arch/parisc
481 + */
482 +
483 +#ifndef _ASM_UBICOM32_FLAT_H
484 +#define _ASM_UBICOM32_FLAT_H
485 +
486 +#define ARCH_FLAT_ALIGN 0x80
487 +#define ARCH_FLAT_ALIGN_TEXT 1
488 +
489 +#define  R_UBICOM32_32         2
490 +#define  R_UBICOM32_HI24       7
491 +#define  R_UBICOM32_LO7_S      8
492 +#define  R_UBICOM32_LO7_2_S    9
493 +#define  R_UBICOM32_LO7_4_S    10
494 +#define  R_UBICOM32_LO7_D      11
495 +#define  R_UBICOM32_LO7_2_D    12
496 +#define  R_UBICOM32_LO7_4_D    13
497 +#define  R_UBICOM32_LO7_CALLI  15
498 +#define  R_UBICOM32_LO16_CALLI 16
499 +
500 +extern void ubicom32_flat_put_addr_at_rp(unsigned long *rp, u32_t val, u32_t rval, unsigned long  *p);
501 +extern unsigned long ubicom32_flat_get_addr_from_rp(unsigned long *rp, u32_t relval, u32_t flags, unsigned long *p);
502 +
503 +#define        flat_stack_align(sp)                    /* nothing needed */
504 +#define        flat_argvp_envp_on_stack()              1
505 +#define        flat_old_ram_flag(flags)                (flags)
506 +#define        flat_reloc_valid(reloc, size)           ((reloc) <= (size))
507 +#define        flat_get_addr_from_rp(rp, relval, flags, p)     (ubicom32_flat_get_addr_from_rp(rp, relval,flags, p))
508 +#define        flat_put_addr_at_rp(rp, val, relval)    do {ubicom32_flat_put_addr_at_rp(rp, val, relval, &persistent);} while(0)
509 +#define        flat_get_relocate_addr(rel)             ((persistent) ? (persistent & 0x07ffffff) : (rel & 0x07ffffff))
510 +
511 +static inline int flat_set_persistent(unsigned int relval, unsigned long *p)
512 +{
513 +       if (*p) {
514 +               return 0;
515 +       } else {
516 +               if ((relval >> 27) != R_UBICOM32_32) {
517 +                       /*
518 +                        * Something other than UBICOM32_32. The next entry has the relocation.
519 +                        */
520 +                       *p = relval;
521 +                       return 1;
522 +               }
523 +       }
524 +       return 0;
525 +}
526 +
527 +#endif /* _ASM_UBICOM32_FLAT_H */
528 --- /dev/null
529 +++ b/arch/ubicom32/include/asm/fpu.h
530 @@ -0,0 +1,37 @@
531 +/*
532 + * arch/ubicom32/include/asm/fpu.h
533 + *   Floating point state definitions for Ubicom32 architecture.
534 + *
535 + * (C) Copyright 2009, Ubicom, Inc.
536 + *
537 + * This file is part of the Ubicom32 Linux Kernel Port.
538 + *
539 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
540 + * it and/or modify it under the terms of the GNU General Public License
541 + * as published by the Free Software Foundation, either version 2 of the
542 + * License, or (at your option) any later version.
543 + *
544 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
545 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
546 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
547 + * the GNU General Public License for more details.
548 + *
549 + * You should have received a copy of the GNU General Public License
550 + * along with the Ubicom32 Linux Kernel Port.  If not, 
551 + * see <http://www.gnu.org/licenses/>.
552 + *
553 + * Ubicom32 implementation derived from (with many thanks):
554 + *   arch/m68knommu
555 + *   arch/blackfin
556 + *   arch/parisc
557 + */
558 +#ifndef _ASM_UBICOM32_FPU_H
559 +#define _ASM_UBICOM32_FPU_H
560 +
561 +/*
562 + * MAX floating point unit state size (FSAVE/FRESTORE)
563 + */
564 +/* No FP unit present then... */
565 +#define FPSTATESIZE (2) /* dummy size */
566 +
567 +#endif /* _ASM_UBICOM32_FPU_H */
568 --- /dev/null
569 +++ b/arch/ubicom32/include/asm/futex.h
570 @@ -0,0 +1,33 @@
571 +/*
572 + * arch/ubicom32/include/asm/futex.h
573 + *   Generic futex.h for Ubicom32 architecture.
574 + *
575 + * (C) Copyright 2009, Ubicom, Inc.
576 + *
577 + * This file is part of the Ubicom32 Linux Kernel Port.
578 + *
579 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
580 + * it and/or modify it under the terms of the GNU General Public License
581 + * as published by the Free Software Foundation, either version 2 of the
582 + * License, or (at your option) any later version.
583 + *
584 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
585 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
586 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
587 + * the GNU General Public License for more details.
588 + *
589 + * You should have received a copy of the GNU General Public License
590 + * along with the Ubicom32 Linux Kernel Port.  If not, 
591 + * see <http://www.gnu.org/licenses/>.
592 + *
593 + * Ubicom32 implementation derived from (with many thanks):
594 + *   arch/m68knommu
595 + *   arch/blackfin
596 + *   arch/parisc
597 + */
598 +#ifndef _ASM_UBICOM32_FUTEX_H
599 +#define _ASM_UBICOM32_FUTEX_H
600 +
601 +#include <asm-generic/futex.h>
602 +
603 +#endif /* _ASM_UBICOM32_FUTEX_H */
604 --- /dev/null
605 +++ b/arch/ubicom32/include/asm/ioctl.h
606 @@ -0,0 +1,33 @@
607 +/*
608 + * arch/ubicom32/include/asm/ioctl.h
609 + *   Generic ioctl.h for Ubicom32 architecture.
610 + *
611 + * (C) Copyright 2009, Ubicom, Inc.
612 + *
613 + * This file is part of the Ubicom32 Linux Kernel Port.
614 + *
615 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
616 + * it and/or modify it under the terms of the GNU General Public License
617 + * as published by the Free Software Foundation, either version 2 of the
618 + * License, or (at your option) any later version.
619 + *
620 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
621 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
622 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
623 + * the GNU General Public License for more details.
624 + *
625 + * You should have received a copy of the GNU General Public License
626 + * along with the Ubicom32 Linux Kernel Port.  If not, 
627 + * see <http://www.gnu.org/licenses/>.
628 + *
629 + * Ubicom32 implementation derived from (with many thanks):
630 + *   arch/m68knommu
631 + *   arch/blackfin
632 + *   arch/parisc
633 + */
634 +#ifndef _ASM_UBICOM32_IOCTL_H
635 +#define _ASM_UBICOM32_IOCTL_H
636 +
637 +#include <asm-generic/ioctl.h>
638 +
639 +#endif /* _ASM_UBICOM32_IOCTL_H */
640 --- /dev/null
641 +++ b/arch/ubicom32/include/asm/ioctls.h
642 @@ -0,0 +1,111 @@
643 +/*
644 + * arch/ubicom32/include/asm/ioctls.h
645 + *   Definitions of ioctls for Ubicom32 architecture.
646 + *
647 + * (C) Copyright 2009, Ubicom, Inc.
648 + *
649 + * This file is part of the Ubicom32 Linux Kernel Port.
650 + *
651 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
652 + * it and/or modify it under the terms of the GNU General Public License
653 + * as published by the Free Software Foundation, either version 2 of the
654 + * License, or (at your option) any later version.
655 + *
656 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
657 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
658 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
659 + * the GNU General Public License for more details.
660 + *
661 + * You should have received a copy of the GNU General Public License
662 + * along with the Ubicom32 Linux Kernel Port.  If not, 
663 + * see <http://www.gnu.org/licenses/>.
664 + *
665 + * Ubicom32 implementation derived from (with many thanks):
666 + *   arch/m68knommu
667 + *   arch/blackfin
668 + *   arch/parisc
669 + */
670 +#ifndef _ASM_UBICOM32_IOCTLS_H
671 +#define _ASM_UBICOM32_IOCTLS_H
672 +
673 +#include <asm/ioctl.h>
674 +
675 +/* 0x54 is just a magic number to make these relatively unique ('T') */
676 +
677 +#define TCGETS         0x5401
678 +#define TCSETS         0x5402
679 +#define TCSETSW                0x5403
680 +#define TCSETSF                0x5404
681 +#define TCGETA         0x5405
682 +#define TCSETA         0x5406
683 +#define TCSETAW                0x5407
684 +#define TCSETAF                0x5408
685 +#define TCSBRK         0x5409
686 +#define TCXONC         0x540A
687 +#define TCFLSH         0x540B
688 +#define TIOCEXCL       0x540C
689 +#define TIOCNXCL       0x540D
690 +#define TIOCSCTTY      0x540E
691 +#define TIOCGPGRP      0x540F
692 +#define TIOCSPGRP      0x5410
693 +#define TIOCOUTQ       0x5411
694 +#define TIOCSTI                0x5412
695 +#define TIOCGWINSZ     0x5413
696 +#define TIOCSWINSZ     0x5414
697 +#define TIOCMGET       0x5415
698 +#define TIOCMBIS       0x5416
699 +#define TIOCMBIC       0x5417
700 +#define TIOCMSET       0x5418
701 +#define TIOCGSOFTCAR   0x5419
702 +#define TIOCSSOFTCAR   0x541A
703 +#define FIONREAD       0x541B
704 +#define TIOCINQ                FIONREAD
705 +#define TIOCLINUX      0x541C
706 +#define TIOCCONS       0x541D
707 +#define TIOCGSERIAL    0x541E
708 +#define TIOCSSERIAL    0x541F
709 +#define TIOCPKT                0x5420
710 +#define FIONBIO                0x5421
711 +#define TIOCNOTTY      0x5422
712 +#define TIOCSETD       0x5423
713 +#define TIOCGETD       0x5424
714 +#define TCSBRKP                0x5425  /* Needed for POSIX tcsendbreak() */
715 +#define TIOCSBRK       0x5427  /* BSD compatibility */
716 +#define TIOCCBRK       0x5428  /* BSD compatibility */
717 +#define TIOCGSID       0x5429  /* Return the session ID of FD */
718 +#define TCGETS2                _IOR('T',0x2A, struct termios2)
719 +#define TCSETS2                _IOW('T',0x2B, struct termios2)
720 +#define TCSETSW2       _IOW('T',0x2C, struct termios2)
721 +#define TCSETSF2       _IOW('T',0x2D, struct termios2)
722 +#define TIOCGPTN       _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
723 +#define TIOCSPTLCK     _IOW('T',0x31, int)  /* Lock/unlock Pty */
724 +
725 +#define FIONCLEX       0x5450  /* these numbers need to be adjusted. */
726 +#define FIOCLEX                0x5451
727 +#define FIOASYNC       0x5452
728 +#define TIOCSERCONFIG  0x5453
729 +#define TIOCSERGWILD   0x5454
730 +#define TIOCSERSWILD   0x5455
731 +#define TIOCGLCKTRMIOS 0x5456
732 +#define TIOCSLCKTRMIOS 0x5457
733 +#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
734 +#define TIOCSERGETLSR   0x5459 /* Get line status register */
735 +#define TIOCSERGETMULTI 0x545A /* Get multiport config  */
736 +#define TIOCSERSETMULTI 0x545B /* Set multiport config */
737 +
738 +#define TIOCMIWAIT     0x545C  /* wait for a change on serial input line(s) */
739 +#define TIOCGICOUNT    0x545D  /* read serial port inline interrupt counts */
740 +#define FIOQSIZE       0x545E
741 +
742 +/* Used for packet mode */
743 +#define TIOCPKT_DATA            0
744 +#define TIOCPKT_FLUSHREAD       1
745 +#define TIOCPKT_FLUSHWRITE      2
746 +#define TIOCPKT_STOP            4
747 +#define TIOCPKT_START           8
748 +#define TIOCPKT_NOSTOP         16
749 +#define TIOCPKT_DOSTOP         32
750 +
751 +#define TIOCSER_TEMT    0x01   /* Transmitter physically empty */
752 +
753 +#endif /* _ASM_UBICOM32_IOCTLS_H */
754 --- /dev/null
755 +++ b/arch/ubicom32/include/asm/ipcbuf.h
756 @@ -0,0 +1,55 @@
757 +/*
758 + * arch/ubicom32/include/asm/ipcbuf.h
759 + *   Definition of ipc64_perm struct for Ubicom32 architecture.
760 + *
761 + * (C) Copyright 2009, Ubicom, Inc.
762 + *
763 + * This file is part of the Ubicom32 Linux Kernel Port.
764 + *
765 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
766 + * it and/or modify it under the terms of the GNU General Public License
767 + * as published by the Free Software Foundation, either version 2 of the
768 + * License, or (at your option) any later version.
769 + *
770 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
771 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
772 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
773 + * the GNU General Public License for more details.
774 + *
775 + * You should have received a copy of the GNU General Public License
776 + * along with the Ubicom32 Linux Kernel Port.  If not, 
777 + * see <http://www.gnu.org/licenses/>.
778 + *
779 + * Ubicom32 implementation derived from (with many thanks):
780 + *   arch/m68knommu
781 + *   arch/blackfin
782 + *   arch/parisc
783 + */
784 +#ifndef _ASM_UBICOM32_IPCBUF_H
785 +#define _ASM_UBICOM32_IPCBUF_H
786 +
787 +/*
788 + * The user_ipc_perm structure for m68k architecture.
789 + * Note extra padding because this structure is passed back and forth
790 + * between kernel and user space.
791 + *
792 + * Pad space is left for:
793 + * - 32-bit mode_t and seq
794 + * - 2 miscellaneous 32-bit values
795 + */
796 +struct ipc64_perm
797 +{
798 +       __kernel_key_t          key;
799 +       __kernel_uid32_t        uid;
800 +       __kernel_gid32_t        gid;
801 +       __kernel_uid32_t        cuid;
802 +       __kernel_gid32_t        cgid;
803 +       __kernel_mode_t         mode;
804 +       unsigned short          __pad1;
805 +       unsigned short          seq;
806 +       unsigned short          __pad2;
807 +       unsigned long           __unused1;
808 +       unsigned long           __unused2;
809 +};
810 +
811 +#endif /* _ASM_UBICOM32_IPCBUF_H */
812 --- /dev/null
813 +++ b/arch/ubicom32/include/asm/irqflags.h
814 @@ -0,0 +1,94 @@
815 +/*
816 + * arch/ubicom32/include/asm/irqflags.h
817 + *   Raw implementation of local IRQ functions.
818 + *
819 + * (C) Copyright 2009, Ubicom, Inc.
820 + *
821 + * This file is part of the Ubicom32 Linux Kernel Port.
822 + *
823 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
824 + * it and/or modify it under the terms of the GNU General Public License
825 + * as published by the Free Software Foundation, either version 2 of the
826 + * License, or (at your option) any later version.
827 + *
828 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
829 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
830 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
831 + * the GNU General Public License for more details.
832 + *
833 + * You should have received a copy of the GNU General Public License
834 + * along with the Ubicom32 Linux Kernel Port.  If not,
835 + * see <http://www.gnu.org/licenses/>.
836 + *
837 + * Ubicom32 implementation derived from (with many thanks):
838 + *   arch/m68knommu
839 + *   arch/blackfin
840 + *   arch/parisc
841 + */
842 +#ifndef _ASM_UBICOM32_IRQFLAGS_H
843 +#define _ASM_UBICOM32_IRQFLAGS_H
844 +
845 +#include <linux/thread_info.h>
846 +#include <asm/ubicom32-common.h>
847 +#include <asm/smp.h>
848 +#include <asm/ldsr.h>
849 +
850 +#if defined(CONFIG_PREEMPT)
851 +#error Not supported by Ubicom32 irq handling, yet!
852 +#endif
853 +
854 +/*
855 + * raw_local_irq_enable()
856 + *     Enable interrupts for this thread.
857 + */
858 +static inline void raw_local_irq_enable(void)
859 +{
860 +       ldsr_local_irq_enable();
861 +}
862 +
863 +/*
864 + * raw_local_irq_disable()
865 + *     Disable interrupts for this thread.
866 + */
867 +static inline void raw_local_irq_disable(void)
868 +{
869 +       ldsr_local_irq_disable();
870 +}
871 +
872 +/*
873 + * raw_local_save_flags()
874 + *     Get the current IRQ state.
875 + */
876 +#define raw_local_save_flags(flags)            \
877 +do {                                           \
878 +       (flags) = ldsr_local_irq_is_disabled(); \
879 +} while (0)
880 +
881 +/*
882 + * raw_local_irq_save()
883 + *     Save the current interrupt state and disable interrupts.
884 + */
885 +#define raw_local_irq_save(flags)              \
886 +do {                                           \
887 +       (flags) = ldsr_local_irq_save();        \
888 +} while (0)
889 +
890 +/*
891 + * raw_local_irq_restore()
892 + *     Restore the IRQ state back to flags.
893 + */
894 +static inline void raw_local_irq_restore(unsigned long flags)
895 +{
896 +       ldsr_local_irq_restore(flags);
897 +}
898 +
899 +/*
900 + * raw_irqs_disabled_flags()
901 + *     Return true if the flags indicate that IRQ(s) are disabled.
902 + */
903 +static inline int raw_irqs_disabled_flags(unsigned long flags)
904 +{
905 +       return (flags);
906 +}
907 +
908 +#endif /* _ASM_UBICOM32_IRQFLAGS_H */
909 --- /dev/null
910 +++ b/arch/ubicom32/include/asm/Kbuild
911 @@ -0,0 +1 @@
912 +include include/asm-generic/Kbuild.asm
913 --- /dev/null
914 +++ b/arch/ubicom32/include/asm/kdebug.h
915 @@ -0,0 +1,33 @@
916 +/*
917 + * arch/ubicom32/include/asm/kdebug.h
918 + *   Generic kdebug.h for Ubicom32 architecture.
919 + *
920 + * (C) Copyright 2009, Ubicom, Inc.
921 + *
922 + * This file is part of the Ubicom32 Linux Kernel Port.
923 + *
924 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
925 + * it and/or modify it under the terms of the GNU General Public License
926 + * as published by the Free Software Foundation, either version 2 of the
927 + * License, or (at your option) any later version.
928 + *
929 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
930 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
931 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
932 + * the GNU General Public License for more details.
933 + *
934 + * You should have received a copy of the GNU General Public License
935 + * along with the Ubicom32 Linux Kernel Port.  If not, 
936 + * see <http://www.gnu.org/licenses/>.
937 + *
938 + * Ubicom32 implementation derived from (with many thanks):
939 + *   arch/m68knommu
940 + *   arch/blackfin
941 + *   arch/parisc
942 + */
943 +#ifndef _ASM_UBICOM32_KDEBUG_H
944 +#define _ASM_UBICOM32_KDEBUG_H
945 +
946 +#include <asm-generic/kdebug.h>
947 +
948 +#endif /* _ASM_UBICOM32_KDEBUG_H */
949 --- /dev/null
950 +++ b/arch/ubicom32/include/asm/linkage.h
951 @@ -0,0 +1,34 @@
952 +/*
953 + * arch/ubicom32/include/asm/linkage.h
954 + *   Definition of Ubicom32 architecture specific linkage types.
955 + *
956 + * (C) Copyright 2009, Ubicom, Inc.
957 + *
958 + * This file is part of the Ubicom32 Linux Kernel Port.
959 + *
960 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
961 + * it and/or modify it under the terms of the GNU General Public License
962 + * as published by the Free Software Foundation, either version 2 of the
963 + * License, or (at your option) any later version.
964 + *
965 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
966 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
967 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
968 + * the GNU General Public License for more details.
969 + *
970 + * You should have received a copy of the GNU General Public License
971 + * along with the Ubicom32 Linux Kernel Port.  If not, 
972 + * see <http://www.gnu.org/licenses/>.
973 + *
974 + * Ubicom32 implementation derived from (with many thanks):
975 + *   arch/m68knommu
976 + *   arch/blackfin
977 + *   arch/parisc
978 + */
979 +#ifndef _ASM_UBICOM32_LINKAGE_H
980 +#define _ASM_UBICOM32_LINKAGE_H
981 +
982 +#define __ocm_text __section(.ocm_text)
983 +#define __ocm_data __section(.ocm_data)
984 +
985 +#endif /* _ASM_UBICOM32_LINKAGE_H */
986 --- /dev/null
987 +++ b/arch/ubicom32/include/asm/local.h
988 @@ -0,0 +1,33 @@
989 +/*
990 + * arch/ubicom32/include/asm/local.h
991 + *   Generic local.h for Ubicom32 architecture.
992 + *
993 + * (C) Copyright 2009, Ubicom, Inc.
994 + *
995 + * This file is part of the Ubicom32 Linux Kernel Port.
996 + *
997 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
998 + * it and/or modify it under the terms of the GNU General Public License
999 + * as published by the Free Software Foundation, either version 2 of the
1000 + * License, or (at your option) any later version.
1001 + *
1002 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1003 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1004 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1005 + * the GNU General Public License for more details.
1006 + *
1007 + * You should have received a copy of the GNU General Public License
1008 + * along with the Ubicom32 Linux Kernel Port.  If not, 
1009 + * see <http://www.gnu.org/licenses/>.
1010 + *
1011 + * Ubicom32 implementation derived from (with many thanks):
1012 + *   arch/m68knommu
1013 + *   arch/blackfin
1014 + *   arch/parisc
1015 + */
1016 +#ifndef _ASM_UBICOM32_LOCAL_H
1017 +#define _ASM_UBICOM32_LOCAL_H
1018 +
1019 +#include <asm-generic/local.h>
1020 +
1021 +#endif /* _ASM_UBICOM32_LOCAL_H */
1022 --- /dev/null
1023 +++ b/arch/ubicom32/include/asm/mman.h
1024 @@ -0,0 +1,44 @@
1025 +/*
1026 + * arch/ubicom32/include/asm/mman.h
1027 + *   Memory mapping definitions for Ubicom32 architecture.
1028 + *
1029 + * (C) Copyright 2009, Ubicom, Inc.
1030 + *
1031 + * This file is part of the Ubicom32 Linux Kernel Port.
1032 + *
1033 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
1034 + * it and/or modify it under the terms of the GNU General Public License
1035 + * as published by the Free Software Foundation, either version 2 of the
1036 + * License, or (at your option) any later version.
1037 + *
1038 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1039 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1040 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1041 + * the GNU General Public License for more details.
1042 + *
1043 + * You should have received a copy of the GNU General Public License
1044 + * along with the Ubicom32 Linux Kernel Port.  If not, 
1045 + * see <http://www.gnu.org/licenses/>.
1046 + *
1047 + * Ubicom32 implementation derived from (with many thanks):
1048 + *   arch/m68knommu
1049 + *   arch/blackfin
1050 + *   arch/parisc
1051 + */
1052 +#ifndef _ASM_UBICOM32_MMAN_H
1053 +#define _ASM_UBICOM32_MMAN_H
1054 +
1055 +#include <asm-generic/mman.h>
1056 +
1057 +#define MAP_GROWSDOWN  0x0100          /* stack-like segment */
1058 +#define MAP_DENYWRITE  0x0800          /* ETXTBSY */
1059 +#define MAP_EXECUTABLE 0x1000          /* mark it as an executable */
1060 +#define MAP_LOCKED     0x2000          /* pages are locked */
1061 +#define MAP_NORESERVE  0x4000          /* don't check for reservations */
1062 +#define MAP_POPULATE   0x8000          /* populate (prefault) pagetables */
1063 +#define MAP_NONBLOCK   0x10000         /* do not block on IO */
1064 +
1065 +#define MCL_CURRENT    1               /* lock all current mappings */
1066 +#define MCL_FUTURE     2               /* lock all future mappings */
1067 +
1068 +#endif /* _ASM_UBICOM32_MMAN_H */
1069 --- /dev/null
1070 +++ b/arch/ubicom32/include/asm/msgbuf.h
1071 @@ -0,0 +1,58 @@
1072 +/*
1073 + * arch/ubicom32/include/asm/msgbuf.h
1074 + *   Definition of msqid64_ds struct for Ubicom32 architecture.
1075 + *
1076 + * (C) Copyright 2009, Ubicom, Inc.
1077 + *
1078 + * This file is part of the Ubicom32 Linux Kernel Port.
1079 + *
1080 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
1081 + * it and/or modify it under the terms of the GNU General Public License
1082 + * as published by the Free Software Foundation, either version 2 of the
1083 + * License, or (at your option) any later version.
1084 + *
1085 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1086 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1087 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1088 + * the GNU General Public License for more details.
1089 + *
1090 + * You should have received a copy of the GNU General Public License
1091 + * along with the Ubicom32 Linux Kernel Port.  If not, 
1092 + * see <http://www.gnu.org/licenses/>.
1093 + *
1094 + * Ubicom32 implementation derived from (with many thanks):
1095 + *   arch/m68knommu
1096 + *   arch/blackfin
1097 + *   arch/parisc
1098 + */
1099 +#ifndef _ASM_UBICOM32_MSGBUF_H
1100 +#define _ASM_UBICOM32_MSGBUF_H
1101 +
1102 +/*
1103 + * The msqid64_ds structure for ubicom32 architecture.
1104 + * Note extra padding because this structure is passed back and forth
1105 + * between kernel and user space.
1106 + *
1107 + * Pad space is left for:
1108 + * - 64-bit time_t to solve y2038 problem
1109 + * - 2 miscellaneous 32-bit values
1110 + */
1111 +
1112 +struct msqid64_ds {
1113 +       struct ipc64_perm msg_perm;
1114 +       __kernel_time_t msg_stime;      /* last msgsnd time */
1115 +       unsigned long   __unused1;
1116 +       __kernel_time_t msg_rtime;      /* last msgrcv time */
1117 +       unsigned long   __unused2;
1118 +       __kernel_time_t msg_ctime;      /* last change time */
1119 +       unsigned long   __unused3;
1120 +       unsigned long  msg_cbytes;      /* current number of bytes on queue */
1121 +       unsigned long  msg_qnum;        /* number of messages in queue */
1122 +       unsigned long  msg_qbytes;      /* max number of bytes on queue */
1123 +       __kernel_pid_t msg_lspid;       /* pid of last msgsnd */
1124 +       __kernel_pid_t msg_lrpid;       /* last receive pid */
1125 +       unsigned long  __unused4;
1126 +       unsigned long  __unused5;
1127 +};
1128 +
1129 +#endif /* _ASM_UBICOM32_MSGBUF_H */
1130 --- /dev/null
1131 +++ b/arch/ubicom32/include/asm/namei.h
1132 @@ -0,0 +1,38 @@
1133 +/*
1134 + * arch/ubicom32/include/asm/namei.h
1135 + *   Definition of __emul_prefix() for Ubicom32 architecture.
1136 + *
1137 + * (C) Copyright 2009, Ubicom, Inc.
1138 + *
1139 + * This file is part of the Ubicom32 Linux Kernel Port.
1140 + *
1141 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
1142 + * it and/or modify it under the terms of the GNU General Public License
1143 + * as published by the Free Software Foundation, either version 2 of the
1144 + * License, or (at your option) any later version.
1145 + *
1146 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1147 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1148 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1149 + * the GNU General Public License for more details.
1150 + *
1151 + * You should have received a copy of the GNU General Public License
1152 + * along with the Ubicom32 Linux Kernel Port.  If not, 
1153 + * see <http://www.gnu.org/licenses/>.
1154 + *
1155 + * Ubicom32 implementation derived from (with many thanks):
1156 + *   arch/m68knommu
1157 + *   arch/blackfin
1158 + *   arch/parisc
1159 + */
1160 +#ifndef _ASM_UBICOM32_NAMEI_H
1161 +#define _ASM_UBICOM32_NAMEI_H
1162 +
1163 +/* This dummy routine maybe changed to something useful
1164 + * for /usr/gnemul/ emulation stuff.
1165 + * Look at asm-sparc/namei.h for details.
1166 + */
1167 +
1168 +#define __emul_prefix() NULL
1169 +
1170 +#endif /* _ASM_UBICOM32_NAMEI_H */
1171 --- /dev/null
1172 +++ b/arch/ubicom32/include/asm/page.h
1173 @@ -0,0 +1,106 @@
1174 +/*
1175 + * arch/ubicom32/include/asm/page.h
1176 + *   Memory page related operations and definitions.
1177 + *
1178 + * (C) Copyright 2009, Ubicom, Inc.
1179 + *
1180 + * This file is part of the Ubicom32 Linux Kernel Port.
1181 + *
1182 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
1183 + * it and/or modify it under the terms of the GNU General Public License
1184 + * as published by the Free Software Foundation, either version 2 of the
1185 + * License, or (at your option) any later version.
1186 + *
1187 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1188 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1189 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1190 + * the GNU General Public License for more details.
1191 + *
1192 + * You should have received a copy of the GNU General Public License
1193 + * along with the Ubicom32 Linux Kernel Port.  If not,
1194 + * see <http://www.gnu.org/licenses/>.
1195 + *
1196 + * Ubicom32 implementation derived from (with many thanks):
1197 + *   arch/m68knommu
1198 + *   arch/blackfin
1199 + *   arch/parisc
1200 + */
1201 +#ifndef _ASM_UBICOM32_PAGE_H
1202 +#define _ASM_UBICOM32_PAGE_H
1203 +
1204 +/* PAGE_SHIFT determines the page size */
1205 +
1206 +#define PAGE_SHIFT     12
1207 +#define PAGE_SIZE      (1 << PAGE_SHIFT)
1208 +#define PAGE_MASK      (~(PAGE_SIZE-1))
1209 +
1210 +#include <asm/setup.h>
1211 +
1212 +#ifndef __ASSEMBLY__
1213 +
1214 +#define get_user_page(vaddr)           __get_free_page(GFP_KERNEL)
1215 +#define free_user_page(page, addr)     free_page(addr)
1216 +
1217 +#define clear_page(page)       memset((page), 0, PAGE_SIZE)
1218 +#define copy_page(to,from)     memcpy((to), (from), PAGE_SIZE)
1219 +
1220 +#define clear_user_page(page, vaddr, pg)       clear_page(page)
1221 +#define copy_user_page(to, from, vaddr, pg)    copy_page(to, from)
1222 +
1223 +#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
1224 +       alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr)
1225 +#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
1226 +
1227 +/*
1228 + * These are used to make use of C type-checking..
1229 + */
1230 +typedef struct { unsigned long pte; } pte_t;
1231 +typedef struct { unsigned long pmd[16]; } pmd_t;
1232 +typedef struct { unsigned long pgd; } pgd_t;
1233 +typedef struct { unsigned long pgprot; } pgprot_t;
1234 +typedef struct page *pgtable_t;
1235 +
1236 +#define pte_val(x)     ((x).pte)
1237 +#define pmd_val(x)     ((&x)->pmd[0])
1238 +#define pgd_val(x)     ((x).pgd)
1239 +#define pgprot_val(x)  ((x).pgprot)
1240 +
1241 +#define __pte(x)       ((pte_t) { (x) } )
1242 +#define __pmd(x)       ((pmd_t) { (x) } )
1243 +#define __pgd(x)       ((pgd_t) { (x) } )
1244 +#define __pgprot(x)    ((pgprot_t) { (x) } )
1245 +
1246 +extern unsigned long memory_start;
1247 +extern unsigned long memory_end;
1248 +
1249 +#endif /* !__ASSEMBLY__ */
1250 +
1251 +#include <asm/page_offset.h>
1252 +
1253 +#define PAGE_OFFSET            (PAGE_OFFSET_RAW)
1254 +
1255 +#ifndef __ASSEMBLY__
1256 +
1257 +#define __pa(vaddr)            virt_to_phys((void *)(vaddr))
1258 +#define __va(paddr)            phys_to_virt((unsigned long)(paddr))
1259 +
1260 +#define virt_to_pfn(kaddr)     (__pa(kaddr) >> PAGE_SHIFT)
1261 +#define pfn_to_virt(pfn)       __va((pfn) << PAGE_SHIFT)
1262 +
1263 +#define virt_to_page(addr)     (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))
1264 +#define page_to_virt(page)     ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
1265 +
1266 +#define pfn_to_page(pfn)       virt_to_page(pfn_to_virt(pfn))
1267 +#define page_to_pfn(page)      virt_to_pfn(page_to_virt(page))
1268 +#define pfn_valid(pfn)         ((pfn) < max_mapnr)
1269 +
1270 +#define        virt_addr_valid(kaddr)  (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
1271 +                               ((void *)(kaddr) < (void *)memory_end))
1272 +
1273 +#endif /* __ASSEMBLY__ */
1274 +
1275 +#ifdef __KERNEL__
1276 +#include <asm-generic/page.h>
1277 +#endif
1278 +
1279 +#endif /* _ASM_UBICOM32_PAGE_H */
1280 --- /dev/null
1281 +++ b/arch/ubicom32/include/asm/page_offset.h
1282 @@ -0,0 +1,35 @@
1283 +/*
1284 + * arch/ubicom32/include/asm/page_offset.h
1285 + *   Definition of PAGE_OFFSET_RAW for Ubicom32 architecture.
1286 + *
1287 + * (C) Copyright 2009, Ubicom, Inc.
1288 + *
1289 + * This file is part of the Ubicom32 Linux Kernel Port.
1290 + *
1291 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
1292 + * it and/or modify it under the terms of the GNU General Public License
1293 + * as published by the Free Software Foundation, either version 2 of the
1294 + * License, or (at your option) any later version.
1295 + *
1296 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1297 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1298 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1299 + * the GNU General Public License for more details.
1300 + *
1301 + * You should have received a copy of the GNU General Public License
1302 + * along with the Ubicom32 Linux Kernel Port.  If not, 
1303 + * see <http://www.gnu.org/licenses/>.
1304 + *
1305 + * Ubicom32 implementation derived from (with many thanks):
1306 + *   arch/m68knommu
1307 + *   arch/blackfin
1308 + *   arch/parisc
1309 + */
1310 +
1311 +#ifndef _ASM_UBICOM32_PAGE_OFFSET_H
1312 +#define _ASM_UBICOM32_PAGE_OFFSET_H
1313 +
1314 +/* This handles the memory map.. */
1315 +#define        PAGE_OFFSET_RAW         0x3ffc0000
1316 +
1317 +#endif /* _ASM_UBICOM32_PAGE_OFFSET_H */
1318 --- /dev/null
1319 +++ b/arch/ubicom32/include/asm/param.h
1320 @@ -0,0 +1,49 @@
1321 +/*
1322 + * arch/ubicom32/include/asm/param.h
1323 + *   Definition of miscellaneous constants, including HZ.
1324 + *
1325 + * (C) Copyright 2009, Ubicom, Inc.
1326 + *
1327 + * This file is part of the Ubicom32 Linux Kernel Port.
1328 + *
1329 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
1330 + * it and/or modify it under the terms of the GNU General Public License
1331 + * as published by the Free Software Foundation, either version 2 of the
1332 + * License, or (at your option) any later version.
1333 + *
1334 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1335 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1336 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1337 + * the GNU General Public License for more details.
1338 + *
1339 + * You should have received a copy of the GNU General Public License
1340 + * along with the Ubicom32 Linux Kernel Port.  If not, 
1341 + * see <http://www.gnu.org/licenses/>.
1342 + *
1343 + * Ubicom32 implementation derived from (with many thanks):
1344 + *   arch/m68knommu
1345 + *   arch/blackfin
1346 + *   arch/parisc
1347 + */
1348 +#ifndef _ASM_UBICOM32_PARAM_H
1349 +#define _ASM_UBICOM32_PARAM_H
1350 +
1351 +#ifdef __KERNEL__
1352 +#define HZ CONFIG_HZ
1353 +#define        USER_HZ         HZ
1354 +#define        CLOCKS_PER_SEC  (USER_HZ)
1355 +#endif
1356 +
1357 +#ifndef HZ
1358 +#define HZ     100
1359 +#endif
1360 +
1361 +#define EXEC_PAGESIZE  4096
1362 +
1363 +#ifndef NOGROUP
1364 +#define NOGROUP                (-1)
1365 +#endif
1366 +
1367 +#define MAXHOSTNAMELEN 64      /* max length of hostname */
1368 +
1369 +#endif /* _ASM_UBICOM32_PARAM_H */
1370 --- /dev/null
1371 +++ b/arch/ubicom32/include/asm/poll.h
1372 @@ -0,0 +1,36 @@
1373 +/*
1374 + * arch/ubicom32/include/asm/poll.h
1375 + *   Ubicom32 specific poll() related flags definitions.
1376 + *
1377 + * (C) Copyright 2009, Ubicom, Inc.
1378 + *
1379 + * This file is part of the Ubicom32 Linux Kernel Port.
1380 + *
1381 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
1382 + * it and/or modify it under the terms of the GNU General Public License
1383 + * as published by the Free Software Foundation, either version 2 of the
1384 + * License, or (at your option) any later version.
1385 + *
1386 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1387 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1388 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1389 + * the GNU General Public License for more details.
1390 + *
1391 + * You should have received a copy of the GNU General Public License
1392 + * along with the Ubicom32 Linux Kernel Port.  If not, 
1393 + * see <http://www.gnu.org/licenses/>.
1394 + *
1395 + * Ubicom32 implementation derived from (with many thanks):
1396 + *   arch/m68knommu
1397 + *   arch/blackfin
1398 + *   arch/parisc
1399 + */
1400 +#ifndef _ASM_UBICOM32_POLL_H
1401 +#define _ASM_UBICOM32_POLL_H
1402 +
1403 +#define POLLWRNORM     POLLOUT
1404 +#define POLLWRBAND     0x0100
1405 +
1406 +#include <asm-generic/poll.h>
1407 +
1408 +#endif /* _ASM_UBICOM32_POLL_H */
1409 --- /dev/null
1410 +++ b/arch/ubicom32/include/asm/posix_types.h
1411 @@ -0,0 +1,93 @@
1412 +/*
1413 + * arch/ubicom32/include/asm/posix_types.h
1414 + *   Ubicom32 architecture posix types.
1415 + *
1416 + * (C) Copyright 2009, Ubicom, Inc.
1417 + * Copyright (C) 2004   Microtronix Datacom Ltd
1418 + *
1419 + * This file is part of the Ubicom32 Linux Kernel Port.
1420 + *
1421 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
1422 + * it and/or modify it under the terms of the GNU General Public License
1423 + * as published by the Free Software Foundation, either version 2 of the
1424 + * License, or (at your option) any later version.
1425 + *
1426 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1427 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1428 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1429 + * the GNU General Public License for more details.
1430 + *
1431 + * You should have received a copy of the GNU General Public License
1432 + * along with the Ubicom32 Linux Kernel Port.  If not, 
1433 + * see <http://www.gnu.org/licenses/>.
1434 + *
1435 + * Ubicom32 implementation derived from (with many thanks):
1436 + *   arch/m68knommu
1437 + *   arch/blackfin
1438 + *   arch/parisc
1439 + */
1440 +#ifndef __ARCH_UBICOM32_POSIX_TYPES_H
1441 +#define __ARCH_UBICOM32_POSIX_TYPES_H
1442 +
1443 +/*
1444 + * This file is generally used by user-level software, so you need to
1445 + * be a little careful about namespace pollution etc.  Also, we cannot
1446 + * assume GCC is being used.
1447 + */
1448 +
1449 +typedef unsigned long  __kernel_ino_t;
1450 +typedef unsigned short __kernel_mode_t;
1451 +typedef unsigned short __kernel_nlink_t;
1452 +typedef long           __kernel_off_t;
1453 +typedef int            __kernel_pid_t;
1454 +typedef unsigned short __kernel_ipc_pid_t;
1455 +typedef unsigned short __kernel_uid_t;
1456 +typedef unsigned short __kernel_gid_t;
1457 +typedef unsigned int   __kernel_size_t;
1458 +typedef int            __kernel_ssize_t;
1459 +typedef int            __kernel_ptrdiff_t;
1460 +typedef long           __kernel_time_t;
1461 +typedef long           __kernel_suseconds_t;
1462 +typedef long           __kernel_clock_t;
1463 +typedef int            __kernel_timer_t;
1464 +typedef int            __kernel_clockid_t;
1465 +typedef int            __kernel_daddr_t;
1466 +typedef char *         __kernel_caddr_t;
1467 +typedef unsigned short __kernel_uid16_t;
1468 +typedef unsigned short __kernel_gid16_t;
1469 +typedef unsigned int   __kernel_uid32_t;
1470 +typedef unsigned int   __kernel_gid32_t;
1471 +
1472 +typedef unsigned short __kernel_old_uid_t;
1473 +typedef unsigned short __kernel_old_gid_t;
1474 +typedef unsigned short __kernel_old_dev_t;
1475 +
1476 +#ifdef __GNUC__
1477 +typedef long long      __kernel_loff_t;
1478 +#endif
1479 +
1480 +typedef struct {
1481 +#if defined(__KERNEL__) || defined(__USE_ALL)
1482 +       int     val[2];
1483 +#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
1484 +       int     __val[2];
1485 +#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
1486 +} __kernel_fsid_t;
1487 +
1488 +#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
1489 +
1490 +#undef __FD_SET
1491 +#define        __FD_SET(d, set)        ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
1492 +
1493 +#undef __FD_CLR
1494 +#define        __FD_CLR(d, set)        ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
1495 +
1496 +#undef __FD_ISSET
1497 +#define        __FD_ISSET(d, set)      ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
1498 +
1499 +#undef __FD_ZERO
1500 +#define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
1501 +
1502 +#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
1503 +
1504 +#endif
1505 --- /dev/null
1506 +++ b/arch/ubicom32/include/asm/ptrace.h
1507 @@ -0,0 +1,177 @@
1508 +/*
1509 + * arch/ubicom32/include/asm/ptrace.h
1510 + *   Ubicom32 architecture ptrace support.
1511 + *
1512 + * (C) Copyright 2009, Ubicom, Inc.
1513 + *
1514 + * This file is part of the Ubicom32 Linux Kernel Port.
1515 + *
1516 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
1517 + * it and/or modify it under the terms of the GNU General Public License
1518 + * as published by the Free Software Foundation, either version 2 of the
1519 + * License, or (at your option) any later version.
1520 + *
1521 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1522 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1523 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1524 + * the GNU General Public License for more details.
1525 + *
1526 + * You should have received a copy of the GNU General Public License
1527 + * along with the Ubicom32 Linux Kernel Port.  If not,
1528 + * see <http://www.gnu.org/licenses/>.
1529 + *
1530 + * Ubicom32 implementation derived from (with many thanks):
1531 + *   arch/m68knommu
1532 + *   arch/blackfin
1533 + *   arch/parisc
1534 + */
1535 +#ifndef _ASM_UBICOM32_PTRACE_H
1536 +#define _ASM_UBICOM32_PTRACE_H
1537 +
1538 +#ifndef __ASSEMBLY__
1539 +
1540 +/*
1541 + * We use hard coded constants because this is shared with user
1542 + * space and the values are NOT allowed to change.  Only fields
1543 + * that are intended to be exposed get values.
1544 + */
1545 +#define PT_D0           0
1546 +#define PT_D1           4
1547 +#define PT_D2           8
1548 +#define PT_D3           12
1549 +#define PT_D4           16
1550 +#define PT_D5           20
1551 +#define PT_D6           24
1552 +#define PT_D7           28
1553 +#define PT_D8           32
1554 +#define PT_D9           36
1555 +#define PT_D10          40
1556 +#define PT_D11          44
1557 +#define PT_D12          48
1558 +#define PT_D13          52
1559 +#define PT_D14          56
1560 +#define PT_D15          60
1561 +#define PT_A0           64
1562 +#define PT_A1           68
1563 +#define PT_A2           72
1564 +#define PT_A3           76
1565 +#define PT_A4           80
1566 +#define PT_A5           84
1567 +#define PT_A6           88
1568 +#define PT_A7           92
1569 +#define PT_SP           92
1570 +#define PT_ACC0HI       96
1571 +#define PT_ACC0LO       100
1572 +#define PT_MAC_RC16     104
1573 +#define PT_ACC1HI       108
1574 +#define PT_ACC1LO       112
1575 +#define PT_SOURCE3      116
1576 +#define PT_INST_CNT     120
1577 +#define PT_CSR          124
1578 +#define PT_DUMMY_UNUSED 128
1579 +#define PT_INT_MASK0    132
1580 +#define PT_INT_MASK1    136
1581 +#define PT_TRAP_CAUSE   140
1582 +#define PT_PC           144
1583 +#define PT_ORIGINAL_D0  148
1584 +#define PT_FRAME_TYPE   152
1585 +
1586 +/*
1587 + * The following 'registers' are not registers at all but are used
1588 + * locate the relocated sections.
1589 + */
1590 +#define PT_TEXT_ADDR           200
1591 +#define PT_TEXT_END_ADDR       204
1592 +#define PT_DATA_ADDR           208
1593 +#define PT_EXEC_FDPIC_LOADMAP  212
1594 +#define PT_INTERP_FDPIC_LOADMAP        216
1595 +
1596 +/*
1597 + * This struct defines the way the registers are stored on the
1598 + * stack during a system call.
1599 + */
1600 +enum thread_type {
1601 +       NORMAL_THREAD,
1602 +       KERNEL_THREAD,
1603 +};
1604 +
1605 +#define UBICOM32_FRAME_TYPE_SYSCALL    -1 /* System call frame */
1606 +#define UBICOM32_FRAME_TYPE_INVALID    0 /* Invalid frame, no longer in use */
1607 +#define UBICOM32_FRAME_TYPE_INTERRUPT  1 /* Interrupt frame */
1608 +#define UBICOM32_FRAME_TYPE_TRAP       2 /* Trap frame */
1609 +#define UBICOM32_FRAME_TYPE_SIGTRAMP   3 /* Signal trampoline frame. */
1610 +#define UBICOM32_FRAME_TYPE_NEW_THREAD 4 /* New Thread. */
1611 +
1612 +struct pt_regs {
1613 +       /*
1614 +        * Data Registers
1615 +        */
1616 +       unsigned long dn[16];
1617 +
1618 +       /*
1619 +        * Address Registers
1620 +        */
1621 +       unsigned long an[8];
1622 +
1623 +       /*
1624 +        * Per thread misc registers.
1625 +        */
1626 +       unsigned long acc0[2];
1627 +       unsigned long mac_rc16;
1628 +       unsigned long acc1[2];
1629 +       unsigned long source3;
1630 +       unsigned long inst_cnt;
1631 +       unsigned long csr;
1632 +       unsigned long dummy_unused;
1633 +       unsigned long int_mask0;
1634 +       unsigned long int_mask1;
1635 +       unsigned long trap_cause;
1636 +       unsigned long pc;
1637 +       unsigned long original_dn_0;
1638 +
1639 +       /*
1640 +        * Frame type. Syscall frames are -1. For other types look above.
1641 +        */
1642 +       unsigned long frame_type;
1643 +
1644 +       /*
1645 +        * These fields are not exposed to ptrace.
1646 +        */
1647 +       unsigned long previous_pc;
1648 +       long nesting_level;             /* When the kernel in in user space this
1649 +                                        * will be -1. */
1650 +       unsigned long thread_type;      /* This indicates if this is a kernel
1651 +                                        * thread. */
1652 +};
1653 +
1654 +/*
1655 + * This is the extended stack used by signal handlers and the context
1656 + * switcher: it's pushed after the normal "struct pt_regs".
1657 + */
1658 +struct switch_stack {
1659 +       unsigned long  dummy;
1660 +};
1661 +
1662 +#ifdef __KERNEL__
1663 +
1664 +/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
1665 +#define PTRACE_GETREGS         12
1666 +#define PTRACE_SETREGS         13
1667 +
1668 +#ifndef PS_S
1669 +#define PS_S  (0x2000)
1670 +#define PS_M  (0x1000)
1671 +#endif
1672 +
1673 +extern  int __user_mode(unsigned long sp);
1674 +
1675 +#define user_mode(regs) (__user_mode((regs->an[7])))
1676 +#define user_stack(regs) ((regs)->an[7])
1677 +#define instruction_pointer(regs) ((regs)->pc)
1678 +#define profile_pc(regs) instruction_pointer(regs)
1679 +extern void show_regs(struct pt_regs *);
1680 +#endif /* __KERNEL__ */
1681 +
1682 +#endif /* __ASSEMBLY__ */
1683 +
1684 +#endif /* _ASM_UBICOM32_PTRACE_H */
1685 --- /dev/null
1686 +++ b/arch/ubicom32/include/asm/resource.h
1687 @@ -0,0 +1,33 @@
1688 +/*
1689 + * arch/ubicom32/include/asm/resource.h
1690 + *   Generic definitions for Ubicom32 architecture.
1691 + *
1692 + * (C) Copyright 2009, Ubicom, Inc.
1693 + *
1694 + * This file is part of the Ubicom32 Linux Kernel Port.
1695 + *
1696 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
1697 + * it and/or modify it under the terms of the GNU General Public License
1698 + * as published by the Free Software Foundation, either version 2 of the
1699 + * License, or (at your option) any later version.
1700 + *
1701 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1702 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1703 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1704 + * the GNU General Public License for more details.
1705 + *
1706 + * You should have received a copy of the GNU General Public License
1707 + * along with the Ubicom32 Linux Kernel Port.  If not, 
1708 + * see <http://www.gnu.org/licenses/>.
1709 + *
1710 + * Ubicom32 implementation derived from (with many thanks):
1711 + *   arch/m68knommu
1712 + *   arch/blackfin
1713 + *   arch/parisc
1714 + */
1715 +#ifndef _ASM_UBICOM32_RESOURCE_H
1716 +#define _ASM_UBICOM32_RESOURCE_H
1717 +
1718 +#include <asm-generic/resource.h>
1719 +
1720 +#endif /* _ASM_UBICOM32_RESOURCE_H */
1721 --- /dev/null
1722 +++ b/arch/ubicom32/include/asm/sections.h
1723 @@ -0,0 +1,33 @@
1724 +/*
1725 + * arch/ubicom32/include/asm/sections.h
1726 + *   Generic sections.h definitions for Ubicom32 architecture.
1727 + *
1728 + * (C) Copyright 2009, Ubicom, Inc.
1729 + *
1730 + * This file is part of the Ubicom32 Linux Kernel Port.
1731 + *
1732 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
1733 + * it and/or modify it under the terms of the GNU General Public License
1734 + * as published by the Free Software Foundation, either version 2 of the
1735 + * License, or (at your option) any later version.
1736 + *
1737 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1738 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1739 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1740 + * the GNU General Public License for more details.
1741 + *
1742 + * You should have received a copy of the GNU General Public License
1743 + * along with the Ubicom32 Linux Kernel Port.  If not, 
1744 + * see <http://www.gnu.org/licenses/>.
1745 + *
1746 + * Ubicom32 implementation derived from (with many thanks):
1747 + *   arch/m68knommu
1748 + *   arch/blackfin
1749 + *   arch/parisc
1750 + */
1751 +#ifndef _ASM_UBICOM32_SECTIONS_H
1752 +#define _ASM_UBICOM32_SECTIONS_H
1753 +
1754 +#include <asm-generic/sections.h>
1755 +
1756 +#endif /* _ASM_UBICOM32_SECTIONS_H */
1757 --- /dev/null
1758 +++ b/arch/ubicom32/include/asm/segment.h
1759 @@ -0,0 +1,78 @@
1760 +/*
1761 + * arch/ubicom32/include/asm/segment.h
1762 + *   Memory segment definitions for Ubicom32 architecture.
1763 + *
1764 + * (C) Copyright 2009, Ubicom, Inc.
1765 + *
1766 + * This file is part of the Ubicom32 Linux Kernel Port.
1767 + *
1768 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
1769 + * it and/or modify it under the terms of the GNU General Public License
1770 + * as published by the Free Software Foundation, either version 2 of the
1771 + * License, or (at your option) any later version.
1772 + *
1773 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1774 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1775 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1776 + * the GNU General Public License for more details.
1777 + *
1778 + * You should have received a copy of the GNU General Public License
1779 + * along with the Ubicom32 Linux Kernel Port.  If not, 
1780 + * see <http://www.gnu.org/licenses/>.
1781 + *
1782 + * Ubicom32 implementation derived from (with many thanks):
1783 + *   arch/m68knommu
1784 + *   arch/blackfin
1785 + *   arch/parisc
1786 + */
1787 +#ifndef _ASM_UBICOM32_SEGMENT_H
1788 +#define _ASM_UBICOM32_SEGMENT_H
1789 +
1790 +/* define constants */
1791 +/* Address spaces (FC0-FC2) */
1792 +#define USER_DATA     (1)
1793 +#ifndef __USER_DS
1794 +#define __USER_DS     (USER_DATA)
1795 +#endif
1796 +#define USER_PROGRAM  (2)
1797 +#define SUPER_DATA    (5)
1798 +#ifndef __KERNEL_DS
1799 +#define __KERNEL_DS   (SUPER_DATA)
1800 +#endif
1801 +#define SUPER_PROGRAM (6)
1802 +#define CPU_SPACE     (7)
1803 +
1804 +#ifndef __ASSEMBLY__
1805 +
1806 +typedef struct {
1807 +       unsigned long seg;
1808 +} mm_segment_t;
1809 +
1810 +#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
1811 +#define USER_DS                MAKE_MM_SEG(__USER_DS)
1812 +#define KERNEL_DS      MAKE_MM_SEG(__KERNEL_DS)
1813 +
1814 +/*
1815 + * Get/set the SFC/DFC registers for MOVES instructions
1816 + */
1817 +
1818 +static inline mm_segment_t get_fs(void)
1819 +{
1820 +    return USER_DS;
1821 +}
1822 +
1823 +static inline mm_segment_t get_ds(void)
1824 +{
1825 +    /* return the supervisor data space code */
1826 +    return KERNEL_DS;
1827 +}
1828 +
1829 +static inline void set_fs(mm_segment_t val)
1830 +{
1831 +}
1832 +
1833 +#define segment_eq(a,b)        ((a).seg == (b).seg)
1834 +
1835 +#endif /* __ASSEMBLY__ */
1836 +
1837 +#endif /* _ASM_UBICOM32_SEGMENT_H */
1838 --- /dev/null
1839 +++ b/arch/ubicom32/include/asm/sembuf.h
1840 @@ -0,0 +1,52 @@
1841 +/*
1842 + * arch/ubicom32/include/asm/sembuf.h
1843 + *   The semid64_ds structure for Ubicom32 architecture.
1844 + *
1845 + * (C) Copyright 2009, Ubicom, Inc.
1846 + *
1847 + * This file is part of the Ubicom32 Linux Kernel Port.
1848 + *
1849 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
1850 + * it and/or modify it under the terms of the GNU General Public License
1851 + * as published by the Free Software Foundation, either version 2 of the
1852 + * License, or (at your option) any later version.
1853 + *
1854 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1855 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1856 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1857 + * the GNU General Public License for more details.
1858 + *
1859 + * You should have received a copy of the GNU General Public License
1860 + * along with the Ubicom32 Linux Kernel Port.  If not, 
1861 + * see <http://www.gnu.org/licenses/>.
1862 + *
1863 + * Ubicom32 implementation derived from (with many thanks):
1864 + *   arch/m68knommu
1865 + *   arch/blackfin
1866 + *   arch/parisc
1867 + */
1868 +#ifndef _ASM_UBICOM32_SEMBUF_H
1869 +#define _ASM_UBICOM32_SEMBUF_H
1870 +
1871 +/*
1872 + * The semid64_ds structure for ubicom32 architecture.
1873 + * Note extra padding because this structure is passed back and forth
1874 + * between kernel and user space.
1875 + *
1876 + * Pad space is left for:
1877 + * - 64-bit time_t to solve y2038 problem
1878 + * - 2 miscellaneous 32-bit values
1879 + */
1880 +
1881 +struct semid64_ds {
1882 +       struct ipc64_perm sem_perm;             /* permissions .. see ipc.h */
1883 +       __kernel_time_t sem_otime;              /* last semop time */
1884 +       unsigned long   __unused1;
1885 +       __kernel_time_t sem_ctime;              /* last change time */
1886 +       unsigned long   __unused2;
1887 +       unsigned long   sem_nsems;              /* no. of semaphores in array */
1888 +       unsigned long   __unused3;
1889 +       unsigned long   __unused4;
1890 +};
1891 +
1892 +#endif /* _ASM_UBICOM32_SEMBUF_H */
1893 --- /dev/null
1894 +++ b/arch/ubicom32/include/asm/setup.h
1895 @@ -0,0 +1,35 @@
1896 +/*
1897 + * arch/ubicom32/include/asm/setup.h
1898 + *   Kernel command line length definition.
1899 + *
1900 + * (C) Copyright 2009, Ubicom, Inc.
1901 + * Copyright (C) 2004, Microtronix Datacom Ltd., All rights reserved.
1902 + *
1903 + * This file is part of the Ubicom32 Linux Kernel Port.
1904 + *
1905 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
1906 + * it and/or modify it under the terms of the GNU General Public License
1907 + * as published by the Free Software Foundation, either version 2 of the
1908 + * License, or (at your option) any later version.
1909 + *
1910 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1911 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1912 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1913 + * the GNU General Public License for more details.
1914 + *
1915 + * You should have received a copy of the GNU General Public License
1916 + * along with the Ubicom32 Linux Kernel Port.  If not, 
1917 + * see <http://www.gnu.org/licenses/>.
1918 + *
1919 + * Ubicom32 implementation derived from (with many thanks):
1920 + *   arch/m68knommu
1921 + *   arch/blackfin
1922 + *   arch/parisc
1923 + */
1924 +
1925 +#ifndef _ASM_UBICOM32_SETUP_H
1926 +#define _ASM_UBICOM32_SETUP_H
1927 +
1928 +#define COMMAND_LINE_SIZE 512
1929 +
1930 +#endif /* _ASM_UBICOM32_SETUP_H */
1931 --- /dev/null
1932 +++ b/arch/ubicom32/include/asm/shmbuf.h
1933 @@ -0,0 +1,69 @@
1934 +/*
1935 + * arch/ubicom32/include/asm/shmbuf.h
1936 + *   The shmid64_ds structure for the Ubicom32 architecture.
1937 + *
1938 + * (C) Copyright 2009, Ubicom, Inc.
1939 + *
1940 + * This file is part of the Ubicom32 Linux Kernel Port.
1941 + *
1942 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
1943 + * it and/or modify it under the terms of the GNU General Public License
1944 + * as published by the Free Software Foundation, either version 2 of the
1945 + * License, or (at your option) any later version.
1946 + *
1947 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
1948 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
1949 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1950 + * the GNU General Public License for more details.
1951 + *
1952 + * You should have received a copy of the GNU General Public License
1953 + * along with the Ubicom32 Linux Kernel Port.  If not, 
1954 + * see <http://www.gnu.org/licenses/>.
1955 + *
1956 + * Ubicom32 implementation derived from (with many thanks):
1957 + *   arch/m68knommu
1958 + *   arch/blackfin
1959 + *   arch/parisc
1960 + */
1961 +#ifndef _ASM_UBICOM32_SHMBUF_H
1962 +#define _ASM_UBICOM32_SHMBUF_H
1963 +
1964 +/*
1965 + * The shmid64_ds structure for m68k architecture.
1966 + * Note extra padding because this structure is passed back and forth
1967 + * between kernel and user space.
1968 + *
1969 + * Pad space is left for:
1970 + * - 64-bit time_t to solve y2038 problem
1971 + * - 2 miscellaneous 32-bit values
1972 + */
1973 +
1974 +struct shmid64_ds {
1975 +       struct ipc64_perm       shm_perm;       /* operation perms */
1976 +       size_t                  shm_segsz;      /* size of segment (bytes) */
1977 +       __kernel_time_t         shm_atime;      /* last attach time */
1978 +       unsigned long           __unused1;
1979 +       __kernel_time_t         shm_dtime;      /* last detach time */
1980 +       unsigned long           __unused2;
1981 +       __kernel_time_t         shm_ctime;      /* last change time */
1982 +       unsigned long           __unused3;
1983 +       __kernel_pid_t          shm_cpid;       /* pid of creator */
1984 +       __kernel_pid_t          shm_lpid;       /* pid of last operator */
1985 +       unsigned long           shm_nattch;     /* no. of current attaches */
1986 +       unsigned long           __unused4;
1987 +       unsigned long           __unused5;
1988 +};
1989 +
1990 +struct shminfo64 {
1991 +       unsigned long   shmmax;
1992 +       unsigned long   shmmin;
1993 +       unsigned long   shmmni;
1994 +       unsigned long   shmseg;
1995 +       unsigned long   shmall;
1996 +       unsigned long   __unused1;
1997 +       unsigned long   __unused2;
1998 +       unsigned long   __unused3;
1999 +       unsigned long   __unused4;
2000 +};
2001 +
2002 +#endif /* _ASM_UBICOM32_SHMBUF_H */
2003 --- /dev/null
2004 +++ b/arch/ubicom32/include/asm/shmparam.h
2005 @@ -0,0 +1,35 @@
2006 +/*
2007 + * arch/ubicom32/include/asm/shmparam.h
2008 + *   Shared memory definitions for Ubicom32 architecture.
2009 + *
2010 + * (C) Copyright 2009, Ubicom, Inc.
2011 + * Copyright (C) 2004   Microtronix Datacom Ltd
2012 + *
2013 + * This file is part of the Ubicom32 Linux Kernel Port.
2014 + *
2015 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
2016 + * it and/or modify it under the terms of the GNU General Public License
2017 + * as published by the Free Software Foundation, either version 2 of the
2018 + * License, or (at your option) any later version.
2019 + *
2020 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
2021 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
2022 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
2023 + * the GNU General Public License for more details.
2024 + *
2025 + * You should have received a copy of the GNU General Public License
2026 + * along with the Ubicom32 Linux Kernel Port.  If not, 
2027 + * see <http://www.gnu.org/licenses/>.
2028 + *
2029 + * Ubicom32 implementation derived from (with many thanks):
2030 + *   arch/m68knommu
2031 + *   arch/blackfin
2032 + *   arch/parisc
2033 + *   Alpha, ix86, M68K, Sparc, ...et al
2034 + */
2035 +#ifndef _ASM_UBICOM32_SHMPARAM_H
2036 +#define _ASM_UBICOM32_SHMPARAM_H
2037 +
2038 +#define        SHMLBA          PAGE_SIZE       /* attach addr a multiple of this */
2039 +
2040 +#endif /* _ASM_UBICOM32_SHMPARAM_H */
2041 --- /dev/null
2042 +++ b/arch/ubicom32/include/asm/sigcontext.h
2043 @@ -0,0 +1,37 @@
2044 +/*
2045 + * arch/ubicom32/include/asm/sigcontext.h
2046 + *   Definition of sigcontext struct for Ubicom32 architecture.
2047 + *
2048 + * (C) Copyright 2009, Ubicom, Inc.
2049 + *
2050 + * This file is part of the Ubicom32 Linux Kernel Port.
2051 + *
2052 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
2053 + * it and/or modify it under the terms of the GNU General Public License
2054 + * as published by the Free Software Foundation, either version 2 of the
2055 + * License, or (at your option) any later version.
2056 + *
2057 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
2058 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
2059 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
2060 + * the GNU General Public License for more details.
2061 + *
2062 + * You should have received a copy of the GNU General Public License
2063 + * along with the Ubicom32 Linux Kernel Port.  If not, 
2064 + * see <http://www.gnu.org/licenses/>.
2065 + *
2066 + * Ubicom32 implementation derived from (with many thanks):
2067 + *   arch/m68knommu
2068 + *   arch/blackfin
2069 + *   arch/parisc
2070 + */
2071 +#ifndef _ASM_UBICOM32_SIGCONTEXT_H
2072 +#define _ASM_UBICOM32_SIGCONTEXT_H
2073 +
2074 +#include <asm/ptrace.h>
2075 +
2076 +struct sigcontext {
2077 +       struct pt_regs sc_regs;
2078 +};
2079 +
2080 +#endif /* _ASM_UBICOM32_SIGCONTEXT_H */
2081 --- /dev/null
2082 +++ b/arch/ubicom32/include/asm/siginfo.h
2083 @@ -0,0 +1,33 @@
2084 +/*
2085 + * arch/ubicom32/include/asm/siginfo.h
2086 + *   Generic siginfo.h definitions for Ubicom32 architecture.
2087 + *
2088 + * (C) Copyright 2009, Ubicom, Inc.
2089 + *
2090 + * This file is part of the Ubicom32 Linux Kernel Port.
2091 + *
2092 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
2093 + * it and/or modify it under the terms of the GNU General Public License
2094 + * as published by the Free Software Foundation, either version 2 of the
2095 + * License, or (at your option) any later version.
2096 + *
2097 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
2098 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
2099 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
2100 + * the GNU General Public License for more details.
2101 + *
2102 + * You should have received a copy of the GNU General Public License
2103 + * along with the Ubicom32 Linux Kernel Port.  If not, 
2104 + * see <http://www.gnu.org/licenses/>.
2105 + *
2106 + * Ubicom32 implementation derived from (with many thanks):
2107 + *   arch/m68knommu
2108 + *   arch/blackfin
2109 + *   arch/parisc
2110 + */
2111 +#ifndef _ASM_UBICOM32_SIGINFO_H
2112 +#define _ASM_UBICOM32_SIGINFO_H
2113 +
2114 +#include <asm-generic/siginfo.h>
2115 +
2116 +#endif /* _ASM_UBICOM32_SIGINFO_H */
2117 --- /dev/null
2118 +++ b/arch/ubicom32/include/asm/signal.h
2119 @@ -0,0 +1,180 @@
2120 +/*
2121 + * arch/ubicom32/include/asm/signal.h
2122 + *   Signal related definitions for Ubicom32 architecture.
2123 + *
2124 + * (C) Copyright 2009, Ubicom, Inc.
2125 + *
2126 + * This file is part of the Ubicom32 Linux Kernel Port.
2127 + *
2128 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
2129 + * it and/or modify it under the terms of the GNU General Public License
2130 + * as published by the Free Software Foundation, either version 2 of the
2131 + * License, or (at your option) any later version.
2132 + *
2133 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
2134 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
2135 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
2136 + * the GNU General Public License for more details.
2137 + *
2138 + * You should have received a copy of the GNU General Public License
2139 + * along with the Ubicom32 Linux Kernel Port.  If not, 
2140 + * see <http://www.gnu.org/licenses/>.
2141 + *
2142 + * Ubicom32 implementation derived from (with many thanks):
2143 + *   arch/m68knommu
2144 + *   arch/blackfin
2145 + *   arch/parisc
2146 + */
2147 +#ifndef _ASM_UBICOM32_SIGNAL_H
2148 +#define _ASM_UBICOM32_SIGNAL_H
2149 +
2150 +#include <linux/types.h>
2151 +
2152 +/* Avoid too many header ordering problems.  */
2153 +struct siginfo;
2154 +
2155 +#ifdef __KERNEL__
2156 +/* Most things should be clean enough to redefine this at will, if care
2157 +   is taken to make libc match.  */
2158 +
2159 +#define _NSIG          64
2160 +#define _NSIG_BPW      32
2161 +#define _NSIG_WORDS    (_NSIG / _NSIG_BPW)
2162 +
2163 +typedef unsigned long old_sigset_t;            /* at least 32 bits */
2164 +
2165 +typedef struct {
2166 +       unsigned long sig[_NSIG_WORDS];
2167 +} sigset_t;
2168 +
2169 +#endif /* __KERNEL__ */
2170 +
2171 +#define SIGHUP          1
2172 +#define SIGINT          2
2173 +#define SIGQUIT                 3
2174 +#define SIGILL          4
2175 +#define SIGTRAP                 5
2176 +#define SIGABRT                 6
2177 +#define SIGIOT          6
2178 +#define SIGBUS          7
2179 +#define SIGFPE          8
2180 +#define SIGKILL                 9
2181 +#define SIGUSR1                10
2182 +#define SIGSEGV                11
2183 +#define SIGUSR2                12
2184 +#define SIGPIPE                13
2185 +#define SIGALRM                14
2186 +#define SIGTERM                15
2187 +#define SIGSTKFLT      16
2188 +#define SIGCHLD                17
2189 +#define SIGCONT                18
2190 +#define SIGSTOP                19
2191 +#define SIGTSTP                20
2192 +#define SIGTTIN                21
2193 +#define SIGTTOU                22
2194 +#define SIGURG         23
2195 +#define SIGXCPU                24
2196 +#define SIGXFSZ                25
2197 +#define SIGVTALRM      26
2198 +#define SIGPROF                27
2199 +#define SIGWINCH       28
2200 +#define SIGIO          29
2201 +#define SIGPOLL                SIGIO
2202 +/*
2203 +#define SIGLOST                29
2204 +*/
2205 +#define SIGPWR         30
2206 +#define SIGSYS         31
2207 +#define        SIGUNUSED       31
2208 +
2209 +/* These should not be considered constants from userland.  */
2210 +#define SIGRTMIN       32
2211 +#define SIGRTMAX       _NSIG
2212 +
2213 +/*
2214 + * SA_FLAGS values:
2215 + *
2216 + * SA_ONSTACK indicates that a registered stack_t will be used.
2217 + * SA_RESTART flag to get restarting signals (which were the default long ago)
2218 + * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
2219 + * SA_RESETHAND clears the handler when the signal is delivered.
2220 + * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
2221 + * SA_NODEFER prevents the current signal from being masked in the handler.
2222 + *
2223 + * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
2224 + * Unix names RESETHAND and NODEFER respectively.
2225 + */
2226 +#define SA_NOCLDSTOP   0x00000001
2227 +#define SA_NOCLDWAIT   0x00000002
2228 +#define SA_SIGINFO     0x00000004
2229 +#define SA_ONSTACK     0x08000000
2230 +#define SA_RESTART     0x10000000
2231 +#define SA_NODEFER     0x40000000
2232 +#define SA_RESETHAND   0x80000000
2233 +
2234 +#define SA_NOMASK      SA_NODEFER
2235 +#define SA_ONESHOT     SA_RESETHAND
2236 +
2237 +/* 
2238 + * sigaltstack controls
2239 + */
2240 +#define SS_ONSTACK     1
2241 +#define SS_DISABLE     2
2242 +
2243 +#define MINSIGSTKSZ    2048
2244 +#define SIGSTKSZ       8192
2245 +
2246 +#include <asm-generic/signal.h>
2247 +
2248 +#ifdef __KERNEL__
2249 +struct old_sigaction {
2250 +       __sighandler_t sa_handler;
2251 +       old_sigset_t sa_mask;
2252 +       unsigned long sa_flags;
2253 +       void (*sa_restorer)(void);
2254 +};
2255 +
2256 +struct sigaction {
2257 +       __sighandler_t sa_handler;
2258 +       unsigned long sa_flags;
2259 +       void (*sa_restorer)(void);
2260 +       sigset_t sa_mask;               /* mask last for extensibility */
2261 +};
2262 +
2263 +struct k_sigaction {
2264 +       struct sigaction sa;
2265 +};
2266 +#else
2267 +/* Here we must cater to libcs that poke about in kernel headers.  */
2268 +
2269 +struct sigaction {
2270 +       union {
2271 +         __sighandler_t _sa_handler;
2272 +         void (*_sa_sigaction)(int, struct siginfo *, void *);
2273 +       } _u;
2274 +       sigset_t sa_mask;
2275 +       unsigned long sa_flags;
2276 +       void (*sa_restorer)(void);
2277 +};
2278 +
2279 +#define sa_handler     _u._sa_handler
2280 +#define sa_sigaction   _u._sa_sigaction
2281 +
2282 +#endif /* __KERNEL__ */
2283 +
2284 +typedef struct sigaltstack {
2285 +       void *ss_sp;
2286 +       int ss_flags;
2287 +       size_t ss_size;
2288 +} stack_t;
2289 +
2290 +#ifdef __KERNEL__
2291 +
2292 +#include <asm/sigcontext.h>
2293 +#undef __HAVE_ARCH_SIG_BITOPS
2294 +
2295 +#define ptrace_signal_deliver(regs, cookie) do { } while (0)
2296 +
2297 +#endif /* __KERNEL__ */
2298 +
2299 +#endif /* _ASM_UBICOM32_SIGNAL_H */
2300 --- /dev/null
2301 +++ b/arch/ubicom32/include/asm/socket.h
2302 @@ -0,0 +1,84 @@
2303 +/*
2304 + * arch/ubicom32/include/asm/socket.h
2305 + *   Socket options definitions for Ubicom32 architecture.
2306 + *
2307 + * (C) Copyright 2009, Ubicom, Inc.
2308 + *
2309 + * This file is part of the Ubicom32 Linux Kernel Port.
2310 + *
2311 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
2312 + * it and/or modify it under the terms of the GNU General Public License
2313 + * as published by the Free Software Foundation, either version 2 of the
2314 + * License, or (at your option) any later version.
2315 + *
2316 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
2317 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
2318 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
2319 + * the GNU General Public License for more details.
2320 + *
2321 + * You should have received a copy of the GNU General Public License
2322 + * along with the Ubicom32 Linux Kernel Port.  If not, 
2323 + * see <http://www.gnu.org/licenses/>.
2324 + *
2325 + * Ubicom32 implementation derived from (with many thanks):
2326 + *   arch/m68knommu
2327 + *   arch/blackfin
2328 + *   arch/parisc
2329 + */
2330 +#ifndef _ASM_UBICOM32_SOCKET_H
2331 +#define _ASM_UBICOM32_SOCKET_H
2332 +
2333 +#include <asm/sockios.h>
2334 +
2335 +/* For setsockopt(2) */
2336 +#define SOL_SOCKET     1
2337 +
2338 +#define SO_DEBUG       1
2339 +#define SO_REUSEADDR   2
2340 +#define SO_TYPE                3
2341 +#define SO_ERROR       4
2342 +#define SO_DONTROUTE   5
2343 +#define SO_BROADCAST   6
2344 +#define SO_SNDBUF      7
2345 +#define SO_RCVBUF      8
2346 +#define SO_SNDBUFFORCE 32
2347 +#define SO_RCVBUFFORCE 33
2348 +#define SO_KEEPALIVE   9
2349 +#define SO_OOBINLINE   10
2350 +#define SO_NO_CHECK    11
2351 +#define SO_PRIORITY    12
2352 +#define SO_LINGER      13
2353 +#define SO_BSDCOMPAT   14
2354 +/* To add :#define SO_REUSEPORT 15 */
2355 +#define SO_PASSCRED    16
2356 +#define SO_PEERCRED    17
2357 +#define SO_RCVLOWAT    18
2358 +#define SO_SNDLOWAT    19
2359 +#define SO_RCVTIMEO    20
2360 +#define SO_SNDTIMEO    21
2361 +
2362 +/* Security levels - as per NRL IPv6 - don't actually do anything */
2363 +#define SO_SECURITY_AUTHENTICATION             22
2364 +#define SO_SECURITY_ENCRYPTION_TRANSPORT       23
2365 +#define SO_SECURITY_ENCRYPTION_NETWORK         24
2366 +
2367 +#define SO_BINDTODEVICE        25
2368 +
2369 +/* Socket filtering */
2370 +#define SO_ATTACH_FILTER        26
2371 +#define SO_DETACH_FILTER        27
2372 +
2373 +#define SO_PEERNAME             28
2374 +#define SO_TIMESTAMP           29
2375 +#define SCM_TIMESTAMP          SO_TIMESTAMP
2376 +
2377 +#define SO_ACCEPTCONN          30
2378 +
2379 +#define SO_PEERSEC              31
2380 +#define SO_PASSSEC             34
2381 +#define SO_TIMESTAMPNS         35
2382 +#define SCM_TIMESTAMPNS                SO_TIMESTAMPNS
2383 +
2384 +#define SO_MARK                        36
2385 +
2386 +#endif /* _ASM_UBICOM32_SOCKET_H */
2387 --- /dev/null
2388 +++ b/arch/ubicom32/include/asm/sockios.h
2389 @@ -0,0 +1,40 @@
2390 +/*
2391 + * arch/ubicom32/include/asm/sockios.h
2392 + *   Socket-level ioctl definitions for Ubicom32 architecture.
2393 + *
2394 + * (C) Copyright 2009, Ubicom, Inc.
2395 + *
2396 + * This file is part of the Ubicom32 Linux Kernel Port.
2397 + *
2398 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
2399 + * it and/or modify it under the terms of the GNU General Public License
2400 + * as published by the Free Software Foundation, either version 2 of the
2401 + * License, or (at your option) any later version.
2402 + *
2403 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
2404 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
2405 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
2406 + * the GNU General Public License for more details.
2407 + *
2408 + * You should have received a copy of the GNU General Public License
2409 + * along with the Ubicom32 Linux Kernel Port.  If not, 
2410 + * see <http://www.gnu.org/licenses/>.
2411 + *
2412 + * Ubicom32 implementation derived from (with many thanks):
2413 + *   arch/m68knommu
2414 + *   arch/blackfin
2415 + *   arch/parisc
2416 + */
2417 +#ifndef _ASM_UBICOM32_SOCKIOS_H
2418 +#define _ASM_UBICOM32_SOCKIOS_H
2419 +
2420 +/* Socket-level I/O control calls. */
2421 +#define FIOSETOWN      0x8901
2422 +#define SIOCSPGRP      0x8902
2423 +#define FIOGETOWN      0x8903
2424 +#define SIOCGPGRP      0x8904
2425 +#define SIOCATMARK     0x8905
2426 +#define SIOCGSTAMP     0x8906          /* Get stamp (timeval) */
2427 +#define SIOCGSTAMPNS   0x8907          /* Get stamp (timespec) */
2428 +
2429 +#endif /* _ASM_UBICOM32_SOCKIOS_H */
2430 --- /dev/null
2431 +++ b/arch/ubicom32/include/asm/statfs.h
2432 @@ -0,0 +1,33 @@
2433 +/*
2434 + * arch/ubicom32/include/asm/statfs.h
2435 + *   Generic statfs.h definitions
2436 + *
2437 + * (C) Copyright 2009, Ubicom, Inc.
2438 + *
2439 + * This file is part of the Ubicom32 Linux Kernel Port.
2440 + *
2441 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
2442 + * it and/or modify it under the terms of the GNU General Public License
2443 + * as published by the Free Software Foundation, either version 2 of the
2444 + * License, or (at your option) any later version.
2445 + *
2446 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
2447 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
2448 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
2449 + * the GNU General Public License for more details.
2450 + *
2451 + * You should have received a copy of the GNU General Public License
2452 + * along with the Ubicom32 Linux Kernel Port.  If not, 
2453 + * see <http://www.gnu.org/licenses/>.
2454 + *
2455 + * Ubicom32 implementation derived from (with many thanks):
2456 + *   arch/m68knommu
2457 + *   arch/blackfin
2458 + *   arch/parisc
2459 + */
2460 +#ifndef _ASM_UBICOM32_STATFS_H
2461 +#define _ASM_UBICOM32_STATFS_H
2462 +
2463 +#include <asm-generic/statfs.h>
2464 +
2465 +#endif /* _ASM_UBICOM32_STATFS_H */
2466 --- /dev/null
2467 +++ b/arch/ubicom32/include/asm/stat.h
2468 @@ -0,0 +1,104 @@
2469 +/*
2470 + * arch/ubicom32/include/asm/stat.h
2471 + *   File status definitions for Ubicom32 architecture.
2472 + *
2473 + * (C) Copyright 2009, Ubicom, Inc.
2474 + *
2475 + * This file is part of the Ubicom32 Linux Kernel Port.
2476 + *
2477 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
2478 + * it and/or modify it under the terms of the GNU General Public License
2479 + * as published by the Free Software Foundation, either version 2 of the
2480 + * License, or (at your option) any later version.
2481 + *
2482 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
2483 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
2484 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
2485 + * the GNU General Public License for more details.
2486 + *
2487 + * You should have received a copy of the GNU General Public License
2488 + * along with the Ubicom32 Linux Kernel Port.  If not, 
2489 + * see <http://www.gnu.org/licenses/>.
2490 + *
2491 + * Ubicom32 implementation derived from (with many thanks):
2492 + *   arch/m68knommu
2493 + *   arch/blackfin
2494 + *   arch/parisc
2495 + */
2496 +#ifndef _ASM_UBICOM32_STAT_H
2497 +#define _ASM_UBICOM32_STAT_H
2498 +
2499 +struct __old_kernel_stat {
2500 +       unsigned short st_dev;
2501 +       unsigned short st_ino;
2502 +       unsigned short st_mode;
2503 +       unsigned short st_nlink;
2504 +       unsigned short st_uid;
2505 +       unsigned short st_gid;
2506 +       unsigned short st_rdev;
2507 +       unsigned long  st_size;
2508 +       unsigned long  st_atime;
2509 +       unsigned long  st_mtime;
2510 +       unsigned long  st_ctime;
2511 +};
2512 +
2513 +struct stat {
2514 +       unsigned short st_dev;
2515 +       unsigned short __pad1;
2516 +       unsigned long  st_ino;
2517 +       unsigned short st_mode;
2518 +       unsigned short st_nlink;
2519 +       unsigned short st_uid;
2520 +       unsigned short st_gid;
2521 +       unsigned short st_rdev;
2522 +       unsigned short __pad2;
2523 +       unsigned long  st_size;
2524 +       unsigned long  st_blksize;
2525 +       unsigned long  st_blocks;
2526 +       unsigned long  st_atime;
2527 +       unsigned long  __unused1;
2528 +       unsigned long  st_mtime;
2529 +       unsigned long  __unused2;
2530 +       unsigned long  st_ctime;
2531 +       unsigned long  __unused3;
2532 +       unsigned long  __unused4;
2533 +       unsigned long  __unused5;
2534 +};
2535 +
2536 +/* This matches struct stat64 in glibc2.1, hence the absolutely
2537 + * insane amounts of padding around dev_t's.
2538 + */
2539 +struct stat64 {
2540 +       unsigned long long      st_dev;
2541 +       unsigned char   __pad1[2];
2542 +
2543 +#define STAT64_HAS_BROKEN_ST_INO       1
2544 +       unsigned long   __st_ino;
2545 +
2546 +       unsigned int    st_mode;
2547 +       unsigned int    st_nlink;
2548 +
2549 +       unsigned long   st_uid;
2550 +       unsigned long   st_gid;
2551 +
2552 +       unsigned long long      st_rdev;
2553 +       unsigned char   __pad3[2];
2554 +
2555 +       long long       st_size;
2556 +       unsigned long   st_blksize;
2557 +
2558 +       unsigned long long      st_blocks;      /* Number 512-byte blocks allocated. */
2559 +
2560 +       unsigned long   st_atime;
2561 +       unsigned long   st_atime_nsec;
2562 +
2563 +       unsigned long   st_mtime;
2564 +       unsigned long   st_mtime_nsec;
2565 +
2566 +       unsigned long   st_ctime;
2567 +       unsigned long   st_ctime_nsec;
2568 +
2569 +       unsigned long long      st_ino;
2570 +};
2571 +
2572 +#endif /* _ASM_UBICOM32_STAT_H */
2573 --- /dev/null
2574 +++ b/arch/ubicom32/include/asm/swab.h
2575 @@ -0,0 +1,46 @@
2576 +/*
2577 + * arch/ubicom32/include/asm/swab.h
2578 + *   Byte order swapping utility routines.
2579 + *
2580 + * (C) Copyright 2009, Ubicom, Inc.
2581 + *
2582 + * This file is part of the Ubicom32 Linux Kernel Port.
2583 + *
2584 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
2585 + * it and/or modify it under the terms of the GNU General Public License
2586 + * as published by the Free Software Foundation, either version 2 of the
2587 + * License, or (at your option) any later version.
2588 + *
2589 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
2590 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
2591 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
2592 + * the GNU General Public License for more details.
2593 + *
2594 + * You should have received a copy of the GNU General Public License
2595 + * along with the Ubicom32 Linux Kernel Port.  If not, 
2596 + * see <http://www.gnu.org/licenses/>.
2597 + *
2598 + * Ubicom32 implementation derived from (with many thanks):
2599 + *   arch/m68knommu
2600 + *   arch/blackfin
2601 + *   arch/parisc
2602 + */
2603 +#ifndef _ASM_UBICOM32_SWAB_H
2604 +#define _ASM_UBICOM32_SWAB_H
2605 +
2606 +#include <linux/types.h>
2607 +
2608 +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
2609 +#  define __BYTEORDER_HAS_U64__
2610 +#  define __SWAB_64_THRU_32__
2611 +#endif
2612 +
2613 +#if defined(IP7000) || defined(IP7000_REV2)
2614 +
2615 +#define __arch__swab16 __builtin_ubicom32_swapb_2
2616 +#define __arch__swab32 __builtin_ubicom32_swapb_4
2617 +
2618 +#endif /* IP7000 */
2619 +
2620 +#endif /* _ASM_UBICOM32_SWAB_H */
2621 +
2622 --- /dev/null
2623 +++ b/arch/ubicom32/include/asm/termbits.h
2624 @@ -0,0 +1,227 @@
2625 +/*
2626 + * arch/ubicom32/include/asm/termbits.h
2627 + *   Terminal/serial port definitions for Ubicom32 architecture.
2628 + *
2629 + * (C) Copyright 2009, Ubicom, Inc.
2630 + *
2631 + * This file is part of the Ubicom32 Linux Kernel Port.
2632 + *
2633 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
2634 + * it and/or modify it under the terms of the GNU General Public License
2635 + * as published by the Free Software Foundation, either version 2 of the
2636 + * License, or (at your option) any later version.
2637 + *
2638 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
2639 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
2640 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
2641 + * the GNU General Public License for more details.
2642 + *
2643 + * You should have received a copy of the GNU General Public License
2644 + * along with the Ubicom32 Linux Kernel Port.  If not, 
2645 + * see <http://www.gnu.org/licenses/>.
2646 + *
2647 + * Ubicom32 implementation derived from (with many thanks):
2648 + *   arch/m68knommu
2649 + *   arch/blackfin
2650 + *   arch/parisc
2651 + */
2652 +#ifndef _ASM_UBICOM32_TERMBITS_H
2653 +#define _ASM_UBICOM32_TERMBITS_H
2654 +
2655 +#include <linux/posix_types.h>
2656 +
2657 +typedef unsigned char  cc_t;
2658 +typedef unsigned int   speed_t;
2659 +typedef unsigned int   tcflag_t;
2660 +
2661 +#define NCCS 19
2662 +struct termios {
2663 +       tcflag_t c_iflag;               /* input mode flags */
2664 +       tcflag_t c_oflag;               /* output mode flags */
2665 +       tcflag_t c_cflag;               /* control mode flags */
2666 +       tcflag_t c_lflag;               /* local mode flags */
2667 +       cc_t c_line;                    /* line discipline */
2668 +       cc_t c_cc[NCCS];                /* control characters */
2669 +};
2670 +
2671 +struct termios2 {
2672 +       tcflag_t c_iflag;               /* input mode flags */
2673 +       tcflag_t c_oflag;               /* output mode flags */
2674 +       tcflag_t c_cflag;               /* control mode flags */
2675 +       tcflag_t c_lflag;               /* local mode flags */
2676 +       cc_t c_line;                    /* line discipline */
2677 +       cc_t c_cc[NCCS];                /* control characters */
2678 +       speed_t c_ispeed;               /* input speed */
2679 +       speed_t c_ospeed;               /* output speed */
2680 +};
2681 +
2682 +struct ktermios {
2683 +       tcflag_t c_iflag;               /* input mode flags */
2684 +       tcflag_t c_oflag;               /* output mode flags */
2685 +       tcflag_t c_cflag;               /* control mode flags */
2686 +       tcflag_t c_lflag;               /* local mode flags */
2687 +       cc_t c_line;                    /* line discipline */
2688 +       cc_t c_cc[NCCS];                /* control characters */
2689 +       speed_t c_ispeed;               /* input speed */
2690 +       speed_t c_ospeed;               /* output speed */
2691 +};
2692 +
2693 +/* c_cc characters */
2694 +#define VINTR 0
2695 +#define VQUIT 1
2696 +#define VERASE 2
2697 +#define VKILL 3
2698 +#define VEOF 4
2699 +#define VTIME 5
2700 +#define VMIN 6
2701 +#define VSWTC 7
2702 +#define VSTART 8
2703 +#define VSTOP 9
2704 +#define VSUSP 10
2705 +#define VEOL 11
2706 +#define VREPRINT 12
2707 +#define VDISCARD 13
2708 +#define VWERASE 14
2709 +#define VLNEXT 15
2710 +#define VEOL2 16
2711 +
2712 +
2713 +/* c_iflag bits */
2714 +#define IGNBRK 0000001
2715 +#define BRKINT 0000002
2716 +#define IGNPAR 0000004
2717 +#define PARMRK 0000010
2718 +#define INPCK  0000020
2719 +#define ISTRIP 0000040
2720 +#define INLCR  0000100
2721 +#define IGNCR  0000200
2722 +#define ICRNL  0000400
2723 +#define IUCLC  0001000
2724 +#define IXON   0002000
2725 +#define IXANY  0004000
2726 +#define IXOFF  0010000
2727 +#define IMAXBEL        0020000
2728 +#define IUTF8  0040000
2729 +
2730 +/* c_oflag bits */
2731 +#define OPOST  0000001
2732 +#define OLCUC  0000002
2733 +#define ONLCR  0000004
2734 +#define OCRNL  0000010
2735 +#define ONOCR  0000020
2736 +#define ONLRET 0000040
2737 +#define OFILL  0000100
2738 +#define OFDEL  0000200
2739 +#define NLDLY  0000400
2740 +#define   NL0  0000000
2741 +#define   NL1  0000400
2742 +#define CRDLY  0003000
2743 +#define   CR0  0000000
2744 +#define   CR1  0001000
2745 +#define   CR2  0002000
2746 +#define   CR3  0003000
2747 +#define TABDLY 0014000
2748 +#define   TAB0 0000000
2749 +#define   TAB1 0004000
2750 +#define   TAB2 0010000
2751 +#define   TAB3 0014000
2752 +#define   XTABS        0014000
2753 +#define BSDLY  0020000
2754 +#define   BS0  0000000
2755 +#define   BS1  0020000
2756 +#define VTDLY  0040000
2757 +#define   VT0  0000000
2758 +#define   VT1  0040000
2759 +#define FFDLY  0100000
2760 +#define   FF0  0000000
2761 +#define   FF1  0100000
2762 +
2763 +/* c_cflag bit meaning */
2764 +#define CBAUD  0010017
2765 +#define  B0    0000000         /* hang up */
2766 +#define  B50   0000001
2767 +#define  B75   0000002
2768 +#define  B110  0000003
2769 +#define  B134  0000004
2770 +#define  B150  0000005
2771 +#define  B200  0000006
2772 +#define  B300  0000007
2773 +#define  B600  0000010
2774 +#define  B1200 0000011
2775 +#define  B1800 0000012
2776 +#define  B2400 0000013
2777 +#define  B4800 0000014
2778 +#define  B9600 0000015
2779 +#define  B19200        0000016
2780 +#define  B38400        0000017
2781 +#define EXTA B19200
2782 +#define EXTB B38400
2783 +#define CSIZE  0000060
2784 +#define   CS5  0000000
2785 +#define   CS6  0000020
2786 +#define   CS7  0000040
2787 +#define   CS8  0000060
2788 +#define CSTOPB 0000100
2789 +#define CREAD  0000200
2790 +#define PARENB 0000400
2791 +#define PARODD 0001000
2792 +#define HUPCL  0002000
2793 +#define CLOCAL 0004000
2794 +#define CBAUDEX 0010000
2795 +#define    BOTHER 0010000
2796 +#define    B57600 0010001
2797 +#define   B115200 0010002
2798 +#define   B230400 0010003
2799 +#define   B460800 0010004
2800 +#define   B500000 0010005
2801 +#define   B576000 0010006
2802 +#define   B921600 0010007
2803 +#define  B1000000 0010010
2804 +#define  B1152000 0010011
2805 +#define  B1500000 0010012
2806 +#define  B2000000 0010013
2807 +#define  B2500000 0010014
2808 +#define  B3000000 0010015
2809 +#define  B3500000 0010016
2810 +#define  B4000000 0010017
2811 +#define CIBAUD   002003600000          /* input baud rate */
2812 +#define CMSPAR   010000000000          /* mark or space (stick) parity */
2813 +#define CRTSCTS          020000000000          /* flow control */
2814 +
2815 +#define IBSHIFT        16                      /* Shift from CBAUD to CIBAUD */
2816 +
2817 +/* c_lflag bits */
2818 +#define ISIG   0000001
2819 +#define ICANON 0000002
2820 +#define XCASE  0000004
2821 +#define ECHO   0000010
2822 +#define ECHOE  0000020
2823 +#define ECHOK  0000040
2824 +#define ECHONL 0000100
2825 +#define NOFLSH 0000200
2826 +#define TOSTOP 0000400
2827 +#define ECHOCTL        0001000
2828 +#define ECHOPRT        0002000
2829 +#define ECHOKE 0004000
2830 +#define FLUSHO 0010000
2831 +#define PENDIN 0040000
2832 +#define IEXTEN 0100000
2833 +
2834 +
2835 +/* tcflow() and TCXONC use these */
2836 +#define        TCOOFF          0
2837 +#define        TCOON           1
2838 +#define        TCIOFF          2
2839 +#define        TCION           3
2840 +
2841 +/* tcflush() and TCFLSH use these */
2842 +#define        TCIFLUSH        0
2843 +#define        TCOFLUSH        1
2844 +#define        TCIOFLUSH       2
2845 +
2846 +/* tcsetattr uses these */
2847 +#define        TCSANOW         0
2848 +#define        TCSADRAIN       1
2849 +#define        TCSAFLUSH       2
2850 +
2851 +#endif /* _ASM_UBICOM32_TERMBITS_H */
2852 --- /dev/null
2853 +++ b/arch/ubicom32/include/asm/termios.h
2854 @@ -0,0 +1,119 @@
2855 +/*
2856 + * arch/ubicom32/include/asm/termios.h
2857 + *   Ubicom32 termio definitions.
2858 + *
2859 + * (C) Copyright 2009, Ubicom, Inc.
2860 + *
2861 + * This file is part of the Ubicom32 Linux Kernel Port.
2862 + *
2863 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
2864 + * it and/or modify it under the terms of the GNU General Public License
2865 + * as published by the Free Software Foundation, either version 2 of the
2866 + * License, or (at your option) any later version.
2867 + *
2868 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
2869 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
2870 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
2871 + * the GNU General Public License for more details.
2872 + *
2873 + * You should have received a copy of the GNU General Public License
2874 + * along with the Ubicom32 Linux Kernel Port.  If not, 
2875 + * see <http://www.gnu.org/licenses/>.
2876 + *
2877 + * Ubicom32 implementation derived from (with many thanks):
2878 + *   arch/m68knommu
2879 + *   arch/blackfin
2880 + *   arch/parisc
2881 + */
2882 +#ifndef _ASM_UBICOM32_TERMIOS_H
2883 +#define _ASM_UBICOM32_TERMIOS_H
2884 +
2885 +#include <asm/termbits.h>
2886 +#include <asm/ioctls.h>
2887 +
2888 +struct winsize {
2889 +       unsigned short ws_row;
2890 +       unsigned short ws_col;
2891 +       unsigned short ws_xpixel;
2892 +       unsigned short ws_ypixel;
2893 +};
2894 +
2895 +#define NCC 8
2896 +struct termio {
2897 +       unsigned short c_iflag;         /* input mode flags */
2898 +       unsigned short c_oflag;         /* output mode flags */
2899 +       unsigned short c_cflag;         /* control mode flags */
2900 +       unsigned short c_lflag;         /* local mode flags */
2901 +       unsigned char c_line;           /* line discipline */
2902 +       unsigned char c_cc[NCC];        /* control characters */
2903 +};
2904 +
2905 +#ifdef __KERNEL__
2906 +/*     intr=^C         quit=^|         erase=del       kill=^U
2907 +       eof=^D          vtime=\0        vmin=\1         sxtc=\0
2908 +       start=^Q        stop=^S         susp=^Z         eol=\0
2909 +       reprint=^R      discard=^U      werase=^W       lnext=^V
2910 +       eol2=\0
2911 +*/
2912 +#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
2913 +#endif
2914 +
2915 +/* modem lines */
2916 +#define TIOCM_LE       0x001
2917 +#define TIOCM_DTR      0x002
2918 +#define TIOCM_RTS      0x004
2919 +#define TIOCM_ST       0x008
2920 +#define TIOCM_SR       0x010
2921 +#define TIOCM_CTS      0x020
2922 +#define TIOCM_CAR      0x040
2923 +#define TIOCM_RNG      0x080
2924 +#define TIOCM_DSR      0x100
2925 +#define TIOCM_CD       TIOCM_CAR
2926 +#define TIOCM_RI       TIOCM_RNG
2927 +#define TIOCM_OUT1     0x2000
2928 +#define TIOCM_OUT2     0x4000
2929 +#define TIOCM_LOOP     0x8000
2930 +
2931 +/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
2932 +
2933 +#ifdef __KERNEL__
2934 +
2935 +/*
2936 + * Translate a "termio" structure into a "termios". Ugh.
2937 + */
2938 +#define user_termio_to_kernel_termios(termios, termio) \
2939 +({ \
2940 +       unsigned short tmp; \
2941 +       get_user(tmp, &(termio)->c_iflag); \
2942 +       (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \
2943 +       get_user(tmp, &(termio)->c_oflag); \
2944 +       (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \
2945 +       get_user(tmp, &(termio)->c_cflag); \
2946 +       (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \
2947 +       get_user(tmp, &(termio)->c_lflag); \
2948 +       (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \
2949 +       get_user((termios)->c_line, &(termio)->c_line); \
2950 +       copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
2951 +})
2952 +
2953 +/*
2954 + * Translate a "termios" structure into a "termio". Ugh.
2955 + */
2956 +#define kernel_termios_to_user_termio(termio, termios) \
2957 +({ \
2958 +       put_user((termios)->c_iflag, &(termio)->c_iflag); \
2959 +       put_user((termios)->c_oflag, &(termio)->c_oflag); \
2960 +       put_user((termios)->c_cflag, &(termio)->c_cflag); \
2961 +       put_user((termios)->c_lflag, &(termio)->c_lflag); \
2962 +       put_user((termios)->c_line,  &(termio)->c_line); \
2963 +       copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
2964 +})
2965 +
2966 +#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
2967 +#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
2968 +#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
2969 +#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
2970 +
2971 +#endif /* __KERNEL__ */
2972 +
2973 +#endif /* _ASM_UBICOM32_TERMIOS_H */
2974 --- /dev/null
2975 +++ b/arch/ubicom32/include/asm/thread_info.h
2976 @@ -0,0 +1,134 @@
2977 +/*
2978 + * arch/ubicom32/include/asm/thread_info.h
2979 + *   Ubicom32 architecture low-level thread information.
2980 + *
2981 + * (C) Copyright 2009, Ubicom, Inc.
2982 + * Adapted from the i386 and PPC versions by Greg Ungerer (gerg@snapgear.com)
2983 + * Copyright (C) 2002  David Howells (dhowells@redhat.com)
2984 + * - Incorporating suggestions made by Linus Torvalds and Dave Miller
2985 + *
2986 + * This file is part of the Ubicom32 Linux Kernel Port.
2987 + *
2988 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
2989 + * it and/or modify it under the terms of the GNU General Public License
2990 + * as published by the Free Software Foundation, either version 2 of the
2991 + * License, or (at your option) any later version.
2992 + *
2993 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
2994 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
2995 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
2996 + * the GNU General Public License for more details.
2997 + *
2998 + * You should have received a copy of the GNU General Public License
2999 + * along with the Ubicom32 Linux Kernel Port.  If not, 
3000 + * see <http://www.gnu.org/licenses/>.
3001 + *
3002 + * Ubicom32 implementation derived from (with many thanks):
3003 + *   arch/m68knommu
3004 + *   arch/blackfin
3005 + *   arch/parisc
3006 + */
3007 +
3008 +#ifndef _ASM_UBICOM32_THREAD_INFO_H
3009 +#define _ASM_UBICOM32_THREAD_INFO_H
3010 +
3011 +#include <asm/page.h>
3012 +
3013 +/*
3014 + * Size of kernel stack for each process. This must be a power of 2...
3015 + */
3016 +#ifdef CONFIG_4KSTACKS
3017 +#define THREAD_SIZE_ORDER (0)
3018 +#else
3019 +#define THREAD_SIZE_ORDER (1)
3020 +#endif
3021 +
3022 +/*
3023 + * for asm files, THREAD_SIZE is now generated by asm-offsets.c
3024 + */
3025 +#define THREAD_SIZE (PAGE_SIZE<<THREAD_SIZE_ORDER)
3026 +
3027 +#ifdef __KERNEL__
3028 +
3029 +#ifndef __ASSEMBLY__
3030 +
3031 +/*
3032 + * low level task data.
3033 + */
3034 +struct thread_info {
3035 +       struct task_struct *task;               /* main task structure */
3036 +       struct exec_domain *exec_domain;        /* execution domain */
3037 +       unsigned long      flags;               /* low level flags */
3038 +       int                cpu;                 /* cpu we're on */
3039 +       int                preempt_count;       /* 0 => preemptable, <0 => BUG */
3040 +       int                interrupt_nesting;   /* Interrupt nesting level. */
3041 +       struct restart_block restart_block;
3042 +};
3043 +
3044 +/*
3045 + * macros/functions for gaining access to the thread information structure
3046 + */
3047 +#define INIT_THREAD_INFO(tsk)                  \
3048 +{                                              \
3049 +       .task           = &tsk,                 \
3050 +       .exec_domain    = &default_exec_domain, \
3051 +       .flags          = 0,                    \
3052 +       .cpu            = 0,                    \
3053 +       .interrupt_nesting      = 0,            \
3054 +       .restart_block  = {                     \
3055 +               .fn = do_no_restart_syscall,    \
3056 +       },                                      \
3057 +}
3058 +
3059 +#define init_thread_info       (init_thread_union.thread_info)
3060 +#define init_stack             (init_thread_union.stack)
3061 +
3062 +
3063 +/* how to get the thread information struct from C */
3064 +static inline struct thread_info *current_thread_info(void)
3065 +{
3066 +       struct thread_info *ti;
3067 +
3068 +       asm (
3069 +               "and.4  %0, sp, %1\n\t"
3070 +               : "=&r" (ti)
3071 +               : "d" (~(THREAD_SIZE-1))
3072 +               : "cc"
3073 +       );
3074 +
3075 +       return ti;
3076 +}
3077 +
3078 +#define STACK_WARN (THREAD_SIZE / 8)
3079 +
3080 +#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR 1
3081 +
3082 +/* thread information allocation */
3083 +#define alloc_thread_info(tsk) ((struct thread_info *) \
3084 +                               __get_free_pages(GFP_KERNEL, THREAD_SIZE_ORDER))
3085 +#define free_thread_info(ti)   free_pages((unsigned long) (ti), THREAD_SIZE_ORDER)
3086 +#endif /* __ASSEMBLY__ */
3087 +
3088 +#define        PREEMPT_ACTIVE  0x4000000
3089 +
3090 +/*
3091 + * thread information flag bit numbers
3092 + */
3093 +#define TIF_SYSCALL_TRACE      0       /* syscall trace active */
3094 +#define TIF_SIGPENDING         1       /* signal pending */
3095 +#define TIF_NEED_RESCHED       2       /* rescheduling necessary */
3096 +#define TIF_POLLING_NRFLAG     3       /* true if poll_idle() is polling
3097 +                                          TIF_NEED_RESCHED */
3098 +#define TIF_MEMDIE             4
3099 +
3100 +/* as above, but as bit values */
3101 +#define _TIF_SYSCALL_TRACE     (1<<TIF_SYSCALL_TRACE)
3102 +#define _TIF_SIGPENDING                (1<<TIF_SIGPENDING)
3103 +#define _TIF_NEED_RESCHED      (1<<TIF_NEED_RESCHED)
3104 +#define _TIF_POLLING_NRFLAG    (1<<TIF_POLLING_NRFLAG)
3105 +
3106 +#define _TIF_WORK_MASK         0x0000FFFE      /* work to do on interrupt/exception return */
3107 +
3108 +#endif /* __KERNEL__ */
3109 +
3110 +#endif /* _ASM_UBICOM32_THREAD_INFO_H */
3111 --- /dev/null
3112 +++ b/arch/ubicom32/include/asm/types.h
3113 @@ -0,0 +1,75 @@
3114 +/*
3115 + * arch/ubicom32/include/asm/types.h
3116 + *   Date type definitions for Ubicom32 architecture.
3117 + *
3118 + * (C) Copyright 2009, Ubicom, Inc.
3119 + *
3120 + * This file is part of the Ubicom32 Linux Kernel Port.
3121 + *
3122 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
3123 + * it and/or modify it under the terms of the GNU General Public License
3124 + * as published by the Free Software Foundation, either version 2 of the
3125 + * License, or (at your option) any later version.
3126 + *
3127 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
3128 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
3129 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
3130 + * the GNU General Public License for more details.
3131 + *
3132 + * You should have received a copy of the GNU General Public License
3133 + * along with the Ubicom32 Linux Kernel Port.  If not, 
3134 + * see <http://www.gnu.org/licenses/>.
3135 + *
3136 + * Ubicom32 implementation derived from (with many thanks):
3137 + *   arch/m68knommu
3138 + *   arch/blackfin
3139 + *   arch/parisc
3140 + */
3141 +#ifndef _ASM_UBICOM32_TYPES_H
3142 +#define _ASM_UBICOM32_TYPES_H
3143 +
3144 +/*
3145 + * This file is never included by application software unless
3146 + * explicitly requested (e.g., via linux/types.h) in which case the
3147 + * application is Linux specific so (user-) name space pollution is
3148 + * not a major issue.  However, for interoperability, libraries still
3149 + * need to be careful to avoid a name clashes.
3150 + */
3151 +
3152 +#include <asm-generic/int-ll64.h>
3153 +
3154 +#ifndef __ASSEMBLY__
3155 +
3156 +typedef unsigned short umode_t;
3157 +
3158 +#endif /* __ASSEMBLY__ */
3159 +
3160 +/*
3161 + * These aren't exported outside the kernel to avoid name space clashes
3162 + */
3163 +#ifdef __KERNEL__
3164 +
3165 +#define BITS_PER_LONG 32
3166 +
3167 +#ifndef __ASSEMBLY__
3168 +
3169 +/* DMA addresses are always 32-bits wide */
3170 +
3171 +typedef u32 dma_addr_t;
3172 +typedef u32 dma64_addr_t;
3173 +
3174 +/*
3175 + * XXX These are "Ubicom style" typedefs. They should be removed in all files used by linux.
3176 + */
3177 +typedef u32 u32_t;
3178 +typedef s32 s32_t;
3179 +typedef u16 u16_t;
3180 +typedef s16 s16_t;
3181 +typedef u8 u8_t;
3182 +typedef s8 s8_t;
3183 +
3184 +#endif /* __ASSEMBLY__ */
3185 +
3186 +#endif /* __KERNEL__ */
3187 +
3188 +#endif /* _ASM_UBICOM32_TYPES_H */
3189 --- /dev/null
3190 +++ b/arch/ubicom32/include/asm/ucontext.h
3191 @@ -0,0 +1,39 @@
3192 +/*
3193 + * arch/ubicom32/include/asm/ucontext.h
3194 + *   Definition of ucontext structure for Ubicom32 architecture.
3195 + *
3196 + * (C) Copyright 2009, Ubicom, Inc.
3197 + *
3198 + * This file is part of the Ubicom32 Linux Kernel Port.
3199 + *
3200 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
3201 + * it and/or modify it under the terms of the GNU General Public License
3202 + * as published by the Free Software Foundation, either version 2 of the
3203 + * License, or (at your option) any later version.
3204 + *
3205 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
3206 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
3207 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
3208 + * the GNU General Public License for more details.
3209 + *
3210 + * You should have received a copy of the GNU General Public License
3211 + * along with the Ubicom32 Linux Kernel Port.  If not, 
3212 + * see <http://www.gnu.org/licenses/>.
3213 + *
3214 + * Ubicom32 implementation derived from (with many thanks):
3215 + *   arch/m68knommu
3216 + *   arch/blackfin
3217 + *   arch/parisc
3218 + */
3219 +#ifndef _ASM_UBICOM32_UCONTEXT_H
3220 +#define _ASM_UBICOM32_UCONTEXT_H
3221 +
3222 +struct ucontext {
3223 +       unsigned long     uc_flags;
3224 +       struct ucontext  *uc_link;
3225 +       stack_t           uc_stack;
3226 +       struct sigcontext         uc_mcontext;
3227 +       sigset_t          uc_sigmask;   /* mask last for extensibility */
3228 +};
3229 +
3230 +#endif /* _ASM_UBICOM32_UCONTEXT_H */
3231 --- /dev/null
3232 +++ b/arch/ubicom32/include/asm/unistd.h
3233 @@ -0,0 +1,400 @@
3234 +/*
3235 + * arch/ubicom32/include/asm/unistd.h
3236 + *   Ubicom32 architecture syscall definitions.
3237 + *
3238 + * (C) Copyright 2009, Ubicom, Inc.
3239 + *
3240 + * This file is part of the Ubicom32 Linux Kernel Port.
3241 + *
3242 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
3243 + * it and/or modify it under the terms of the GNU General Public License
3244 + * as published by the Free Software Foundation, either version 2 of the
3245 + * License, or (at your option) any later version.
3246 + *
3247 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
3248 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
3249 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
3250 + * the GNU General Public License for more details.
3251 + *
3252 + * You should have received a copy of the GNU General Public License
3253 + * along with the Ubicom32 Linux Kernel Port.  If not, 
3254 + * see <http://www.gnu.org/licenses/>.
3255 + *
3256 + * Ubicom32 implementation derived from (with many thanks):
3257 + *   arch/m68knommu
3258 + *   arch/blackfin
3259 + *   arch/parisc
3260 + */
3261 +#ifndef _ASM_UBICOM32_UNISTD_H
3262 +#define _ASM_UBICOM32_UNISTD_H
3263 +
3264 +/*
3265 + * This file contains the system call numbers.
3266 + */
3267 +
3268 +#define __NR_restart_syscall      0
3269 +#define __NR_exit                1
3270 +#define __NR_fork                2
3271 +#define __NR_read                3
3272 +#define __NR_write               4
3273 +#define __NR_open                5
3274 +#define __NR_close               6
3275 +#define __NR_waitpid             7
3276 +#define __NR_creat               8
3277 +#define __NR_link                9
3278 +#define __NR_unlink             10
3279 +#define __NR_execve             11
3280 +#define __NR_chdir              12
3281 +#define __NR_time               13
3282 +#define __NR_mknod              14
3283 +#define __NR_chmod              15
3284 +#define __NR_chown              16
3285 +#define __NR_break              17
3286 +#define __NR_oldstat            18
3287 +#define __NR_lseek              19
3288 +#define __NR_getpid             20
3289 +#define __NR_mount              21
3290 +#define __NR_umount             22
3291 +#define __NR_setuid             23
3292 +#define __NR_getuid             24
3293 +#define __NR_stime              25
3294 +#define __NR_ptrace             26
3295 +#define __NR_alarm              27
3296 +#define __NR_oldfstat           28
3297 +#define __NR_pause              29
3298 +#define __NR_utime              30
3299 +#define __NR_stty               31
3300 +#define __NR_gtty               32
3301 +#define __NR_access             33
3302 +#define __NR_nice               34
3303 +#define __NR_ftime              35
3304 +#define __NR_sync               36
3305 +#define __NR_kill               37
3306 +#define __NR_rename             38
3307 +#define __NR_mkdir              39
3308 +#define __NR_rmdir              40
3309 +#define __NR_dup                41
3310 +#define __NR_pipe               42
3311 +#define __NR_times              43
3312 +#define __NR_prof               44
3313 +#define __NR_brk                45
3314 +#define __NR_setgid             46
3315 +#define __NR_getgid             47
3316 +#define __NR_signal             48
3317 +#define __NR_geteuid            49
3318 +#define __NR_getegid            50
3319 +#define __NR_acct               51
3320 +#define __NR_umount2            52
3321 +#define __NR_lock               53
3322 +#define __NR_ioctl              54
3323 +#define __NR_fcntl              55
3324 +#define __NR_mpx                56
3325 +#define __NR_setpgid            57
3326 +#define __NR_ulimit             58
3327 +#define __NR_oldolduname        59
3328 +#define __NR_umask              60
3329 +#define __NR_chroot             61
3330 +#define __NR_ustat              62
3331 +#define __NR_dup2               63
3332 +#define __NR_getppid            64
3333 +#define __NR_getpgrp            65
3334 +#define __NR_setsid             66
3335 +#define __NR_sigaction          67
3336 +#define __NR_sgetmask           68
3337 +#define __NR_ssetmask           69
3338 +#define __NR_setreuid           70
3339 +#define __NR_setregid           71
3340 +#define __NR_sigsuspend                 72
3341 +#define __NR_sigpending                 73
3342 +#define __NR_sethostname        74
3343 +#define __NR_setrlimit          75
3344 +#define __NR_getrlimit          76
3345 +#define __NR_getrusage          77
3346 +#define __NR_gettimeofday       78
3347 +#define __NR_settimeofday       79
3348 +#define __NR_getgroups          80
3349 +#define __NR_setgroups          81
3350 +#define __NR_select             82
3351 +#define __NR_symlink            83
3352 +#define __NR_oldlstat           84
3353 +#define __NR_readlink           85
3354 +#define __NR_uselib             86
3355 +#define __NR_swapon             87
3356 +#define __NR_reboot             88
3357 +#define __NR_readdir            89
3358 +#define __NR_mmap               90
3359 +#define __NR_munmap             91
3360 +#define __NR_truncate           92
3361 +#define __NR_ftruncate          93
3362 +#define __NR_fchmod             94
3363 +#define __NR_fchown             95
3364 +#define __NR_getpriority        96
3365 +#define __NR_setpriority        97
3366 +#define __NR_profil             98
3367 +#define __NR_statfs             99
3368 +#define __NR_fstatfs           100
3369 +#define __NR_ioperm            101
3370 +#define __NR_socketcall                102
3371 +#define __NR_syslog            103
3372 +#define __NR_setitimer         104
3373 +#define __NR_getitimer         105
3374 +#define __NR_stat              106
3375 +#define __NR_lstat             107
3376 +#define __NR_fstat             108
3377 +#define __NR_olduname          109
3378 +#define __NR_iopl              /* 110 */ not supported
3379 +#define __NR_vhangup           111
3380 +#define __NR_idle              /* 112 */ Obsolete
3381 +#define __NR_vm86              /* 113 */ not supported
3382 +#define __NR_wait4             114
3383 +#define __NR_swapoff           115
3384 +#define __NR_sysinfo           116
3385 +#define __NR_ipc               117
3386 +#define __NR_fsync             118
3387 +#define __NR_sigreturn         119
3388 +#define __NR_clone             120
3389 +#define __NR_setdomainname     121
3390 +#define __NR_uname             122
3391 +#define __NR_cacheflush                123
3392 +#define __NR_adjtimex          124
3393 +#define __NR_mprotect          125
3394 +#define __NR_sigprocmask       126
3395 +#define __NR_create_module     127
3396 +#define __NR_init_module       128
3397 +#define __NR_delete_module     129
3398 +#define __NR_get_kernel_syms   130
3399 +#define __NR_quotactl          131
3400 +#define __NR_getpgid           132
3401 +#define __NR_fchdir            133
3402 +#define __NR_bdflush           134
3403 +#define __NR_sysfs             135
3404 +#define __NR_personality       136
3405 +#define __NR_afs_syscall       137 /* Syscall for Andrew File System */
3406 +#define __NR_setfsuid          138
3407 +#define __NR_setfsgid          139
3408 +#define __NR__llseek           140
3409 +#define __NR_getdents          141
3410 +#define __NR__newselect                142
3411 +#define __NR_flock             143
3412 +#define __NR_msync             144
3413 +#define __NR_readv             145
3414 +#define __NR_writev            146
3415 +#define __NR_getsid            147
3416 +#define __NR_fdatasync         148
3417 +#define __NR__sysctl           149
3418 +#define __NR_mlock             150
3419 +#define __NR_munlock           151
3420 +#define __NR_mlockall          152
3421 +#define __NR_munlockall                153
3422 +#define __NR_sched_setparam            154
3423 +#define __NR_sched_getparam            155
3424 +#define __NR_sched_setscheduler                156
3425 +#define __NR_sched_getscheduler                157
3426 +#define __NR_sched_yield               158
3427 +#define __NR_sched_get_priority_max    159
3428 +#define __NR_sched_get_priority_min    160
3429 +#define __NR_sched_rr_get_interval     161
3430 +#define __NR_nanosleep         162
3431 +#define __NR_mremap            163
3432 +#define __NR_setresuid         164
3433 +#define __NR_getresuid         165
3434 +#define __NR_getpagesize       166
3435 +#define __NR_query_module      167
3436 +#define __NR_poll              168
3437 +#define __NR_nfsservctl                169
3438 +#define __NR_setresgid         170
3439 +#define __NR_getresgid         171
3440 +#define __NR_prctl             172
3441 +#define __NR_rt_sigreturn      173
3442 +#define __NR_rt_sigaction      174
3443 +#define __NR_rt_sigprocmask    175
3444 +#define __NR_rt_sigpending     176
3445 +#define __NR_rt_sigtimedwait   177
3446 +#define __NR_rt_sigqueueinfo   178
3447 +#define __NR_rt_sigsuspend     179
3448 +#define __NR_pread64           180
3449 +#define __NR_pwrite64          181
3450 +#define __NR_lchown            182
3451 +#define __NR_getcwd            183
3452 +#define __NR_capget            184
3453 +#define __NR_capset            185
3454 +#define __NR_sigaltstack       186
3455 +#define __NR_sendfile          187
3456 +#define __NR_getpmsg           188     /* some people actually want streams */
3457 +#define __NR_putpmsg           189     /* some people actually want streams */
3458 +#define __NR_vfork             190
3459 +#define __NR_ugetrlimit                191
3460 +#define __NR_mmap2             192
3461 +#define __NR_truncate64                193
3462 +#define __NR_ftruncate64       194
3463 +#define __NR_stat64            195
3464 +#define __NR_lstat64           196
3465 +#define __NR_fstat64           197
3466 +#define __NR_chown32           198
3467 +#define __NR_getuid32          199
3468 +#define __NR_getgid32          200
3469 +#define __NR_geteuid32         201
3470 +#define __NR_getegid32         202
3471 +#define __NR_setreuid32                203
3472 +#define __NR_setregid32                204
3473 +#define __NR_getgroups32       205
3474 +#define __NR_setgroups32       206
3475 +#define __NR_fchown32          207
3476 +#define __NR_setresuid32       208
3477 +#define __NR_getresuid32       209
3478 +#define __NR_setresgid32       210
3479 +#define __NR_getresgid32       211
3480 +#define __NR_lchown32          212
3481 +#define __NR_setuid32          213
3482 +#define __NR_setgid32          214
3483 +#define __NR_setfsuid32                215
3484 +#define __NR_setfsgid32                216
3485 +#define __NR_pivot_root                217
3486 +#define __NR_getdents64                220
3487 +#define __NR_gettid            221
3488 +#define __NR_tkill             222
3489 +#define __NR_setxattr          223
3490 +#define __NR_lsetxattr         224
3491 +#define __NR_fsetxattr         225
3492 +#define __NR_getxattr          226
3493 +#define __NR_lgetxattr         227
3494 +#define __NR_fgetxattr         228
3495 +#define __NR_listxattr         229
3496 +#define __NR_llistxattr                230
3497 +#define __NR_flistxattr                231
3498 +#define __NR_removexattr       232
3499 +#define __NR_lremovexattr      233
3500 +#define __NR_fremovexattr      234
3501 +#define __NR_futex             235
3502 +#define __NR_sendfile64                236
3503 +#define __NR_mincore           237
3504 +#define __NR_madvise           238
3505 +#define __NR_fcntl64           239
3506 +#define __NR_readahead         240
3507 +#define __NR_io_setup          241
3508 +#define __NR_io_destroy                242
3509 +#define __NR_io_getevents      243
3510 +#define __NR_io_submit         244
3511 +#define __NR_io_cancel         245
3512 +#define __NR_fadvise64         246
3513 +#define __NR_exit_group                247
3514 +#define __NR_lookup_dcookie    248
3515 +#define __NR_epoll_create      249
3516 +#define __NR_epoll_ctl         250
3517 +#define __NR_epoll_wait                251
3518 +#define __NR_remap_file_pages  252
3519 +#define __NR_set_tid_address   253
3520 +#define __NR_timer_create      254
3521 +#define __NR_timer_settime     255
3522 +#define __NR_timer_gettime     256
3523 +#define __NR_timer_getoverrun  257
3524 +#define __NR_timer_delete      258
3525 +#define __NR_clock_settime     259
3526 +#define __NR_clock_gettime     260
3527 +#define __NR_clock_getres      261
3528 +#define __NR_clock_nanosleep   262
3529 +#define __NR_statfs64          263
3530 +#define __NR_fstatfs64         264
3531 +#define __NR_tgkill            265
3532 +#define __NR_utimes            266
3533 +#define __NR_fadvise64_64      267
3534 +#define __NR_mbind             268
3535 +#define __NR_get_mempolicy     269
3536 +#define __NR_set_mempolicy     270
3537 +#define __NR_mq_open           271
3538 +#define __NR_mq_unlink         272
3539 +#define __NR_mq_timedsend      273
3540 +#define __NR_mq_timedreceive   274
3541 +#define __NR_mq_notify         275
3542 +#define __NR_mq_getsetattr     276
3543 +#define __NR_waitid            277
3544 +#define __NR_vserver           278
3545 +#define __NR_add_key           279
3546 +#define __NR_request_key       280
3547 +#define __NR_keyctl            281
3548 +#define __NR_ioprio_set                282
3549 +#define __NR_ioprio_get                283
3550 +#define __NR_inotify_init      284
3551 +#define __NR_inotify_add_watch 285
3552 +#define __NR_inotify_rm_watch  286
3553 +#define __NR_migrate_pages     287
3554 +#define __NR_openat            288
3555 +#define __NR_mkdirat           289
3556 +#define __NR_mknodat           290
3557 +#define __NR_fchownat          291
3558 +#define __NR_futimesat         292
3559 +#define __NR_fstatat64         293
3560 +#define __NR_unlinkat          294
3561 +#define __NR_renameat          295
3562 +#define __NR_linkat            296
3563 +#define __NR_symlinkat         297
3564 +#define __NR_readlinkat                298
3565 +#define __NR_fchmodat          299
3566 +#define __NR_faccessat         300
3567 +#define __NR_pselect6          301
3568 +#define __NR_ppoll             302
3569 +#define __NR_unshare           303
3570 +#define __NR_set_robust_list   304
3571 +#define __NR_get_robust_list   305
3572 +#define __NR_splice            306
3573 +#define __NR_sync_file_range   307
3574 +#define __NR_tee               308
3575 +#define __NR_vmsplice          309
3576 +#define __NR_move_pages                310
3577 +#define __NR_sched_setaffinity 311
3578 +#define __NR_sched_getaffinity 312
3579 +#define __NR_kexec_load                313
3580 +#define __NR_getcpu            314
3581 +#define __NR_epoll_pwait       315
3582 +#define __NR_utimensat         316
3583 +#define __NR_signalfd          317
3584 +#define __NR_timerfd_create    318
3585 +#define __NR_eventfd           319
3586 +#define __NR_fallocate         320
3587 +#define __NR_timerfd_settime   321
3588 +#define __NR_timerfd_gettime   322
3589 +#define __NR_signalfd4         323
3590 +#define __NR_eventfd2          324
3591 +#define __NR_epoll_create1     325
3592 +#define __NR_dup3              326
3593 +#define __NR_pipe2             327
3594 +#define __NR_inotify_init1     328
3595 +
3596 +#ifdef __KERNEL__
3597 +
3598 +#define NR_syscalls            329
3599 +
3600 +#define __ARCH_WANT_IPC_PARSE_VERSION
3601 +#define __ARCH_WANT_OLD_READDIR
3602 +#define __ARCH_WANT_OLD_STAT
3603 +#define __ARCH_WANT_STAT64
3604 +#define __ARCH_WANT_SYS_ALARM
3605 +#define __ARCH_WANT_SYS_GETHOSTNAME
3606 +#define __ARCH_WANT_SYS_PAUSE
3607 +#define __ARCH_WANT_SYS_SGETMASK
3608 +#define __ARCH_WANT_SYS_SIGNAL
3609 +#define __ARCH_WANT_SYS_TIME
3610 +#define __ARCH_WANT_SYS_UTIME
3611 +#define __ARCH_WANT_SYS_WAITPID
3612 +#define __ARCH_WANT_SYS_SOCKETCALL
3613 +#define __ARCH_WANT_SYS_FADVISE64
3614 +#define __ARCH_WANT_SYS_GETPGRP
3615 +#define __ARCH_WANT_SYS_LLSEEK
3616 +#define __ARCH_WANT_SYS_NICE
3617 +#define __ARCH_WANT_SYS_OLD_GETRLIMIT
3618 +#define __ARCH_WANT_SYS_OLDUMOUNT
3619 +#define __ARCH_WANT_SYS_SIGPENDING
3620 +#define __ARCH_WANT_SYS_SIGPROCMASK
3621 +#define __ARCH_WANT_SYS_RT_SIGACTION
3622 +
3623 +/*
3624 + * "Conditional" syscalls
3625 + *
3626 + * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
3627 + * but it doesn't work on all toolchains, so we just do it by hand
3628 + */
3629 +//#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
3630 +#define cond_syscall(x) long x(void)  __attribute__((weak,alias("sys_ni_syscall")))
3631 +#endif /* __KERNEL__ */
3632 +
3633 +#endif /* _ASM_UBICOM32_UNISTD_H */
3634 --- /dev/null
3635 +++ b/arch/ubicom32/include/asm/user.h
3636 @@ -0,0 +1,82 @@
3637 +/*
3638 + * arch/ubicom32/include/asm/user.h
3639 + *   Ubicom32 architecture core file definitions.
3640 + *
3641 + * (C) Copyright 2009, Ubicom, Inc.
3642 + *
3643 + * This file is part of the Ubicom32 Linux Kernel Port.
3644 + *
3645 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
3646 + * it and/or modify it under the terms of the GNU General Public License
3647 + * as published by the Free Software Foundation, either version 2 of the
3648 + * License, or (at your option) any later version.
3649 + *
3650 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
3651 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
3652 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
3653 + * the GNU General Public License for more details.
3654 + *
3655 + * You should have received a copy of the GNU General Public License
3656 + * along with the Ubicom32 Linux Kernel Port.  If not, 
3657 + * see <http://www.gnu.org/licenses/>.
3658 + *
3659 + * Ubicom32 implementation derived from (with many thanks):
3660 + *   arch/m68knommu
3661 + *   arch/blackfin
3662 + *   arch/parisc
3663 + */
3664 +#ifndef _ASM_UBICOM32_USER_H
3665 +#define _ASM_UBICOM32_USER_H
3666 +
3667 +#include <asm/ptrace.h>
3668 +#include <asm/page.h>
3669 +/*
3670 + * Adapted from <asm-powerpc/user.h>
3671 + *
3672 + * Core file format: The core file is written in such a way that gdb
3673 + * can understand it and provide useful information to the user (under
3674 + * linux we use the `trad-core' bfd, NOT the osf-core).  The file contents
3675 + * are as follows:
3676 + *
3677 + *  upage: 1 page consisting of a user struct that tells gdb
3678 + *     what is present in the file.  Directly after this is a
3679 + *     copy of the task_struct, which is currently not used by gdb,
3680 + *     but it may come in handy at some point.  All of the registers
3681 + *     are stored as part of the upage.  The upage should always be
3682 + *     only one page long.
3683 + *  data: The data segment follows next.  We use current->end_text to
3684 + *     current->brk to pick up all of the user variables, plus any memory
3685 + *     that may have been sbrk'ed.  No attempt is made to determine if a
3686 + *     page is demand-zero or if a page is totally unused, we just cover
3687 + *     the entire range.  All of the addresses are rounded in such a way
3688 + *     that an integral number of pages is written.
3689 + *  stack: We need the stack information in order to get a meaningful
3690 + *     backtrace.  We need to write the data from usp to
3691 + *     current->start_stack, so we round each of these in order to be able
3692 + *     to write an integer number of pages.
3693 + */
3694 +
3695 +struct user_ubicom32fp_struct {
3696 +};
3697 +
3698 +struct user {
3699 +       struct pt_regs  regs;                   /* entire machine state */
3700 +       size_t          u_tsize;                /* text size (pages) */
3701 +       size_t          u_dsize;                /* data size (pages) */
3702 +       size_t          u_ssize;                /* stack size (pages) */
3703 +       unsigned long   start_code;             /* text starting address */
3704 +       unsigned long   start_data;             /* data starting address */
3705 +       unsigned long   start_stack;            /* stack starting address */
3706 +       long int        signal;                 /* signal causing core dump */
3707 +       unsigned long   u_ar0;                  /* help gdb find registers */
3708 +       unsigned long   magic;                  /* identifies a core file */
3709 +       char            u_comm[32];             /* user command name */
3710 +};
3711 +
3712 +#define NBPG                   PAGE_SIZE
3713 +#define UPAGES                 1
3714 +#define HOST_TEXT_START_ADDR   (u.start_code)
3715 +#define HOST_DATA_START_ADDR   (u.start_data)
3716 +#define HOST_STACK_END_ADDR    (u.start_stack + u.u_ssize * NBPG)
3717 +
3718 +#endif /* _ASM_UBICOM32_USER_H */
3719 --- /dev/null
3720 +++ b/arch/ubicom32/include/asm/xor.h
3721 @@ -0,0 +1,33 @@
3722 +/*
3723 + * arch/ubicom32/include/asm/xor.h
3724 + *   Generic xor.h definitions for Ubicom32 architecture.
3725 + *
3726 + * (C) Copyright 2009, Ubicom, Inc.
3727 + *
3728 + * This file is part of the Ubicom32 Linux Kernel Port.
3729 + *
3730 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
3731 + * it and/or modify it under the terms of the GNU General Public License
3732 + * as published by the Free Software Foundation, either version 2 of the
3733 + * License, or (at your option) any later version.
3734 + *
3735 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
3736 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
3737 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
3738 + * the GNU General Public License for more details.
3739 + *
3740 + * You should have received a copy of the GNU General Public License
3741 + * along with the Ubicom32 Linux Kernel Port.  If not, 
3742 + * see <http://www.gnu.org/licenses/>.
3743 + *
3744 + * Ubicom32 implementation derived from (with many thanks):
3745 + *   arch/m68knommu
3746 + *   arch/blackfin
3747 + *   arch/parisc
3748 + */
3749 +#ifndef _ASM_UBICOM32_XOR_H
3750 +#define _ASM_UBICOM32_XOR_H
3751 +
3752 +#include <asm-generic/xor.h>
3753 +
3754 +#endif /* _ASM_UBICOM32_XOR_H */
3755 --- /dev/null
3756 +++ b/arch/ubicom32/Kconfig
3757 @@ -0,0 +1,455 @@
3758 +#
3759 +# For a description of the syntax of this configuration file,
3760 +# see Documentation/kbuild/kconfig-language.txt.
3761 +#
3762 +
3763 +mainmenu "uClinux/ubicom32 (w/o MMU) Kernel Configuration"
3764 +
3765 +config RAMBASE
3766 +       hex
3767 +       default "0x40000000"
3768 +       help
3769 +               Define the address that RAM starts at.
3770 +
3771 +config UBICOM32
3772 +       bool
3773 +       select HAVE_OPROFILE
3774 +       default y
3775 +
3776 +config RAMKERNEL
3777 +       bool
3778 +       default y
3779 +
3780 +config CPU_BIG_ENDIAN
3781 +       bool
3782 +       default y
3783 +
3784 +config FORCE_MAX_ZONEORDER
3785 +       int
3786 +       default "14"
3787 +
3788 +config HAVE_CLK
3789 +       bool
3790 +       default y
3791 +
3792 +config MMU
3793 +       bool
3794 +       default n
3795 +
3796 +config FPU
3797 +       bool
3798 +       default n
3799 +
3800 +config ZONE_DMA
3801 +       bool
3802 +       default y
3803 +
3804 +config RWSEM_GENERIC_SPINLOCK
3805 +       bool
3806 +       default y
3807 +
3808 +config RWSEM_XCHGADD_ALGORITHM
3809 +       bool
3810 +       default n
3811 +
3812 +config ARCH_HAS_ILOG2_U32
3813 +       bool
3814 +       default n
3815 +
3816 +config ARCH_HAS_ILOG2_U64
3817 +       bool
3818 +       default n
3819 +
3820 +config GENERIC_FIND_NEXT_BIT
3821 +       bool
3822 +       default y
3823 +
3824 +config GENERIC_GPIO
3825 +       bool
3826 +       default y
3827 +
3828 +config GPIOLIB
3829 +       bool
3830 +       default y
3831 +
3832 +config GENERIC_HWEIGHT
3833 +       bool
3834 +       default y
3835 +
3836 +config GENERIC_HARDIRQS
3837 +       bool
3838 +       default y
3839 +
3840 +config STACKTRACE_SUPPORT
3841 +       bool
3842 +       default y
3843 +
3844 +config LOCKDEP_SUPPORT
3845 +       bool
3846 +       default y
3847 +
3848 +config GENERIC_CALIBRATE_DELAY
3849 +       bool
3850 +       default y
3851 +
3852 +config GENERIC_TIME
3853 +       bool
3854 +       default y
3855 +
3856 +config TIME_LOW_RES
3857 +       bool
3858 +       default y
3859 +
3860 +config GENERIC_CLOCKEVENTS
3861 +       bool
3862 +       default y
3863 +
3864 +config GENERIC_CLOCKEVENTS_BROADCAST
3865 +       bool
3866 +       depends on GENERIC_CLOCKEVENTS
3867 +       default y if SMP && !LOCAL_TIMERS
3868 +
3869 +config NO_IOPORT
3870 +       def_bool y
3871 +
3872 +config ARCH_SUPPORTS_AOUT
3873 +       def_bool y
3874 +
3875 +config IRQ_PER_CPU
3876 +       bool
3877 +       default y
3878 +
3879 +config SCHED_NO_NO_OMIT_FRAME_POINTER
3880 +       bool
3881 +       default y
3882 +
3883 +menu "Processor type and features"
3884 +
3885 +config BRD_32MB
3886 +       bool
3887 +       depends on IP5160EVAL
3888 +       help
3889 +               Board has 32MB of RAM on it.  It is a hidden option used to select default for size of RAM
3890 +       default n
3891 +
3892 +config BRD_64MB
3893 +       bool
3894 +       depends on IP7145DPF || IP7160RGW || IP7160BRINGUP || IP7160DPF || IP5170DPF || IP5160DEV
3895 +       help
3896 +               Board has 64MB of RAM on it.  It is a hidden option used to select default for size of RAM
3897 +       default n
3898 +
3899 +config BRD_128MB
3900 +       bool
3901 +       depends on IP7500MODULE || IP7500AV || IP7500MEDIA
3902 +       help
3903 +               Board has 128MB of RAM on it.  It is a hidden option used to select default for size of RAM
3904 +       default n
3905 +
3906 +comment "Processor type will be selected by Board"
3907 +
3908 +config UBICOM32_V3
3909 +       bool
3910 +       help
3911 +         Ubicom IP5xxx series processor support.
3912 +
3913 +config UBICOM32_V4
3914 +       bool
3915 +       help
3916 +         Ubicom IP7xxx series processor support.
3917 +
3918 +comment "Board"
3919 +choice
3920 +       prompt "Board type"
3921 +       help
3922 +               Select your board.
3923 +
3924 +config NOBOARD
3925 +       bool "No board selected"
3926 +       help
3927 +               Default. Don't select any board specific config. Will not build unless you change!
3928 +
3929 +# Add your boards here
3930 +source "arch/ubicom32/mach-ip5k/Kconfig"
3931 +source "arch/ubicom32/mach-ip7k/Kconfig"
3932 +
3933 +endchoice
3934 +
3935 +comment "Kernel Options"
3936 +config SMP
3937 +       bool "Symmetric multi-processing support"
3938 +       select USE_GENERIC_SMP_HELPERS
3939 +       default n
3940 +       help
3941 +         Enables multithreading support.  Enabling SMP support increases
3942 +         the size of system data structures.  SMP support can have either 
3943 +         positive or negative impact on performance depending on workloads. 
3944 +
3945 +         If you do not know what to do here, say N.
3946 +
3947 +config NR_CPUS
3948 +       int "Number of configured CPUs"
3949 +       range 2 32
3950 +       default 2
3951 +       depends on SMP
3952 +       help
3953 +               Upper bound on the number of CPUs. Space is reserved 
3954 +               at compile time for this many CPUs.
3955 +               
3956 +config LOCAL_TIMERS
3957 +       bool "Use local timer interrupts"
3958 +       depends on SMP
3959 +       default y
3960 +       help
3961 +         Enable support for local timers on SMP platforms, rather then the
3962 +         legacy IPI broadcast method.  Local timers allows the system
3963 +         accounting to be spread across the timer interval, preventing a
3964 +         "thundering herd" at every timer tick.  A physical timer is allocated
3965 +         per cpu.              
3966 +
3967 +config TIMER_EXTRA_ALLOC
3968 +       int "Number of additional physical timer events to create"
3969 +       depends on GENERIC_CLOCKEVENTS
3970 +       default 0
3971 +       help
3972 +               The Ubicom32 processor has a number of event timers that can be wrapped
3973 +               in Linux clock event structures (assuming that the timers are not being
3974 +               used for another purpose).  Based on the value of LOCAL_TIMERS, either 
3975 +               2 timers will be used or a timer will be used for every CPU.  This value
3976 +               allows the programmer to select additional timers over that amount.
3977 +                       
3978 +config IRQSTACKS
3979 +       bool "Create separate stacks for interrupt handling"
3980 +       default n
3981 +       help
3982 +               Selecting this causes interrupts to be created on a separate
3983 +               stack instead of nesting the interrupts on the kernel stack.
3984 +               
3985 +config IRQSTACKS_USEOCM
3986 +       bool "Use OCM for interrupt stacks"
3987 +       default n
3988 +       depends on IRQSTACKS
3989 +       help
3990 +               Selecting this cause the interrupt stacks to be placed in OCM
3991 +               reducing cache misses at the expense of using the OCM for servicing
3992 +               interrupts.
3993 +
3994 +menu "OCM Instruction Heap"
3995 +
3996 +config OCM_MODULES_RESERVATION
3997 +       int "OCM Instruction heap reservation. 0-192 kB"
3998 +       range 0 192
3999 +       default "0"
4000 +       help
4001 +         The minimum amount of OCM memory to reserve for kernel loadable module
4002 +         code. If you are not using this memory it cannot be used for anything
4003 +         else. Leave it as 0 if you have prebuilt modules that are compiled with
4004 +         OCM support.
4005 +
4006 +config OCM_MODULES_MAY_CONSUME_REMAINING_CODESPACE
4007 +       bool "Give all unused ocm code space to the ocm instruction heap."
4008 +       default n
4009 +       help
4010 +         Allow the OCM instruction heap allocation to consume any remaining
4011 +         unused OCM code space.  The result of this is that you will not have
4012 +         and deterministic results, but you will not have any waste either.
4013 +
4014 +config OCM_MODULES_FALLBACK_TO_DDR
4015 +       bool "Loadable Modules requiring OCM may fallback to use DDR."
4016 +       default n
4017 +       help
4018 +         If a module cannot get the OCM code it requires allow DDR to
4019 +         be used instead.
4020 +endmenu
4021 +
4022 +config HZ
4023 +       int "Frequency of 'jiffies' (for polling)"
4024 +       default 1000
4025 +       help
4026 +               100 is common for embedded systems, but 1000 allows
4027 +               you to do more drivers without actually having
4028 +               interrupts working properly.
4029 +
4030 +comment "RAM configuration"
4031 +
4032 +if BRD_32MB
4033 +
4034 +config RAMSIZE
4035 +       hex "Size of RAM (in bytes)"
4036 +       range 0x00000000 0x02000000
4037 +       default "0x02000000"
4038 +       help
4039 +               Define the size of the system RAM. If you select 0 then the
4040 +               kernel will try to probe the RAM size at runtime. This is not
4041 +               supported on all CPU types.
4042 +
4043 +endif
4044 +
4045 +if BRD_64MB
4046 +
4047 +config RAMSIZE
4048 +       hex "Size of RAM (in bytes)"
4049 +       range 0x00000000 0x04000000
4050 +       default "0x04000000"
4051 +       help
4052 +               Define the size of the system RAM. If you select 0 then the
4053 +               kernel will try to probe the RAM size at runtime. This is not
4054 +               supported on all CPU types.
4055 +
4056 +endif
4057 +
4058 +if BRD_128MB
4059 +
4060 +config RAMSIZE
4061 +       hex "Size of RAM (in bytes)"
4062 +       range 0x00000000 0x08000000
4063 +       default "0x08000000"
4064 +       help
4065 +               Define the size of the system RAM. If you select 0 then the
4066 +               kernel will try to probe the RAM size at runtime. This is not
4067 +               supported on all CPU types.
4068 +
4069 +endif
4070 +
4071 +config KERNELBASE
4072 +       hex "Address of the base of kernel code"
4073 +       default "0x40400000"
4074 +       help
4075 +               For the time being we are going to start the Kernel at a 4 meg offset.
4076 +
4077 +comment "Build options"
4078 +config LINKER_RELAXATION
4079 +       bool "Linker Relaxation"
4080 +       default y
4081 +       help
4082 +         Turns on linker relaxation that will produce smaller
4083 +         faster code. Increases link time.
4084 +
4085 +comment "Driver options"
4086 +menu "PCI Bus"
4087 +config PCI
4088 +       bool "PCI bus"
4089 +       default true
4090 +       help
4091 +         Enable/Disable PCI bus
4092 +       source "drivers/pci/Kconfig"
4093 +
4094 +
4095 +config PCI_DEV0_IDSEL
4096 +       hex "slot 0 address"
4097 +       depends on PCI
4098 +       default "0x01000000"
4099 +       help
4100 +         Slot 0 address.  This address should correspond to the address line
4101 +         which the IDSEL bit for this slot is connected to.
4102 +
4103 +config PCI_DEV1_IDSEL
4104 +       hex "slot 1 address"
4105 +       depends on PCI
4106 +       default "0x02000000"
4107 +       help
4108 +         Slot 1 address.  This address should correspond to the address line
4109 +         which the IDSEL bit for this slot is connected to.
4110 +endmenu
4111 +# End PCI
4112 +
4113 +menu "Input devices"
4114 +config UBICOM_INPUT
4115 +       bool "Ubicom polled GPIO input driver"
4116 +       select INPUT
4117 +       select INPUT_POLLDEV
4118 +       help
4119 +               Polling input driver, much like the GPIO input driver, except that it doesn't
4120 +               rely on interrupts.  It will report events via the input subsystem.
4121 +       default n
4122 +
4123 +config UBICOM_INPUT_I2C
4124 +       bool "Ubicom polled GPIO input driver over I2C"
4125 +       select INPUT
4126 +       select INPUT_POLLDEV
4127 +       help
4128 +               Polling input driver, much like the PCA953x driver, it can support a variety of
4129 +               different I2C I/O expanders.  This device polls the I2C I/O expander for events
4130 +               and reports them via the input subsystem.
4131 +       default n
4132 +endmenu
4133 +# Input devices
4134 +
4135 +menu "Misc devices"
4136 +config UBICOM_HID
4137 +       bool "Ubicom HID driver"
4138 +       select INPUT
4139 +       select INPUT_POLLDEV
4140 +       select LCD_CLASS_DEVICE
4141 +       help
4142 +               Driver for HID chip found on some Ubicom reference designs.  This chip handles
4143 +               PWM, button input, and IR remote control.  It registers as an input device and
4144 +               a backlight device.
4145 +       default n
4146 +endmenu
4147 +# Misc devices
4148 +
4149 +config CMDLINE_BOOL
4150 +       bool "Built-in kernel command line"
4151 +       default n
4152 +       help
4153 +         Allow for specifying boot arguments to the kernel at
4154 +         build time.  On some systems (e.g. embedded ones), it is
4155 +         necessary or convenient to provide some or all of the
4156 +         kernel boot arguments with the kernel itself (that is,
4157 +         to not rely on the boot loader to provide them.)
4158 +
4159 +         To compile command line arguments into the kernel,
4160 +         set this option to 'Y', then fill in the
4161 +         the boot arguments in CONFIG_CMDLINE.
4162 +
4163 +         Systems with fully functional boot loaders (i.e. non-embedded)
4164 +         should leave this option set to 'N'.
4165 +
4166 +config CMDLINE
4167 +       string "Built-in kernel command string"
4168 +       depends on CMDLINE_BOOL
4169 +       default ""
4170 +       help
4171 +         Enter arguments here that should be compiled into the kernel
4172 +         image and used at boot time.  If the boot loader provides a
4173 +         command line at boot time, it is appended to this string to
4174 +         form the full kernel command line, when the system boots.
4175 +
4176 +         However, you can use the CONFIG_CMDLINE_OVERRIDE option to
4177 +         change this behavior.
4178 +
4179 +         In most cases, the command line (whether built-in or provided
4180 +         by the boot loader) should specify the device for the root
4181 +         file system.
4182 +
4183 +config CMDLINE_OVERRIDE
4184 +       bool "Built-in command line overrides boot loader arguments"
4185 +       default n
4186 +       depends on CMDLINE_BOOL
4187 +       help
4188 +         Set this option to 'Y' to have the kernel ignore the boot loader
4189 +         command line, and use ONLY the built-in command line.
4190 +
4191 +         This is used to work around broken boot loaders.  This should
4192 +         be set to 'N' under normal conditions.
4193 +
4194 +endmenu
4195 +# End Processor type and features
4196 +
4197 +source "arch/ubicom32/Kconfig.debug"
4198 +
4199 +menu "Executable file formats"
4200 +source "fs/Kconfig.binfmt"
4201 +endmenu
4202 +
4203 +source "init/Kconfig"
4204 +source "kernel/Kconfig.preempt"
4205 +source "kernel/time/Kconfig"
4206 +source "mm/Kconfig"
4207 +source "net/Kconfig"
4208 +source "drivers/Kconfig"
4209 +source "fs/Kconfig"
4210 +source "security/Kconfig"
4211 +source "crypto/Kconfig"
4212 +source "lib/Kconfig"
4213 --- /dev/null
4214 +++ b/arch/ubicom32/Kconfig.debug
4215 @@ -0,0 +1,117 @@
4216 +menu "Kernel hacking"
4217 +
4218 +config TRACE_IRQFLAGS_SUPPORT
4219 +       def_bool y
4220 +       
4221 +config PROTECT_KERNEL
4222 +       default y
4223 +       bool 'Enable Kernel range register Protection'
4224 +       help
4225 +         Adds code to enable/disable range registers to protect static
4226 +         kernel code/data from userspace.  Currently the ranges covered
4227 +         do no protect kernel loadable modules or dynamically allocated
4228 +         kernel data.
4229 +
4230 +config NO_KERNEL_MSG
4231 +       bool "Suppress Kernel BUG Messages"
4232 +       help
4233 +         Do not output any debug BUG messages within the kernel.
4234 +
4235 +config EARLY_PRINTK
4236 +       bool "Use the driver that you selected as console also for early printk (to debug kernel bootup)."
4237 +       default n
4238 +       help
4239 +         If you want to use the serdes driver (console=ttyUS0) for
4240 +         early printk, you must also supply an additional kernel boot
4241 +         parameter like this:
4242 +
4243 +               serdes=ioportaddr,irq,clockrate,baud
4244 +
4245 +         For an IP7160RGW eval board, you could use this:
4246 +
4247 +               serdes=0x2004000,61,250000000,57600
4248 +
4249 +         which will let you see early printk output at 57600 baud.
4250 +
4251 +config STOP_ON_TRAP
4252 +       bool "Enable stopping at the LDSR for all traps"
4253 +       default n
4254 +       help
4255 +       Cause the LDSR to stop all threads whenever a trap is about to be serviced
4256 +       
4257 +config STOP_ON_BUG
4258 +       bool "Enable stopping on failed BUG_ON()"
4259 +       default n
4260 +       help
4261 +       Cause all BUG_ON failures to stop all threads
4262 +       
4263 +config DEBUG_IRQMEASURE
4264 +       bool "Enable IRQ handler measurements"
4265 +       default n
4266 +       help
4267 +       When enabled each IRQ's min/avg/max times will be printed.  If the handler
4268 +       re-enables interrupt, the times will show the full time including to service
4269 +       nested interrupts.  See /proc/irq_measurements.
4270 +       
4271 +config DEBUG_PCIMEASURE
4272 +       bool "Enable PCI transaction measurements"
4273 +       default n
4274 +       help
4275 +       When enabled the system will measure the min/avg/max timer for each PCI transactions.
4276 +       See /proc/pci_measurements.
4277 +
4278 +config ACCESS_OK_CHECKS_ENABLED
4279 +       bool "Enable user space access checks"
4280 +       default n
4281 +       help
4282 +       Enabling this check causes the kernel to verify that addresses passed
4283 +       to the kernel by the user space code are within the processes 
4284 +       address space.  On a no-mmu system, this is done by examining the
4285 +       processes memory data structures (adversly affecting performance) but
4286 +       ensuring that a process does not ask the kernel to violate another 
4287 +       processes address space.  Sadly, the kernel uses access_ok() for 
4288 +       address that are in the kernel which results in a large volume of 
4289 +       false positives.
4290 +
4291 +choice
4292 +       prompt "Unaligned Access Support"
4293 +       default UNALIGNED_ACCESS_ENABLED
4294 +       help
4295 +               Kernel / Userspace unaligned access handling.
4296 +
4297 +config  UNALIGNED_ACCESS_ENABLED
4298 +       bool "Kernel and Userspace"
4299 +       help
4300 +
4301 +config  UNALIGNED_ACCESS_USERSPACE_ONLY
4302 +       bool "Userspace Only"
4303 +       help
4304 +
4305 +config  UNALIGNED_ACCESS_DISABLED
4306 +       bool "Disabled"
4307 +       help
4308 +
4309 +endchoice
4310 +
4311 +config DEBUG_STACKOVERFLOW
4312 +       bool "Check for stack overflows"
4313 +       default n
4314 +       depends on DEBUG_KERNEL
4315 +       help
4316 +         This option will cause messages to be printed if free kernel stack space
4317 +         drops below a certain limit (THREAD_SIZE /8).
4318 +
4319 +config DEBUG_STACK_USAGE
4320 +       bool "Stack utilization instrumentation"
4321 +       default n
4322 +       depends on DEBUG_KERNEL
4323 +       help
4324 +         Enables the display of the minimum amount of free kernel stack which each
4325 +         task has ever had available in the sysrq-T and sysrq-P debug output.
4326 +
4327 +         This option will slow down process creation somewhat.
4328 +
4329 +source "lib/Kconfig.debug"
4330 +
4331 +endmenu
4332 +
4333 --- /dev/null
4334 +++ b/arch/ubicom32/Makefile
4335 @@ -0,0 +1,103 @@
4336 +#
4337 +# arch/ubicom32/Makefile
4338 +#      <TODO: Replace with short file description>
4339 +#
4340 +# (C) Copyright 2009, Ubicom, Inc.
4341 +#
4342 +# This file is part of the Ubicom32 Linux Kernel Port.
4343 +#
4344 +# The Ubicom32 Linux Kernel Port is free software: you can redistribute
4345 +# it and/or modify it under the terms of the GNU General Public License
4346 +# as published by the Free Software Foundation, either version 2 of the
4347 +# License, or (at your option) any later version.
4348 +#
4349 +# The Ubicom32 Linux Kernel Port is distributed in the hope that it
4350 +# will be useful, but WITHOUT ANY WARRANTY; without even the implied
4351 +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
4352 +# the GNU General Public License for more details.
4353 +#
4354 +# You should have received a copy of the GNU General Public License
4355 +# along with the Ubicom32 Linux Kernel Port.  If not, 
4356 +# see <http://www.gnu.org/licenses/>.
4357 +#
4358 +# Ubicom32 implementation derived from (with many thanks):
4359 +#   arch/m68knommu
4360 +#   arch/blackfin
4361 +#   arch/parisc
4362 +#
4363 +
4364 +KBUILD_DEFCONFIG := 
4365 +
4366 +# setup the machine name and machine dependent settings
4367 +machine-$(CONFIG_UBICOM32_V3)  := ip5k
4368 +machine-$(CONFIG_UBICOM32_V4)  := ip7k
4369 +MACHINE := $(machine-y)
4370 +export MACHINE
4371 +
4372 +model-$(CONFIG_RAMKERNEL)      := ram
4373 +model-$(CONFIG_ROMKERNEL)      := rom
4374 +MODEL := $(model-y)
4375 +export MODEL
4376 +
4377 +CPUCLASS := $(cpuclass-y)
4378 +
4379 +export CPUCLASS
4380 +
4381 +#
4382 +# We want the core kernel built using the fastcall ABI but modules need
4383 +# to be built using the slower calling convention because they could be
4384 +# loaded out of range for fast calls.
4385 +#
4386 +CFLAGS_KERNEL    += -mfastcall
4387 +CFLAGS_MODULE    += -mno-fastcall
4388 +
4389 +#
4390 +# Some CFLAG additions based on specific CPU type.
4391 +#
4392 +cflags-$(CONFIG_UBICOM32_V3)           := -march=ubicom32v3 -mno-fdpic -DIP5000
4393 +cflags-$(CONFIG_UBICOM32_V4)           := -march=ubicom32v4 -mno-fdpic -DIP7000
4394 +
4395 +ldflags-$(CONFIG_LINKER_RELAXATION)    := --relax
4396 +LDFLAGS_vmlinux := $(ldflags-y)
4397 +
4398 +GCCLIBDIR := $(dir $(shell $(CC) $(cflags-y) -print-libgcc-file-name))
4399 +
4400 +KBUILD_CFLAGS += $(cflags-y) -ffunction-sections
4401 +KBUILD_AFLAGS += $(cflags-y)
4402 +
4403 +KBUILD_CFLAGS += -D__linux__ -Dlinux
4404 +KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
4405 +
4406 +# include any machine specific directory
4407 +ifneq ($(machine-y),)
4408 +core-y += arch/$(ARCH)/mach-$(MACHINE)/
4409 +endif
4410 +
4411 +head-y := arch/$(ARCH)/kernel/head.o
4412 +
4413 +core-y += arch/$(ARCH)/kernel/ \
4414 +          arch/$(ARCH)/mm/ \
4415 +          arch/$(ARCH)/crypto/ \
4416 +          arch/$(ARCH)/mach-common/
4417 +
4418 +drivers-$(CONFIG_OPROFILE)     += arch/ubicom32/oprofile/
4419 +
4420 +libs-y += arch/$(ARCH)/lib/
4421 +
4422 +archclean:
4423 +
4424 +# make sure developer has selected a valid board
4425 +ifeq ($(CONFIG_NOBOARD),y)
4426 +# $(error have to select a valid board file $(CONFIG_NOBOARD), please run kernel config again)
4427 +_all: config_board_error
4428 +endif
4429 +
4430 +config_board_error:
4431 +       @echo "*************************************************"
4432 +       @echo "You have not selected a proper board."
4433 +       @echo "Please run menuconfig (or config) against your"
4434 +       @echo "kernel and choose your board under Processor"
4435 +       @echo "options"
4436 +       @echo "*************************************************"
4437 +       @exit 1
4438 +
4439 --- /dev/null
4440 +++ b/arch/ubicom32/kernel/asm-offsets.c
4441 @@ -0,0 +1,162 @@
4442 +/*
4443 + * arch/ubicom32/kernel/asm-offsets.c
4444 + *   Ubicom32 architecture definitions needed by assembly language modules.
4445 + *
4446 + * (C) Copyright 2009, Ubicom, Inc.
4447 + *
4448 + * This file is part of the Ubicom32 Linux Kernel Port.
4449 + *
4450 + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
4451 + * it and/or modify it under the terms of the GNU General Public License
4452 + * as published by the Free Software Foundation, either version 2 of the
4453 + * License, or (at your option) any later version.
4454 + *
4455 + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
4456 + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
4457 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
4458 + * the GNU General Public License for more details.
4459 + *
4460 + * You should have received a copy of the GNU General Public License
4461 + * along with the Ubicom32 Linux Kernel Port.  If not,
4462 + * see <http://www.gnu.org/licenses/>.
4463 + *
4464 + * Ubicom32 implementation derived from (with many thanks):
4465 + *   arch/m68knommu
4466 + *   arch/blackfin
4467 + *   arch/parisc
4468 + */
4469 +/*
4470 + * This program is used to generate definitions needed by
4471 + * assembly language modules.
4472 + *
4473 + * We use the technique used in the OSF Mach kernel code:
4474 + * generate asm statements containing #defines,
4475 + * compile this file to assembler, and then extract the
4476 + * #defines from the assembly-language output.
4477 + */
4478 +
4479 +#include <linux/module.h>
4480 +#include <linux/stddef.h>
4481 +#include <linux/sched.h>
4482 +#include <linux/kernel_stat.h>
4483 +#include <linux/ptrace.h>
4484 +#include <linux/hardirq.h>
4485 +#include <asm/bootinfo.h>
4486 +#include <asm/irq.h>
4487 +#include <asm/thread_info.h>
4488 +
4489 +#define DEFINE(sym, val) \
4490 +        asm volatile("\n->" #sym " %0 " #val : : "i" (val))
4491 +
4492 +#define BLANK() asm volatile("\n->" : : )
4493 +
4494 +int main(void)
4495 +{
4496 +       /* offsets into the task struct */
4497 +       DEFINE(TASK_STATE, offsetof(struct task_struct, state));
4498 +       DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
4499 +       DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
4500 +       DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked));
4501 +       DEFINE(TASK_THREAD, offsetof(struct task_struct, thread));
4502 +       DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, stack));
4503 +       DEFINE(TASK_MM, offsetof(struct task_struct, mm));
4504 +       DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
4505 +
4506 +       /* offsets into the kernel_stat struct */
4507 +       DEFINE(STAT_IRQ, offsetof(struct kernel_stat, irqs));
4508 +
4509 +       /* offsets into the irq_cpustat_t struct */
4510 +       DEFINE(CPUSTAT_SOFTIRQ_PENDING, offsetof(irq_cpustat_t, __softirq_pending));
4511 +
4512 +       /* offsets into the thread struct */
4513 +       DEFINE(THREAD_D10, offsetof(struct thread_struct, d10));
4514 +       DEFINE(THREAD_D11, offsetof(struct thread_struct, d11));
4515 +       DEFINE(THREAD_D12, offsetof(struct thread_struct, d12));
4516 +       DEFINE(THREAD_D13, offsetof(struct thread_struct, d13));
4517 +       DEFINE(THREAD_A1, offsetof(struct thread_struct, a1));
4518 +       DEFINE(THREAD_A2, offsetof(struct thread_struct, a2));
4519 +       DEFINE(THREAD_A5, offsetof(struct thread_struct, a5));
4520 +       DEFINE(THREAD_A6, offsetof(struct thread_struct, a6));
4521 +       DEFINE(THREAD_SP, offsetof(struct thread_struct, sp));
4522 +
4523 +       /* offsets into the pt_regs */
4524 +       DEFINE(PT_D0, offsetof(struct pt_regs, dn[0]));
4525 +       DEFINE(PT_D1, offsetof(struct pt_regs, dn[1]));
4526 +       DEFINE(PT_D2, offsetof(struct pt_regs, dn[2]));
4527 +       DEFINE(PT_D3, offsetof(struct pt_regs, dn[3]));
4528 +       DEFINE(PT_D4, offsetof(struct pt_regs, dn[4]));
4529 +       DEFINE(PT_D5, offsetof(struct pt_regs, dn[5]));
4530 +       DEFINE(PT_D6, offsetof(struct pt_regs, dn[6]));
4531 +       DEFINE(PT_D7, offsetof(struct pt_regs, dn[7]));
4532 +       DEFINE(PT_D8, offsetof(struct pt_regs, dn[8]));
4533 +       DEFINE(PT_D9, offsetof(struct pt_regs, dn[9]));
4534 +       DEFINE(PT_D10, offsetof(struct pt_regs, dn[10]));
4535 +       DEFINE(PT_D11, offsetof(struct pt_regs, dn[11]));
4536 +       DEFINE(PT_D12, offsetof(struct pt_regs, dn[12]));
4537 +       DEFINE(PT_D13, offsetof(struct pt_regs, dn[13]));
4538 +       DEFINE(PT_D14, offsetof(struct pt_regs, dn[14]));
4539 +       DEFINE(PT_D15, offsetof(struct pt_regs, dn[15]));
4540 +       DEFINE(PT_A0, offsetof(struct pt_regs, an[0]));
4541 +       DEFINE(PT_A1, offsetof(struct pt_regs, an[1]));
4542 +       DEFINE(PT_A2, offsetof(struct pt_regs, an[2]));
4543 +       DEFINE(PT_A3, offsetof(struct pt_regs, an[3]));
4544 +       DEFINE(PT_A4, offsetof(struct pt_regs, an[4]));
4545 +       DEFINE(PT_A5, offsetof(struct pt_regs, an[5]));
4546 +       DEFINE(PT_A6, offsetof(struct pt_regs, an[6]));
4547 +       DEFINE(PT_A7, offsetof(struct pt_regs, an[7]));
4548 +       DEFINE(PT_SP, offsetof(struct pt_regs, an[7]));
4549 +
4550 +       DEFINE(PT_ACC0HI, offsetof(struct pt_regs, acc0[0]));
4551 +       DEFINE(PT_ACC0LO, offsetof(struct pt_regs, acc0[1]));
4552 +       DEFINE(PT_MAC_RC16, offsetof(struct pt_regs, mac_rc16));
4553 +
4554 +       DEFINE(PT_ACC1HI, offsetof(struct pt_regs, acc1[0]));
4555 +       DEFINE(PT_ACC1LO, offsetof(struct pt_regs, acc1[1]));
4556 +
4557 +       DEFINE(PT_SOURCE3, offsetof(struct pt_regs, source3));
4558 +       DEFINE(PT_INST_CNT, offsetof(struct pt_regs, inst_cnt));
4559 +       DEFINE(PT_CSR, offsetof(struct pt_regs, csr));
4560 +       DEFINE(PT_DUMMY_UNUSED, offsetof(struct pt_regs, dummy_unused));
4561 +
4562 +       DEFINE(PT_INT_MASK0, offsetof(struct pt_regs, int_mask0));
4563 +       DEFINE(PT_INT_MASK1, offsetof(struct pt_regs, int_mask1));
4564 +
4565 +       DEFINE(PT_PC, offsetof(struct pt_regs, pc));
4566 +
4567 +       DEFINE(PT_TRAP_CAUSE, offsetof(struct pt_regs, trap_cause));
4568 +
4569 +       DEFINE(PT_SIZE, sizeof(struct pt_regs));
4570 +
4571 +       DEFINE(PT_FRAME_TYPE, offsetof(struct pt_regs, frame_type));
4572 +
4573 +       DEFINE(PT_ORIGINAL_D0, offsetof(struct pt_regs, original_dn_0));
4574 +       DEFINE(PT_PREVIOUS_PC, offsetof(struct pt_regs, previous_pc));
4575 +
4576 +       /* offsets into the kernel_stat struct */
4577 +       DEFINE(STAT_IRQ, offsetof(struct kernel_stat, irqs));
4578 +
4579 +       /* signal defines */
4580 +       DEFINE(SIGSEGV, SIGSEGV);
4581 +       //DEFINE(SEGV_MAPERR, SEGV_MAPERR);
4582 +       DEFINE(SIGTRAP, SIGTRAP);
4583 +       //DEFINE(TRAP_TRACE, TRAP_TRACE);
4584 +
4585 +       DEFINE(PT_PTRACED, PT_PTRACED);
4586 +       DEFINE(PT_DTRACE, PT_DTRACE);
4587 +
4588 +       DEFINE(ASM_THREAD_SIZE, THREAD_SIZE);
4589 +
4590 +       /* Offsets in thread_info structure */
4591 +       DEFINE(TI_TASK, offsetof(struct thread_info, task));
4592 +       DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
4593 +       DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
4594 +       DEFINE(TI_PREEMPTCOUNT, offsetof(struct thread_info, preempt_count));
4595 +       DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
4596 +       DEFINE(TI_INTR_NESTING, offsetof(struct thread_info, interrupt_nesting));
4597 +       DEFINE(ASM_TIF_NEED_RESCHED, TIF_NEED_RESCHED);
4598 +       DEFINE(ASM_TIF_SYSCALL_TRACE, TIF_SYSCALL_TRACE);
4599 +       DEFINE(ASM_TIF_SIGPENDING, TIF_SIGPENDING);
4600 +
4601 +       DEFINE(ASM_RAM_END, (CONFIG_RAMBASE + CONFIG_RAMSIZE));
4602 +       return 0;
4603 +}
4604 --- /dev/null
4605 +++ b/arch/ubicom32/kernel/Makefile
4606 @@ -0,0 +1,64 @@
4607 +#
4608 +# arch/ubicom32/kernel/Makefile
4609 +#      Main Makefile for the Ubicom32 arch directory.
4610 +#
4611 +# (C) Copyright 2009, Ubicom, Inc.
4612 +#
4613 +# This file is part of the Ubicom32 Linux Kernel Port.
4614 +#
4615 +# The Ubicom32 Linux Kernel Port is free software: you can redistribute
4616 +# it and/or modify it under the terms of the GNU General Public License
4617 +# as published by the Free Software Foundation, either version 2 of the
4618 +# License, or (at your option) any later version.
4619 +#
4620 +# The Ubicom32 Linux Kernel Port is distributed in the hope that it
4621 +# will be useful, but WITHOUT ANY WARRANTY; without even the implied
4622 +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
4623 +# the GNU General Public License for more details.
4624 +#
4625 +# You should have received a copy of the GNU General Public License
4626 +# along with the Ubicom32 Linux Kernel Port.  If not, 
4627 +# see <http://www.gnu.org/licenses/>.
4628 +#
4629 +# Ubicom32 implementation derived from (with many thanks):
4630 +#   arch/m68knommu
4631 +#   arch/blackfin
4632 +#   arch/parisc
4633 +#
4634 +
4635 +extra-y := head.o vmlinux.lds
4636 +
4637 +obj-y += \
4638 +       devtree.o \
4639 +       dma.o \
4640 +       flat.o \
4641 +       init_task.o \
4642 +       irq.o \
4643 +       ldsr.o \
4644 +       os_node.o \
4645 +       process.o \
4646 +       processor.o \
4647 +       ptrace.o \
4648 +       setup.o \
4649 +       signal.o \
4650 +       stacktrace.o \
4651 +       sys_ubicom32.o \
4652 +       syscalltable.o \
4653 +       thread.o \
4654 +       time.o \
4655 +       traps.o \
4656 +       ubicom32_context_switch.o \
4657 +       ubicom32_ksyms.o \
4658 +       ubicom32_syscall.o \
4659 +       unaligned_trap.o
4660 +
4661 +obj-$(CONFIG_MODULES)                          += module.o
4662 +obj-$(CONFIG_COMEMPCI)                         += comempci.o
4663 +obj-$(CONFIG_SMP)                              += smp.o topology.o
4664 +obj-$(CONFIG_ACCESS_OK_CHECKS_ENABLED)         += uaccess.o
4665 +obj-$(CONFIG_GENERIC_CLOCKEVENTS)              += timer_device.o
4666 +obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)    += timer_broadcast.o
4667 +
4668 +ifndef CONFIG_GENERIC_CLOCKEVENTS
4669 +obj-y                  += timer_tick.o
4670 +endif
4671 --- /dev/null
4672 +++ b/arch/ubicom32/mach-ip5k/Kconfig
4673 @@ -0,0 +1,32 @@
4674 +
4675 +config IP5170DPF
4676 +       bool "IP5170DPF"
4677 +       select UBICOM32_V3
4678 +       select I2C
4679 +       select I2C_GPIO
4680 +       select FB
4681 +       select FB_UBICOM32
4682 +       select BACKLIGHT_LCD_SUPPORT
4683 +       select BACKLIGHT_CLASS_DEVICE
4684 +       select UBICOM_HID
4685 +       select NEW_LEDS
4686 +       select LEDS_CLASS
4687 +       select LEDS_GPIO
4688 +       select BRD_64MB
4689 +       help
4690 +               IP5170 Digital Picture Frame board, 8005-1113, IP5K-BEV-0011-13 v1.3
4691 +
4692 +config IP5160DEV
4693 +       bool "IP5160Dev_Ver1Dot1"
4694 +       select UBICOM32_V3
4695 +       select BRD_64MB
4696 +       help
4697 +               Ubicom StreamEngine 5000 Development Board, IP5K-BDV-0004-11 v1.1
4698 +
4699 +config IP5160EVAL
4700 +       bool "IP5160RGWEval_Ver2Rev2"
4701 +       select UBICOM32_V3
4702 +       select BRD_32MB
4703 +       help
4704 +               Ubicom StreamEngine 5000 RGW Evaluation Board, IP5K-RGW-0004-11 v2.2
4705 +
4706 --- /dev/null
4707 +++ b/arch/ubicom32/mach-ip7k/Kconfig
4708 @@ -0,0 +1,132 @@
4709 +config IP7145DPF
4710 +       bool "IP7145DPF"
4711 +       select UBICOM32_V4
4712 +       select UBICOM_INPUT
4713 +       select UBICOM_INPUT_I2C
4714 +       select RTC_CLASS
4715 +       select RTC_DRV_S35390A
4716 +       select I2C
4717 +       select I2C_GPIO
4718 +       select GPIO_PCA953X
4719 +       select FB
4720 +       select FB_UBICOM32
4721 +       select BACKLIGHT_LCD_SUPPORT
4722 +       select LCD_CLASS_DEVICE
4723 +       select LCD_UBICOM32
4724 +       select BACKLIGHT_CLASS_DEVICE
4725 +       select BACKLIGHT_UBICOM32
4726 +       select SND_UBI32
4727 +       select MMC_UBICOM32
4728 +       select MMC
4729 +       select MMC_BLOCK
4730 +       select BRD_64MB
4731 +       help
4732 +               IP7145 Digital Picture Frame reference design, supports:
4733 +                       8007-0410 v1.0
4734 +
4735 +config IP7160RGW
4736 +       bool "IP7160RGW"
4737 +       select UBICOM32_V4
4738 +       select UBICOM_INPUT
4739 +       select NEW_LEDS
4740 +       select LEDS_CLASS
4741 +       select LEDS_GPIO
4742 +       select BRD_64MB
4743 +       select SPI
4744 +       select SPI_UBICOM32_GPIO
4745 +       select VLAN_8021Q
4746 +       select UBICOM_SWITCH
4747 +       select UBICOM_SWITCH_BCM539X
4748 +       help
4749 +               Ubicom IP7160 RGW Eval, supports:
4750 +                       8007-0110 v1.0
4751 +                       8007-0111 v1.1
4752 +                       8007-0112 v1.2
4753 +
4754 +config IP7160BRINGUP
4755 +       bool "IP7160BRINGUP"
4756 +       select UBICOM32_V4
4757 +       select NEW_LEDS
4758 +       select LEDS_CLASS
4759 +       select LEDS_GPIO
4760 +       select BRD_64MB
4761 +       help
4762 +               Ubicom IP7160 Bringup, supports:
4763 +                       8007-0010 v1.0
4764 +
4765 +config IP7160DPF
4766 +       bool "IP7160DPF"
4767 +       select UBICOM32_V4
4768 +       select I2C
4769 +       select I2C_GPIO
4770 +       select FB
4771 +       select FB_UBICOM32
4772 +       select BACKLIGHT_LCD_SUPPORT
4773 +       select BACKLIGHT_CLASS_DEVICE
4774 +       select SND_UBI32
4775 +       select SND_UBI32_AUDIO_CS4350
4776 +       select UBICOM_HID
4777 +       select BRD_64MB
4778 +       help
4779 +               IP7160 Digital Picture Frame board, supports:
4780 +                       8007-0211 Rev 1.1
4781 +
4782 +config IP7500MODULE
4783 +       bool "IP7500MODULE"
4784 +       select UBICOM32_V4
4785 +       select BRD_128MB
4786 +       help
4787 +               Ubicom IP7500 CPU Module board, supports:
4788 +                       8007-0510  v1.0
4789 +                       8007-0510A v1.0
4790 +
4791 +               Please see ip7500module.c for more details.
4792 +
4793 +config IP7500AV
4794 +       bool "IP7500AV"
4795 +       select UBICOM32_V4
4796 +       select BRD_128MB
4797 +       select I2C
4798 +       select I2C_GPIO
4799 +       select SND_UBI32
4800 +       select SND_UBI32_AUDIO_CS4384
4801 +       select FB
4802 +       select FB_UBICOM32
4803 +       help
4804 +               Ubicom IP7500 Audio Video board, supports:
4805 +                       8007-0810  v1.0
4806 +
4807 +               With Ubicom IP7500 CPU Module board:
4808 +                       8007-0510  v1.0 -or-
4809 +                       8007-0510A v1.0
4810 +
4811 +               Please see ip7500av.c for more details.
4812 +
4813 +config IP7500MEDIA
4814 +       bool "IP7500MEDIA"
4815 +       select UBICOM32_V4
4816 +       select UBICOM_INPUT_I2C
4817 +       select RTC_CLASS
4818 +       select RTC_DRV_S35390A
4819 +       select I2C
4820 +       select I2C_GPIO
4821 +       select GPIO_PCA953X
4822 +       select FB
4823 +       select FB_UBICOM32
4824 +       select BACKLIGHT_LCD_SUPPORT
4825 +       select LCD_CLASS_DEVICE
4826 +       select LCD_UBICOM32
4827 +       select BACKLIGHT_CLASS_DEVICE
4828 +       select BACKLIGHT_UBICOM32
4829 +       select SND_UBI32
4830 +       select SND_UBI32_AUDIO_CS4350
4831 +       select MMC_UBICOM32
4832 +       select MMC
4833 +       select MMC_BLOCK
4834 +       select BRD_128MB
4835 +       help
4836 +               IP7500 Media Board w/ IP7500 CPU Module board, supports:
4837 +                       8007-0610 v1.0 w/ 8007-0510 v1.0
4838 +
4839 +               Please see ip7500media.c for more details.
4840 +
4841 --- a/fs/Kconfig.binfmt
4842 +++ b/fs/Kconfig.binfmt
4843 @@ -30,7 +30,7 @@ config COMPAT_BINFMT_ELF
4844  config BINFMT_ELF_FDPIC
4845         bool "Kernel support for FDPIC ELF binaries"
4846         default y
4847 -       depends on (FRV || BLACKFIN || (SUPERH32 && !MMU))
4848 +       depends on (FRV || BLACKFIN || (SUPERH32 && !MMU) || UBICOM32)
4849         help
4850           ELF FDPIC binaries are based on ELF, but allow the individual load
4851           segments of a binary to be located in memory independently of each
4852