-
Notifications
You must be signed in to change notification settings - Fork 31
/
longene-0.3.2-linux-2.6.34.diff
2370 lines (2239 loc) · 61.6 KB
/
longene-0.3.2-linux-2.6.34.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff -urN linux-2.6.34/arch/x86/include/asm/irq_vectors.h linux-2.6.34-longene/arch/x86/include/asm/irq_vectors.h
--- linux-2.6.34/arch/x86/include/asm/irq_vectors.h 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/arch/x86/include/asm/irq_vectors.h 2010-09-06 10:29:59.481862287 +0800
@@ -27,11 +27,24 @@
#define NMI_VECTOR 0x02
#define MCE_VECTOR 0x12
+#ifndef CONFIG_UNIFIED_KERNEL
/*
* IDT vectors usable for external interrupt sources start at 0x20.
* (0x80 is the syscall vector, 0x30-0x3f are for ISA)
*/
#define FIRST_EXTERNAL_VECTOR 0x20
+#else
+/*
+ * IDT vectors usable for external interrupt sources start
+ * at 0x30, as 0x20-0x2f are used by Win32 system call implementation:
+ */
+#define FIRST_EXTERNAL_VECTOR 0x30
+/*
+ * For Unified Kernel, 16 more IRQ's are reserved for win32 system
+ * call implementation, and thus the number of potential APIC
+ * interrupt sources is reduced by 16.
+ */
+#endif
/*
* We start allocating at 0x21 to spread out vectors evenly between
* priority levels. (0x80 is the syscall vector)
@@ -157,16 +170,30 @@
#ifdef CONFIG_X86_IO_APIC
# ifdef CONFIG_SPARSE_IRQ
# define CPU_VECTOR_LIMIT (64 * NR_CPUS)
+# ifndef CONFIG_UNIFIED_KERNEL
# define NR_IRQS \
(CPU_VECTOR_LIMIT > IO_APIC_VECTOR_LIMIT ? \
(NR_VECTORS + CPU_VECTOR_LIMIT) : \
(NR_VECTORS + IO_APIC_VECTOR_LIMIT))
+# else
+# define NR_IRQS \
+ (CPU_VECTOR_LIMIT > IO_APIC_VECTOR_LIMIT ? \
+ (NR_VECTORS + CPU_VECTOR_LIMIT - 16) : \
+ (NR_VECTORS + IO_APIC_VECTOR_LIMIT - 16))
+# endif
# else
# define CPU_VECTOR_LIMIT (32 * NR_CPUS)
+# ifndef CONFIG_UNIFIED_KERNEL
# define NR_IRQS \
(CPU_VECTOR_LIMIT < IO_APIC_VECTOR_LIMIT ? \
(NR_VECTORS + CPU_VECTOR_LIMIT) : \
(NR_VECTORS + IO_APIC_VECTOR_LIMIT))
+# else
+# define NR_IRQS \
+ (CPU_VECTOR_LIMIT < IO_APIC_VECTOR_LIMIT ? \
+ (NR_VECTORS + CPU_VECTOR_LIMIT - 16) : \
+ (NR_VECTORS + IO_APIC_VECTOR_LIMIT - 16))
+# endif
# endif
#else /* !CONFIG_X86_IO_APIC: */
# define NR_IRQS NR_IRQS_LEGACY
diff -urN linux-2.6.34/arch/x86/include/asm/thread_info.h linux-2.6.34-longene/arch/x86/include/asm/thread_info.h
--- linux-2.6.34/arch/x86/include/asm/thread_info.h 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/arch/x86/include/asm/thread_info.h 2010-09-06 10:29:59.193861320 +0800
@@ -120,6 +120,11 @@
#define _TIF_LAZY_MMU_UPDATES (1 << TIF_LAZY_MMU_UPDATES)
#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
+#ifdef CONFIG_UNIFIED_KERNEL
+#define TIF_APC 13
+#define _TIF_APC (1<<TIF_APC)
+#endif
+
/* work to do in syscall_trace_enter() */
#define _TIF_WORK_SYSCALL_ENTRY \
(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU | _TIF_SYSCALL_AUDIT | \
diff -urN linux-2.6.34/arch/x86/kernel/hw_breakpoint.c linux-2.6.34-longene/arch/x86/kernel/hw_breakpoint.c
--- linux-2.6.34/arch/x86/kernel/hw_breakpoint.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/arch/x86/kernel/hw_breakpoint.c 2010-09-06 10:30:03.741861365 +0800
@@ -411,6 +411,9 @@
t->ptrace_bps[i] = NULL;
}
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(flush_ptrace_hw_breakpoint);
+#endif
void hw_breakpoint_restore(void)
{
diff -urN linux-2.6.34/arch/x86/kernel/ldt.c linux-2.6.34-longene/arch/x86/kernel/ldt.c
--- linux-2.6.34/arch/x86/kernel/ldt.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/arch/x86/kernel/ldt.c 2010-09-06 10:30:06.057861242 +0800
@@ -119,6 +119,24 @@
return retval;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+int init_new_context_from_task(struct task_struct *ptsk, struct task_struct *tsk, struct mm_struct *mm)
+{
+ struct mm_struct * old_mm;
+ int retval = 0;
+
+ mutex_init(&mm->context.lock);
+ mm->context.size = 0;
+ old_mm = ptsk->mm;
+ if (old_mm && old_mm->context.size > 0) {
+ mutex_lock(&old_mm->context.lock);
+ retval = copy_ldt(&mm->context, &old_mm->context);
+ mutex_unlock(&old_mm->context.lock);
+ }
+ return retval;
+}
+#endif
+
/*
* No need to lock the MM as we are the last user
*
diff -urN linux-2.6.34/arch/x86/kernel/process.c linux-2.6.34-longene/arch/x86/kernel/process.c
--- linux-2.6.34/arch/x86/kernel/process.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/arch/x86/kernel/process.c 2010-09-06 10:30:04.624492726 +0800
@@ -92,6 +92,31 @@
}
}
+#ifdef CONFIG_UNIFIED_KERNEL
+/*
+ * Free thread data structures etc..
+ */
+void exit_thread_for_task(struct task_struct *tsk)
+{
+ struct thread_struct *t = &tsk->thread;
+ unsigned long *bp = t->io_bitmap_ptr;
+
+ if (bp) {
+ struct tss_struct *tss = &per_cpu(init_tss, get_cpu());
+
+ t->io_bitmap_ptr = NULL;
+ clear_thread_flag(TIF_IO_BITMAP);
+ /*
+ * Careful, clear this in the TSS too:
+ */
+ memset(tss->io_bitmap, 0xff, t->io_bitmap_max);
+ t->io_bitmap_max = 0;
+ put_cpu();
+ kfree(bp);
+ }
+}
+#endif
+
void show_regs(struct pt_regs *regs)
{
show_registers(regs);
@@ -696,6 +721,9 @@
sp -= get_random_int() % 8192;
return sp & ~0xf;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(arch_align_stack);
+#endif
unsigned long arch_randomize_brk(struct mm_struct *mm)
{
diff -urN linux-2.6.34/arch/x86/kernel/ptrace.c linux-2.6.34-longene/arch/x86/kernel/ptrace.c
--- linux-2.6.34/arch/x86/kernel/ptrace.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/arch/x86/kernel/ptrace.c 2010-09-06 10:30:03.493861299 +0800
@@ -44,6 +44,10 @@
#define CREATE_TRACE_POINTS
#include <trace/events/syscalls.h>
+#ifdef CONFIG_UNIFIED_KERNEL
+#include <linux/module.h>
+#endif
+
enum x86_regset {
REGSET_GENERAL,
REGSET_FP,
@@ -604,7 +608,11 @@
/*
* Handle ptrace writes to debug register 7.
*/
+#ifdef CONFIG_UNIFIED_KERNEL
+int ptrace_write_dr7(struct task_struct *tsk, unsigned long data)
+#else
static int ptrace_write_dr7(struct task_struct *tsk, unsigned long data)
+#endif
{
struct thread_struct *thread = &(tsk->thread);
unsigned long old_dr7;
@@ -662,6 +670,9 @@
}
return ((orig_ret < 0) ? orig_ret : rc);
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(ptrace_write_dr7);
+#endif
/*
* Handle PTRACE_PEEKUSR calls for the debug register area.
@@ -685,8 +696,13 @@
return val;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+int ptrace_set_breakpoint_addr(struct task_struct *tsk, int nr,
+ unsigned long addr)
+#else
static int ptrace_set_breakpoint_addr(struct task_struct *tsk, int nr,
unsigned long addr)
+#endif
{
struct perf_event *bp;
struct thread_struct *t = &tsk->thread;
@@ -733,6 +749,9 @@
return 0;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(ptrace_set_breakpoint_addr);
+#endif
/*
* Handle PTRACE_POKEUSR calls for the debug register area.
@@ -1774,6 +1793,9 @@
return ret ?: regs->orig_ax;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(syscall_trace_enter);
+#endif
asmregparm void syscall_trace_leave(struct pt_regs *regs)
{
@@ -1796,3 +1818,6 @@
if (step || test_thread_flag(TIF_SYSCALL_TRACE))
tracehook_report_syscall_exit(regs, step);
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(syscall_trace_leave);
+#endif
diff -urN linux-2.6.34/arch/x86/kernel/signal.c linux-2.6.34-longene/arch/x86/kernel/signal.c
--- linux-2.6.34/arch/x86/kernel/signal.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/arch/x86/kernel/signal.c 2010-09-06 10:30:02.797861317 +0800
@@ -37,6 +37,10 @@
#include <asm/sigframe.h>
+#ifdef CONFIG_UNIFIED_KERNEL
+#include <linux/module.h>
+#endif
+
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
#define __FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \
@@ -861,6 +865,9 @@
clear_thread_flag(TIF_IRET);
#endif /* CONFIG_X86_32 */
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(do_notify_resume);
+#endif
void signal_fault(struct pt_regs *regs, void __user *frame, char *where)
{
diff -urN linux-2.6.34/arch/x86/kernel/traps.c linux-2.6.34-longene/arch/x86/kernel/traps.c
--- linux-2.6.34/arch/x86/kernel/traps.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/arch/x86/kernel/traps.c 2010-09-06 10:30:02.873861314 +0800
@@ -879,6 +879,46 @@
}
#endif
+#ifdef CONFIG_UNIFIED_KERNEL
+int set_w32system_gate(unsigned int n, void *addr)
+{
+ /* 0x20 ~ 0x2f could be set */
+ if ((n & 0xfffffff0) != 0x20)
+ return -1;
+ _set_gate(n, GATE_TRAP, addr, 0x3, 0, __KERNEL_CS);
+ return 0;
+}
+EXPORT_SYMBOL(set_w32system_gate);
+
+int backup_idt_entry(unsigned int n, unsigned long *a, unsigned long *b)
+{
+ unsigned long *gate_addr;
+
+ /* 0x20 ~ 0x2f could be backup */
+ if ((n & 0xfffffff0) != 0x20)
+ return -1;
+ gate_addr = (unsigned long *)(idt_table + n);
+ *a = *gate_addr;
+ *b = *(gate_addr + 1);
+ return 0;
+}
+EXPORT_SYMBOL(backup_idt_entry);
+
+int restore_idt_entry(unsigned int n, unsigned long a, unsigned long b)
+{
+ unsigned long *gate_addr;
+
+ /* 0x20 ~ 0x2f could be restore */
+ if ((n & 0xfffffff0) != 0x20)
+ return -1;
+ gate_addr = (unsigned long *)(idt_table + n);
+ *gate_addr = a;
+ *(gate_addr + 1) = b;
+ return 0;
+}
+EXPORT_SYMBOL(restore_idt_entry);
+#endif
+
void __init trap_init(void)
{
int i;
diff -urN linux-2.6.34/arch/x86/kernel/vm86_32.c linux-2.6.34-longene/arch/x86/kernel/vm86_32.c
--- linux-2.6.34/arch/x86/kernel/vm86_32.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/arch/x86/kernel/vm86_32.c 2010-09-06 10:30:03.342826911 +0800
@@ -48,6 +48,10 @@
#include <asm/irq.h>
#include <asm/syscalls.h>
+#ifdef CONFIG_UNIFIED_KERNEL
+#include <linux/module.h>
+#endif
+
/*
* Known problems:
*
@@ -162,6 +166,9 @@
return ret;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(save_v86_state);
+#endif
static void mark_screen_rdonly(struct mm_struct *mm)
{
diff -urN linux-2.6.34/arch/x86/mm/mmap.c linux-2.6.34-longene/arch/x86/mm/mmap.c
--- linux-2.6.34/arch/x86/mm/mmap.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/arch/x86/mm/mmap.c 2010-09-06 10:30:00.449862062 +0800
@@ -30,6 +30,9 @@
#include <linux/limits.h>
#include <linux/sched.h>
#include <asm/elf.h>
+#ifdef CONFIG_UNIFIED_KERNEL
+#include <linux/module.h>
+#endif
static unsigned int stack_maxrandom_size(void)
{
@@ -134,3 +137,6 @@
mm->unmap_area = arch_unmap_area_topdown;
}
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(arch_pick_mmap_layout);
+#endif
diff -urN linux-2.6.34/arch/x86/vdso/vdso32-setup.c linux-2.6.34-longene/arch/x86/vdso/vdso32-setup.c
--- linux-2.6.34/arch/x86/vdso/vdso32-setup.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/arch/x86/vdso/vdso32-setup.c 2010-09-06 10:29:58.981861251 +0800
@@ -371,6 +371,9 @@
return ret;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(arch_setup_additional_pages);
+#endif
#ifdef CONFIG_X86_64
diff -urN linux-2.6.34/fs/dcache.c linux-2.6.34-longene/fs/dcache.c
--- linux-2.6.34/fs/dcache.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/fs/dcache.c 2010-09-06 10:30:28.802040867 +0800
@@ -2147,6 +2147,9 @@
free_page((unsigned long) page);
return error;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_getcwd);
+#endif
/*
* Test whether new_dentry is a subdirectory of old_dentry.
diff -urN linux-2.6.34/fs/eventpoll.c linux-2.6.34-longene/fs/eventpoll.c
--- linux-2.6.34/fs/eventpoll.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/fs/eventpoll.c 2010-09-06 10:30:33.941861294 +0800
@@ -1073,11 +1073,23 @@
* can change the item.
*/
if (revents) {
+#ifdef CONFIG_UNIFIED_KERNEL
+ if ((unsigned long)uevent >= 0xC0000000) {
+ uevent->events = revents;
+ uevent->data = epi->event.data;
+ }
+ else if (__put_user(revents, &uevent->events) ||
+ __put_user(epi->event.data, &uevent->data)) {
+ list_add(&epi->rdllink, head);
+ return eventcnt ? eventcnt : -EFAULT;
+ }
+#else
if (__put_user(revents, &uevent->events) ||
__put_user(epi->event.data, &uevent->data)) {
list_add(&epi->rdllink, head);
return eventcnt ? eventcnt : -EFAULT;
}
+#endif
eventcnt++;
uevent++;
if (epi->event.events & EPOLLONESHOT)
@@ -1220,6 +1232,9 @@
return sys_epoll_create1(0);
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_epoll_create);
+#endif
/*
* The following function implements the controller interface for
@@ -1236,9 +1251,17 @@
struct epoll_event epds;
error = -EFAULT;
+#ifdef CONFIG_UNIFIED_KERNEL
+ if ((unsigned long)event >= 0xC0000000) {
+ memcpy(&epds, event, sizeof(struct epoll_event));
+ }
+ else if (copy_from_user(&epds, event, sizeof(struct epoll_event)))
+ goto error_return;
+#else
if (ep_op_has_event(op) &&
copy_from_user(&epds, event, sizeof(struct epoll_event)))
goto error_return;
+#endif
/* Get the "struct file *" for the eventpoll file */
error = -EBADF;
@@ -1313,6 +1336,9 @@
return error;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_epoll_ctl);
+#endif
/*
* Implement the event wait interface for the eventpoll file. It is the kernel
@@ -1329,11 +1355,57 @@
if (maxevents <= 0 || maxevents > EP_MAX_EVENTS)
return -EINVAL;
+#ifndef CONFIG_UNIFIED_KERNEL
/* Verify that the area passed by the user is writeable */
if (!access_ok(VERIFY_WRITE, events, maxevents * sizeof(struct epoll_event))) {
error = -EFAULT;
goto error_return;
}
+#endif
+
+ /* Get the "struct file *" for the eventpoll file */
+ error = -EBADF;
+ file = fget(epfd);
+ if (!file)
+ goto error_return;
+
+ /*
+ * We have to check that the file structure underneath the fd
+ * the user passed to us _is_ an eventpoll file.
+ */
+ error = -EINVAL;
+ if (!is_file_epoll(file))
+ goto error_fput;
+
+ /*
+ * At this point it is safe to assume that the "private_data" contains
+ * our own data structure.
+ */
+ ep = file->private_data;
+
+ /* Time to fish for events ... */
+ error = ep_poll(ep, events, maxevents, timeout);
+
+error_fput:
+ fput(file);
+error_return:
+
+ return error;
+}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_epoll_wait);
+#endif
+
+int uk_epoll_wait(int epfd, struct epoll_event * events,
+ int maxevents, int timeout)
+{
+ int error;
+ struct file *file;
+ struct eventpoll *ep;
+
+ /* The maximum number of event must be greater than zero */
+ if (maxevents <= 0 || maxevents > EP_MAX_EVENTS)
+ return -EINVAL;
/* Get the "struct file *" for the eventpoll file */
error = -EBADF;
@@ -1364,6 +1436,9 @@
return error;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(uk_epoll_wait);
+#endif
#ifdef HAVE_SET_RESTORE_SIGMASK
diff -urN linux-2.6.34/fs/exec.c linux-2.6.34-longene/fs/exec.c
--- linux-2.6.34/fs/exec.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/fs/exec.c 2010-09-06 10:30:15.895479784 +0800
@@ -61,6 +61,12 @@
#include <asm/tlb.h>
#include "internal.h"
+#ifdef CONFIG_UNIFIED_KERNEL
+#include <linux/win32_thread.h>
+
+extern struct task_ethread_operations* tet_ops;
+#endif
+
int core_uses_pid;
char core_pattern[CORENAME_MAX_SIZE] = "core";
unsigned int core_pipe_limit;
@@ -758,7 +764,11 @@
* disturbing other processes. (Other processes might share the signal
* table via the CLONE_SIGHAND option to clone().)
*/
+#ifdef CONFIG_UNIFIED_KERNEL
+int de_thread(struct task_struct *tsk)
+#else
static int de_thread(struct task_struct *tsk)
+#endif
{
struct signal_struct *sig = tsk->signal;
struct sighand_struct *oldsighand = tsk->sighand;
@@ -895,6 +905,9 @@
BUG_ON(!thread_group_leader(tsk));
return 0;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(de_thread);
+#endif
/*
* These functions flushes out all traces of the currently running executable
@@ -977,6 +990,11 @@
if (retval)
goto out;
+#ifdef CONFIG_UNIFIED_KERNEL
+ if(current->ethread)
+ tet_ops->ethread_notify_execve(current);
+#endif
+
bprm->mm = NULL; /* We're using it now */
current->flags &= ~PF_RANDOMIZE;
@@ -1745,6 +1763,9 @@
break;
}
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(set_dumpable);
+#endif
static int __get_dumpable(unsigned long mm_flags)
{
diff -urN linux-2.6.34/fs/ext3/namei.c linux-2.6.34-longene/fs/ext3/namei.c
--- linux-2.6.34/fs/ext3/namei.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/fs/ext3/namei.c 2010-09-06 10:30:19.301895750 +0800
@@ -40,6 +40,9 @@
#include "namei.h"
#include "xattr.h"
#include "acl.h"
+#ifdef CONFIG_UNIFIED_KERNEL
+#include <linux/ctype.h>
+#endif
/*
* define how far ahead to read directories while searching them.
@@ -795,6 +798,15 @@
return 0;
if (!de->inode)
return 0;
+#ifdef CONFIG_UNIFIED_KERNEL
+ if (current->ethread) {
+ int i;
+ for (i = 0; i < len; i++)
+ if (tolower(name[i]) != tolower(de->name[i]))
+ return 0;
+ return 1;
+ }
+#endif
return !memcmp(name, de->name, len);
}
diff -urN linux-2.6.34/fs/ext4/namei.c linux-2.6.34-longene/fs/ext4/namei.c
--- linux-2.6.34/fs/ext4/namei.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/fs/ext4/namei.c 2010-09-06 10:30:17.348987944 +0800
@@ -39,6 +39,9 @@
#include "xattr.h"
#include "acl.h"
+#ifdef CONFIG_UNIFIED_KERNEL
+#include <linux/ctype.h>
+#endif
/*
* define how far ahead to read directories while searching them.
@@ -817,6 +820,15 @@
return 0;
if (!de->inode)
return 0;
+#ifdef CONFIG_UNIFIED_KERNEL
+ if (current->ethread) {
+ int i;
+ for (i = 0; i < len; i++)
+ if (tolower(name[i]) != tolower(de->name[i]))
+ return 0;
+ return 1;
+ }
+#endif
return !memcmp(name, de->name, len);
}
diff -urN linux-2.6.34/fs/fcntl.c linux-2.6.34-longene/fs/fcntl.c
--- linux-2.6.34/fs/fcntl.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/fs/fcntl.c 2010-09-06 10:30:23.289861289 +0800
@@ -126,6 +126,9 @@
}
return sys_dup3(oldfd, newfd, 0);
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_dup2);
+#endif
SYSCALL_DEFINE1(dup, unsigned int, fildes)
{
@@ -141,6 +144,9 @@
}
return ret;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_dup);
+#endif
#define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME)
@@ -439,6 +445,9 @@
out:
return err;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_fcntl);
+#endif
#if BITS_PER_LONG == 32
SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
diff -urN linux-2.6.34/fs/file.c linux-2.6.34-longene/fs/file.c
--- linux-2.6.34/fs/file.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/fs/file.c 2010-09-06 10:30:17.798149478 +0800
@@ -488,6 +488,9 @@
spin_unlock(&files->file_lock);
return error;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(alloc_fd);
+#endif
int get_unused_fd(void)
{
diff -urN linux-2.6.34/fs/namei.c linux-2.6.34-longene/fs/namei.c
--- linux-2.6.34/fs/namei.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/fs/namei.c 2010-09-06 10:30:18.725856708 +0800
@@ -2130,6 +2130,9 @@
{
return sys_mkdirat(AT_FDCWD, pathname, mode);
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_mkdir);
+#endif
/*
* We try to drop the dentry early: we should have
@@ -2352,6 +2355,9 @@
{
return do_unlinkat(AT_FDCWD, pathname);
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_unlink);
+#endif
int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname)
{
@@ -2765,6 +2771,9 @@
{
return sys_renameat(AT_FDCWD, oldname, AT_FDCWD, newname);
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_rename);
+#endif
int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen, const char *link)
{
diff -urN linux-2.6.34/fs/open.c linux-2.6.34-longene/fs/open.c
--- linux-2.6.34/fs/open.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/fs/open.c 2010-09-06 10:30:36.382719078 +0800
@@ -176,6 +176,9 @@
out:
return error;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_fstatfs);
+#endif
SYSCALL_DEFINE3(fstatfs64, unsigned int, fd, size_t, sz, struct statfs64 __user *, buf)
{
@@ -225,6 +228,9 @@
mutex_unlock(&dentry->d_inode->i_mutex);
return ret;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(do_truncate);
+#endif
static long do_sys_truncate(const char __user *pathname, loff_t length)
{
@@ -348,6 +354,9 @@
asmlinkage_protect(2, ret, fd, length);
return ret;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_ftruncate);
+#endif
/* LFS versions of truncate are only needed on 32 bit machines */
#if BITS_PER_LONG == 32
@@ -544,6 +553,9 @@
out:
return error;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_chdir);
+#endif
SYSCALL_DEFINE1(fchdir, unsigned int, fd)
{
@@ -1075,6 +1087,9 @@
asmlinkage_protect(3, ret, filename, flags, mode);
return ret;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_open);
+#endif
SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags,
int, mode)
diff -urN linux-2.6.34/fs/read_write.c linux-2.6.34-longene/fs/read_write.c
--- linux-2.6.34/fs/read_write.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/fs/read_write.c 2010-09-06 10:30:21.034008241 +0800
@@ -387,6 +387,9 @@
return ret;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_read);
+#endif
SYSCALL_DEFINE3(write, unsigned int, fd, const char __user *, buf,
size_t, count)
@@ -405,6 +408,9 @@
return ret;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_write);
+#endif
SYSCALL_DEFINE(pread64)(unsigned int fd, char __user *buf,
size_t count, loff_t pos)
@@ -426,6 +432,10 @@
return ret;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_pread64);
+#endif
+
#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
asmlinkage long SyS_pread64(long fd, long buf, long count, loff_t pos)
{
@@ -455,6 +465,10 @@
return ret;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_pwrite64);
+#endif
+
#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
asmlinkage long SyS_pwrite64(long fd, long buf, long count, loff_t pos)
{
diff -urN linux-2.6.34/fs/select.c linux-2.6.34-longene/fs/select.c
--- linux-2.6.34/fs/select.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/fs/select.c 2010-09-06 10:30:20.126531430 +0800
@@ -945,6 +945,9 @@
}
return ret;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_poll);
+#endif
#ifdef HAVE_SET_RESTORE_SIGMASK
SYSCALL_DEFINE5(ppoll, struct pollfd __user *, ufds, unsigned int, nfds,
diff -urN linux-2.6.34/fs/stat.c linux-2.6.34-longene/fs/stat.c
--- linux-2.6.34/fs/stat.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/fs/stat.c 2010-09-06 10:30:20.765861433 +0800
@@ -243,6 +243,9 @@
return error;
return cp_new_stat(&stat, statbuf);
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_newstat);
+#endif
SYSCALL_DEFINE2(newlstat, char __user *, filename, struct stat __user *, statbuf)
{
@@ -255,6 +258,9 @@
return cp_new_stat(&stat, statbuf);
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_newlstat);
+#endif
#if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT)
SYSCALL_DEFINE4(newfstatat, int, dfd, char __user *, filename,
@@ -280,6 +286,9 @@
return error;
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_newfstat);
+#endif
SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
char __user *, buf, int, bufsiz)
@@ -313,6 +322,9 @@
{
return sys_readlinkat(AT_FDCWD, path, buf, bufsiz);
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_readlink);
+#endif
/* ---------- LFS-64 ----------- */
diff -urN linux-2.6.34/fs/sync.c linux-2.6.34-longene/fs/sync.c
--- linux-2.6.34/fs/sync.c 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/fs/sync.c 2010-09-06 10:30:22.301861412 +0800
@@ -281,6 +281,9 @@
{
return do_fsync(fd, 0);
}
+#ifdef CONFIG_UNIFIED_KERNEL
+EXPORT_SYMBOL(sys_fsync);
+#endif
SYSCALL_DEFINE1(fdatasync, unsigned int, fd)
{
diff -urN linux-2.6.34/include/linux/init_task.h linux-2.6.34-longene/include/linux/init_task.h
--- linux-2.6.34/include/linux/init_task.h 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/include/linux/init_task.h 2010-09-06 10:26:13.165530790 +0800
@@ -107,6 +107,7 @@
* INIT_TASK is used to set up the first task table, touch at
* your own risk!. Base=0, limit=0x1fffff (=2MB)
*/
+#ifndef CONFIG_UNIFIED_KERNEL
#define INIT_TASK(tsk) \
{ \
.state = 0, \
@@ -173,6 +174,75 @@
INIT_TRACE_RECURSION \
INIT_TASK_RCU_PREEMPT(tsk) \
}
+#else
+#define INIT_TASK(tsk) \
+{ \
+ .state = 0, \
+ .stack = &init_thread_info, \
+ .usage = ATOMIC_INIT(2), \
+ .flags = PF_KTHREAD, \
+ .lock_depth = -1, \
+ .prio = MAX_PRIO-20, \
+ .static_prio = MAX_PRIO-20, \
+ .normal_prio = MAX_PRIO-20, \
+ .policy = SCHED_NORMAL, \
+ .cpus_allowed = CPU_MASK_ALL, \
+ .mm = NULL, \
+ .active_mm = &init_mm, \
+ .se = { \
+ .group_node = LIST_HEAD_INIT(tsk.se.group_node), \
+ }, \
+ .rt = { \
+ .run_list = LIST_HEAD_INIT(tsk.rt.run_list), \
+ .time_slice = HZ, \
+ .nr_cpus_allowed = NR_CPUS, \
+ }, \
+ .tasks = LIST_HEAD_INIT(tsk.tasks), \
+ .pushable_tasks = PLIST_NODE_INIT(tsk.pushable_tasks, MAX_PRIO), \
+ .ptraced = LIST_HEAD_INIT(tsk.ptraced), \
+ .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \
+ .real_parent = &tsk, \
+ .parent = &tsk, \
+ .children = LIST_HEAD_INIT(tsk.children), \
+ .sibling = LIST_HEAD_INIT(tsk.sibling), \
+ .group_leader = &tsk, \
+ .real_cred = &init_cred, \
+ .cred = &init_cred, \
+ .cred_guard_mutex = \
+ __MUTEX_INITIALIZER(tsk.cred_guard_mutex), \
+ .comm = "swapper", \
+ .thread = INIT_THREAD, \
+ .fs = &init_fs, \
+ .files = &init_files, \
+ .signal = &init_signals, \
+ .sighand = &init_sighand, \
+ .nsproxy = &init_nsproxy, \
+ .pending = { \
+ .list = LIST_HEAD_INIT(tsk.pending.list), \
+ .signal = {{0}}}, \
+ .blocked = {{0}}, \
+ .alloc_lock = __RW_LOCK_UNLOCKED(tsk.alloc_lock), \
+ .journal_info = NULL, \
+ .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
+ .fs_excl = ATOMIC_INIT(0), \
+ .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \
+ .timer_slack_ns = 50000, /* 50 usec default slack */ \
+ .pids = { \
+ [PIDTYPE_PID] = INIT_PID_LINK(PIDTYPE_PID), \
+ [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \
+ [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \
+ }, \
+ .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \
+ INIT_IDS \
+ INIT_PERF_EVENTS(tsk) \
+ INIT_TRACE_IRQFLAGS \
+ INIT_LOCKDEP \
+ INIT_FTRACE_GRAPH \
+ INIT_TRACE_RECURSION \
+ INIT_TASK_RCU_PREEMPT(tsk) \
+ .ethread = NULL \
+}
+#endif
#define INIT_CPU_TIMERS(cpu_timers) \
diff -urN linux-2.6.34/include/linux/sched.h linux-2.6.34-longene/include/linux/sched.h
--- linux-2.6.34/include/linux/sched.h 2010-05-17 05:17:36.000000000 +0800
+++ linux-2.6.34-longene/include/linux/sched.h 2010-09-06 10:26:13.433928447 +0800
@@ -108,6 +108,11 @@
*/
#define CLONE_KERNEL (CLONE_FS | CLONE_FILES | CLONE_SIGHAND)
+#ifdef CONFIG_UNIFIED_KERNEL
+#define CREATE_PROCESS 1
+#define CREATE_THREAD 2
+#endif
+
/*
* These are the constant used to fake the fixed-point load-average
* counting. Some notes:
@@ -1357,7 +1362,11 @@
u32 self_exec_id;
/* Protection of (de-)allocation: mm, files, fs, tty, keyrings, mems_allowed,
* mempolicy */
+#ifndef CONFIG_UNIFIED_KERNEL
spinlock_t alloc_lock;
+#else
+ rwlock_t alloc_lock;
+#endif
#ifdef CONFIG_GENERIC_HARDIRQS
/* IRQ handler threads */
@@ -1505,6 +1514,9 @@
unsigned long memsw_bytes; /* uncharged mem+swap usage */
} memcg_batch;
#endif
+#ifdef CONFIG_UNIFIED_KERNEL
+ struct ethread *ethread;
+#endif
};