Merge branch 'master' of git+ssh://openadk.org/git/openadk
[openadk.git] / target / linux / patches / 2.6.30.1 / cygwin-compat.patch
blob8d087dddf97a1a8a1e0d3af50c9fd41b4364d0ed
1 diff -Nur linux-2.6.30.orig/scripts/mod/file2alias.c linux-2.6.30/scripts/mod/file2alias.c
2 --- linux-2.6.30.orig/scripts/mod/file2alias.c 2009-06-10 05:05:27.000000000 +0200
3 +++ linux-2.6.30/scripts/mod/file2alias.c 2009-06-11 09:17:10.000000000 +0200
4 @@ -29,7 +29,11 @@
6 #include <ctype.h>
8 +#ifdef __CYGWIN__
9 +typedef __uint32_t __u32;
10 +#else
11 typedef uint32_t __u32;
12 +#endif
13 typedef uint16_t __u16;
14 typedef unsigned char __u8;
16 diff -Nur linux-2.6.30.orig/scripts/mod/modpost.h linux-2.6.30/scripts/mod/modpost.h
17 --- linux-2.6.30.orig/scripts/mod/modpost.h 2009-06-10 05:05:27.000000000 +0200
18 +++ linux-2.6.30/scripts/mod/modpost.h 2009-06-11 09:17:10.000000000 +0200
19 @@ -9,6 +9,11 @@
20 #include <unistd.h>
21 #include <elf.h>
23 +#ifdef __CYGWIN__
24 +typedef uint16_t Elf32_Section;
25 +typedef uint16_t Elf64_Section;
26 +#endif
28 #include "elfconfig.h"
30 #if KERNEL_ELFCLASS == ELFCLASS32
31 @@ -19,13 +24,17 @@
32 #define Elf_Addr Elf32_Addr
33 #define Elf_Sword Elf64_Sword
34 #define Elf_Section Elf32_Half
35 +#ifndef __CYGWIN__
36 #define ELF_ST_BIND ELF32_ST_BIND
37 #define ELF_ST_TYPE ELF32_ST_TYPE
38 +#endif
40 #define Elf_Rel Elf32_Rel
41 #define Elf_Rela Elf32_Rela
42 +#ifndef __CYGWIN__
43 #define ELF_R_SYM ELF32_R_SYM
44 #define ELF_R_TYPE ELF32_R_TYPE
45 +#endif
46 #else
48 #define Elf_Ehdr Elf64_Ehdr
49 @@ -43,6 +52,17 @@
50 #define ELF_R_TYPE ELF64_R_TYPE
51 #endif
53 +#define R_386_32 1 /* Direct 32 bit */
54 +#define R_386_PC32 2 /* PC relative 32 bit */
56 +#define R_ARM_PC24 1 /* PC relative 26 bit branch */
57 +#define R_ARM_ABS32 2 /* Direct 32 bit */
59 +#define R_MIPS_32 2 /* Direct 32 bit */
60 +#define R_MIPS_26 4 /* Direct 26 bit shifted */
61 +#define R_MIPS_HI16 5 /* High 16 bit */
62 +#define R_MIPS_LO16 6 /* Low 16 bit */
64 /* The 64-bit MIPS ELF ABI uses an unusual reloc format. */
65 typedef struct