aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-07 01:20:31 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-07 01:20:31 -0400
commit88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (patch)
treeeed337ef5e9ae7d62caa84b7974a11fddc7f06e0
parent2d58cc9a437f3833d242e9d1617ec9b4044e26f3 (diff)
Linux v2.6.12-rc4v2.6.12-rc4
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f7eb55878f11..bddcb861b49b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 12 3SUBLEVEL = 12
4EXTRAVERSION =-rc3 4EXTRAVERSION =-rc4
5NAME=Woozy Numbat 5NAME=Woozy Numbat
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
osdl.org> 2005-04-16 18:20:36 -0400 Linux-2.6.12-rc2' href='/cgit/cgit.cgi/litmus-rt-imx6.git/commit/include/linux/mm.h?id=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2'>1da177e4c3f4
cdfd4325c0d8
1da177e4c3f4


895791dac694
e5b97dde514f
d00806b18315
d0217ac04ca6
b379d790197c
aba46c5027cb
895791dac694
f8af4da3b4c1
1da177e4c3f4

















b291f000393f




1da177e4c3f4




d0217ac04ca6

c2ec175c39f6
d0217ac04ca6
6bd9cd50c830







3c8bb73ace62

895791dac694
3c8bb73ace62





d0217ac04ca6
54cb8821de07
d0217ac04ca6
83c54070ee1a

54cb8821de07
d0217ac04ca6


54cb8821de07
d0217ac04ca6





83c54070ee1a
d0217ac04ca6
83c54070ee1a
d0217ac04ca6
54cb8821de07
1da177e4c3f4








d0217ac04ca6
9637a5efd4fb


c2ec175c39f6
28b2ee20c7cb





1da177e4c3f4
a6020ed75940






1da177e4c3f4
a6020ed75940










1da177e4c3f4

7b2259b3e53f

1da177e4c3f4





349aef0bc4c7

4c21e2f2441d
1da177e4c3f4
















1da177e4c3f4


da6052f7b33a
1da177e4c3f4
7c8ee9a86340

725d704ecaca
8dc04efbfb3c
7c8ee9a86340
1da177e4c3f4

7c8ee9a86340

1da177e4c3f4
7c8ee9a86340

8dc04efbfb3c
7c8ee9a86340
1da177e4c3f4
48667e7a43c1
b3bdda02aa54

48667e7a43c1
0738c4bb8f2a





9e2779fa281c

0738c4bb8f2a
9e2779fa281c


0738c4bb8f2a

8ca3ed87db06
0738c4bb8f2a
81ac3ad9061d


934831d060cc
81ac3ad9061d



9e2779fa281c
d85f33855c30

6d7779538f76
d85f33855c30



4c21e2f2441d
1da177e4c3f4
d85f33855c30
1da177e4c3f4



d85f33855c30
725d704ecaca
1da177e4c3f4


b49af68ff9fc





7835e98b2e3c








1da177e4c3f4
1d7ea7324ae7
1da177e4c3f4
8dfcc9ba27e2
8dfcc9ba27e2
1da177e4c3f4
33f2ef89f8e1
















d85f33855c30

6d7779538f76
d85f33855c30








33f2ef89f8e1
1da177e4c3f4





7e871b6c8f1f

da6052f7b33a
1da177e4c3f4
da6052f7b33a




1da177e4c3f4
da6052f7b33a








1da177e4c3f4


da6052f7b33a



1da177e4c3f4
da6052f7b33a


1da177e4c3f4
da6052f7b33a


1da177e4c3f4
da6052f7b33a


1da177e4c3f4
da6052f7b33a



1da177e4c3f4
da6052f7b33a
1da177e4c3f4

da6052f7b33a



1da177e4c3f4




1da177e4c3f4
348f8b6c4837
d41dee369bff










308c05e35e35


d41dee369bff
308c05e35e35
d41dee369bff






9223b4190fa1
d41dee369bff

308c05e35e35


d41dee369bff



07808b74e7da
d41dee369bff






89689ae7f959


d41dee369bff



348f8b6c4837





d41dee369bff


348f8b6c4837
89689ae7f959


bd8029b66069

d41dee369bff
89689ae7f959
bd8029b66069

89689ae7f959

bd8029b66069
348f8b6c4837
9223b4190fa1

348f8b6c4837

d41dee369bff


89689ae7f959
348f8b6c4837
2f1b6248682f
1da177e4c3f4
348f8b6c4837
1da177e4c3f4
1da177e4c3f4
89689ae7f959







cb2b95e1c6b5

89689ae7f959
348f8b6c4837

25ba77c141db
89fa30242fac
d5f541ed6e31




89fa30242fac

89689ae7f959
25ba77c141db
89689ae7f959
25ba77c141db
d41dee369bff
89689ae7f959
d41dee369bff
89689ae7f959






308c05e35e35
d41dee369bff



308c05e35e35
d41dee369bff
2f1b6248682f
348f8b6c4837



2f1b6248682f
348f8b6c4837



1da177e4c3f4
89689ae7f959
d41dee369bff




1da177e4c3f4
2f1b6248682f
d41dee369bff
1da177e4c3f4
348f8b6c4837

d41dee369bff
1da177e4c3f4

f6ac2354d791




652050aec936
1da177e4c3f4












































b5fab14e5d87
726b80127239
1da177e4c3f4

726b80127239


1da177e4c3f4















4c21e2f2441d
1da177e4c3f4


























1da177e4c3f4



d0217ac04ca6
83c54070ee1a
d0217ac04ca6
83c54070ee1a



d1737fdbec7f
f33ea7f404e5
83c54070ee1a

1da177e4c3f4
d1737fdbec7f
d0217ac04ca6
1c0fe6e3bda0




1da177e4c3f4



3f96b79ad962
168f5ac668f6
1da177e4c3f4

b0e15190ead0







e8edc6e03a5c
1da177e4c3f4











1da177e4c3f4


7e675137a8e1


c627f9cc046c

ee39b37b23da
1da177e4c3f4
508034a32b81
1da177e4c3f4


e6473092bd91











2165009bdf63






e6473092bd91

2165009bdf63

42b7772812d1
3bf5ee95648c
1da177e4c3f4

1da177e4c3f4

3b6748e2dd69

d87fe6607c31

28b2ee20c7cb

1da177e4c3f4






25d9e2d15286


f33ea7f404e5
750b4987b0cd
257187362123
750b4987b0cd
83f786680aec

7ee1dd3fee22
83c54070ee1a
d06063cc221f
7ee1dd3fee22


d06063cc221f
7ee1dd3fee22





f33ea7f404e5
1da177e4c3f4

1da177e4c3f4
d2bf6be8ab63
9d73777e5009
d2bf6be8ab63


f3e8fccd06d2
1da177e4c3f4
cf9a2ae8d499


1da177e4c3f4
767193253bba
1da177e4c3f4

e3a7cca1ef4c
b3c975286896
1da177e4c3f4


b6a2fea39318


1da177e4c3f4


b6a2fea39318


1da177e4c3f4
21cc199baa81
465a454f254e





8e1f936b7315
1da177e4c3f4
8e1f936b7315




1da177e4c3f4
8e1f936b7315




1da177e4c3f4
8e1f936b7315


1da177e4c3f4
8e1f936b7315






1da177e4c3f4
4e950f6f0189
d08b3851da41
b3c975286896
c9cfcddfd657
5f22df00a009






1bb3630e89cb
5f22df00a009








1bb3630e89cb
5f22df00a009

1bb3630e89cb


1da177e4c3f4



1bb3630e89cb
1da177e4c3f4

1bb3630e89cb

1da177e4c3f4



1bb3630e89cb

1da177e4c3f4
1bb3630e89cb

f7d0b926ac8c
4c21e2f2441d





349aef0bc4c7
4c21e2f2441d




f7d0b926ac8c
4c21e2f2441d





f7d0b926ac8c
4c21e2f2441d
2f569afd9ced











c74df32c724a

4c21e2f2441d
c74df32c724a










1bb3630e89cb



c74df32c724a



1bb3630e89cb


1da177e4c3f4

9109fb7b3520

c713216deebd






























cc1050bafebf

c713216deebd





c713216deebd

d52d53b8a5b2
b5bc6c0e5500
c713216deebd
c713216deebd
f2dbcfa73836















0e0b864e069c
a2f3aa025766

bc75d33f0fc1
96cb4df5ddf5
1da177e4c3f4
8feae13110d6
1da177e4c3f4


3461b0af0252
1da177e4c3f4
e7c8d5c9955a





112067f0905b

8feae13110d6
33e5d76979cf
8feae13110d6
1da177e4c3f4


















34b4e4aa3c47
1da177e4c3f4











a8fb5618dab7
1da177e4c3f4


925d1c401fa6
7906d00cd1f6


925d1c401fa6











119f657c72fc
fa5dc22f8586


1da177e4c3f4





0165ab443556

5a6fe1259506
1da177e4c3f4




















d7339071f6a8

1da177e4c3f4

d0217ac04ca6
1da177e4c3f4


1cf6e7d83bf3
1da177e4c3f4



1da177e4c3f4
1da177e4c3f4
7361f4d8ca65
cf914a7d656e













1da177e4c3f4
d30a11004e34


1da177e4c3f4

46dea3d092d2
9ab8851549fb
46dea3d092d2
9ab8851549fb
b6a2fea39318

1da177e4c3f4





















804af2cf6e7a
deceb6cd17e6
deceb6cd17e6

a145dd411eb2
e0dc0d8f4a32

423bad600443

deceb6cd17e6
6aab341e0a28
deceb6cd17e6



8e4b9a607189
58fa879e1e64
1da177e4c3f4
2f569afd9ced
aee16b3cee27



1da177e4c3f4
ab50b8ed8180
1da177e4c3f4
ab50b8ed8180
1da177e4c3f4




12d6f21eacc2








8a235efad548


12d6f21eacc2
1da177e4c3f4
9858db504cae
12d6f21eacc2


8a235efad548


1da177e4c3f4










8d65af789f3e
9d0243bca345
69e05944af39
9d0243bca345
9d0243bca345
7a9166e3b037


a62eaf151d9c
7a9166e3b037
a62eaf151d9c
045e72acf160
03252919b798
e6e5494cb23d
98f3cfc1dc7a
29c71111d055



8f6aac419bd5

29c71111d055


c2b91e2eec96
8f6aac419bd5
1cb81b143fa8


6a46079cf57a






1da177e4c3f4

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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326


                   



                        




                            
                              
                           


                 
                     
                   
                         
              





                                                                           
                                    
                          










                                   
 

                                                               


                                                      








                                                              

                                         
                  

                                            




                                               
                                              





                                                                    
                                                                             






                                                                         
                                                                                                      











                                                                                       
                                                                          
                                                                      
                                                                               


                                                                                   
                                                                                           
                                                                          
 
                                                                                
                                                                                          
                                                                              
                                                                                          
                                                                           

















                                                                            




                                                                    




                                                                  

                                                                               
                                                                               
 







                                                                              

                                                                   
                                                





                                                            
 
  
                                                                          

                                                                             
  


                                                                              
   





                                                                              
                                                                            
                                                                           
                                                           
                                           
  








                                                                         
                                                                       


                                                                           
                                                                              





                                                                              
                  






                                                                              
                                                                             










                                                                              

                                                                   

                                                                          





                  

                                                               
 
















                                                                        


   
                                                                               
   

                                                      
                                                   
                                                  
 

  

                                                                            
   

                                                         
                                                  
 
 
                                        

                                               
 





                                                                        

                                                
                 


                                                           

                 
      
 


                                                    
                                                          



                 
 

                                                           
                                     



                                        
                                               
 
                                                         



                                              
                                   
                                                   


                                  





                                                           








                                                                      
                                 
                                             
 
                                                       
 
  
















                                                                           

                                                   
                            








                                                                             
  





                                                                          

                                                                         
                                                         
  




                                                                            
  








                                                                             


                                                                   



                                                                             
  


                                                                               
  


                                                                               
  


                                                                             
  



                                                                              
  
                                             

                                                                     



                                                                             




                                                              
   
 










                                                          


                                                                             
   
                                                                   






                                              
                                                                          

                                           


                                                        



                                                             
                                                                            






                                                                            


                                          



                           





                                                                  


                                                                        
 


                                                                           

                                                                             
     
                                                           

                                                                          

      
                                                                    
 

                                                                            

      


                                                             
                                                           
 
                                                            
 
                                                           
 
 







                                                                      

                                                 
                                                             

 
                                                
 




                          

 
                             
                                          
     
                                                
 
                                                           
 






                                                                             
                                                                   



                                                                 
      
 
                                                                        



                                                            
 



                                                                       
 
 




                                                                             
 
                                                                         
                                              
 

                                  
                                                       

 




                                                          
                                                                   












































                                                                       
                                  
                  

                                          


                                                                 















                                                                          
                                          


























                                                             



                                                               
 
                                                                        
 



                                                                     
                                                               
 

                                                                                
 
                                                                            
 




                                                                      



                                                                 
                                                                      
                                                                                  

                                              







                                                                  
                              











                                                                                  


                                                                               


                                                                           

                                                                   
                                                                               
                                                          
                                                 


                                                                           











                                                                      






                                                                                  

  

                                                          
                                                               
                                                                               

                                                                 

                                                                             

                                                                 

                                                                                

                                                                       






                                                                            


                                                                            
 
                                                                          
                                                                                
 

                                             
                 
                                                                            
                                                                   


                                                                          
                                           





                                                   
 

                                                                                                         
 
                                                                 
                                                                                


                                                                           
                                               
 


                                                                       
                                                  
                                                     

                                                             
                                                                            
                                      


                                               


                                                                       


                                                                            


                                                                             
 
  





                                                                       
                                                                   
  




                                                                      
  




                                                                       
   


                                                      
 






                                                                     
 
                                                      
 
                                                                                         
 






                                                                      
                                                                         








                                                                      
                                                                         

      


                                                                         



                                                                       
                                                           

                                                                                       

                                                                           



                                                                                       

                                                                           
 

                                                  
                     





                                                                        
                                              




                                                                                
                                





                                                                        
                              
 











                                                       

                                                         
                                                         










                                                         



                                                                             



                                                                             


                                                                                

                                                       

                                                                          






























                                                                              

                                                                          





                                                                          

                                                                           
                                                               
                                                                             
                                                               
                                           















                                                           
                                                           

                                                                    
                                        
                                                             
                           
                                   


                                                          
                         
 





                                                 

                                               
             
                                          
 


















                                                                            
                                                                                   











                                                                           
                                                     


                                                                
 


                                                    











                                                                         
                                                                     


                                                                             





                                                                                                                  

                                                                       
                                                    




















                                                                                       

                                                                   

                                                             
                                                                     


                                                
                                             



                                                                            
 
                                                                                
                                                                  













                                                              
                                                   


                                                      

                        
                                                                           
                  
                                                                             
      

                                                             





















                                                                                                                                    
                                                  
                                                                               

                                                                         
                                                                               

                                                                 

                                                                   
 
                                                                        



                                                           
                                                                            
                                                                              
 
                                                                        



                                                                            
                     
                                                                             
     
                                                        




                                                                           








                                                                          


                                                   
     
                  
                                                                


                                               


                                                                          










                                                                            
                                                       
                                                                           
                                                                
                                                 
 


                            
                              
      
 
                                                       
                                                     
 
                                                                  



                                                                      

                                                                


                                                                               
                                       
 


                                                                           






                                                                    

                        
#ifndef _LINUX_MM_H
#define _LINUX_MM_H

#include <linux/errno.h>

#ifdef __KERNEL__

#include <linux/gfp.h>
#include <linux/list.h>
#include <linux/mmzone.h>
#include <linux/rbtree.h>
#include <linux/prio_tree.h>
#include <linux/debug_locks.h>
#include <linux/mm_types.h>

struct mempolicy;
struct anon_vma;
struct file_ra_state;
struct user_struct;
struct writeback_control;
struct rlimit;

#ifndef CONFIG_DISCONTIGMEM          /* Don't use mapnrs, do it properly */
extern unsigned long max_mapnr;
#endif

extern unsigned long num_physpages;
extern unsigned long totalram_pages;
extern void * high_memory;
extern int page_cluster;

#ifdef CONFIG_SYSCTL
extern int sysctl_legacy_va_layout;
#else
#define sysctl_legacy_va_layout 0
#endif

#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/processor.h>

#define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))

/* to align the pointer to the (next) page boundary */
#define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE)

/*
 * Linux kernel virtual memory manager primitives.
 * The idea being to have a "virtual" mm in the same way
 * we have a virtual fs - giving a cleaner interface to the
 * mm details, and allowing different kinds of memory mappings
 * (from shared memory to executable loading to arbitrary
 * mmap() functions).
 */

extern struct kmem_cache *vm_area_cachep;

#ifndef CONFIG_MMU
extern struct rb_root nommu_region_tree;
extern struct rw_semaphore nommu_region_sem;

extern unsigned int kobjsize(const void *objp);
#endif

/*
 * vm_flags in vm_area_struct, see mm_types.h.
 */
#define VM_READ		0x00000001	/* currently active flags */
#define VM_WRITE	0x00000002
#define VM_EXEC		0x00000004
#define VM_SHARED	0x00000008

/* mprotect() hardcodes VM_MAYREAD >> 4 == VM_READ, and so for r/w/x bits. */
#define VM_MAYREAD	0x00000010	/* limits for mprotect() etc */
#define VM_MAYWRITE	0x00000020
#define VM_MAYEXEC	0x00000040
#define VM_MAYSHARE	0x00000080

#define VM_GROWSDOWN	0x00000100	/* general info on the segment */
#define VM_GROWSUP	0x00000200
#define VM_PFNMAP	0x00000400	/* Page-ranges managed without "struct page", just pure PFN */
#define VM_DENYWRITE	0x00000800	/* ETXTBSY on write attempts.. */

#define VM_EXECUTABLE	0x00001000
#define VM_LOCKED	0x00002000
#define VM_IO           0x00004000	/* Memory mapped I/O or similar */

					/* Used by sys_madvise() */
#define VM_SEQ_READ	0x00008000	/* App will access data sequentially */
#define VM_RAND_READ	0x00010000	/* App will not benefit from clustered reads */

#define VM_DONTCOPY	0x00020000      /* Do not copy this vma on fork */
#define VM_DONTEXPAND	0x00040000	/* Cannot expand with mremap() */
#define VM_RESERVED	0x00080000	/* Count as reserved_vm like IO */
#define VM_ACCOUNT	0x00100000	/* Is a VM accounted object */
#define VM_NORESERVE	0x00200000	/* should the VM suppress accounting */
#define VM_HUGETLB	0x00400000	/* Huge TLB Page VM */
#define VM_NONLINEAR	0x00800000	/* Is non-linear (remap_file_pages) */
#define VM_MAPPED_COPY	0x01000000	/* T if mapped copy of data (nommu mmap) */
#define VM_INSERTPAGE	0x02000000	/* The vma has had "vm_insert_page()" done on it */
#define VM_ALWAYSDUMP	0x04000000	/* Always include in core dumps */

#define VM_CAN_NONLINEAR 0x08000000	/* Has ->fault & does nonlinear pages */
#define VM_MIXEDMAP	0x10000000	/* Can contain "struct page" and pure PFN pages */
#define VM_SAO		0x20000000	/* Strong Access Ordering (powerpc) */
#define VM_PFN_AT_MMAP	0x40000000	/* PFNMAP vma that is fully mapped at mmap time */
#define VM_MERGEABLE	0x80000000	/* KSM may merge identical pages */

#ifndef VM_STACK_DEFAULT_FLAGS		/* arch can override this */
#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
#endif

#ifdef CONFIG_STACK_GROWSUP
#define VM_STACK_FLAGS	(VM_GROWSUP | VM_STACK_DEFAULT_FLAGS | VM_ACCOUNT)
#else
#define VM_STACK_FLAGS	(VM_GROWSDOWN | VM_STACK_DEFAULT_FLAGS | VM_ACCOUNT)
#endif

#define VM_READHINTMASK			(VM_SEQ_READ | VM_RAND_READ)
#define VM_ClearReadHint(v)		(v)->vm_flags &= ~VM_READHINTMASK
#define VM_NormalReadHint(v)		(!((v)->vm_flags & VM_READHINTMASK))
#define VM_SequentialReadHint(v)	((v)->vm_flags & VM_SEQ_READ)
#define VM_RandomReadHint(v)		((v)->vm_flags & VM_RAND_READ)

/*
 * special vmas that are non-mergable, non-mlock()able
 */
#define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_RESERVED | VM_PFNMAP)

/*
 * mapping from the currently active vm_flags protection bits (the
 * low four bits) to a page protection mask..
 */
extern pgprot_t protection_map[16];

#define FAULT_FLAG_WRITE	0x01	/* Fault was a write access */
#define FAULT_FLAG_NONLINEAR	0x02	/* Fault was via a nonlinear mapping */
#define FAULT_FLAG_MKWRITE	0x04	/* Fault was mkwrite of existing pte */

/*
 * This interface is used by x86 PAT code to identify a pfn mapping that is
 * linear over entire vma. This is to optimize PAT code that deals with
 * marking the physical region with a particular prot. This is not for generic
 * mm use. Note also that this check will not work if the pfn mapping is
 * linear for a vma starting at physical address 0. In which case PAT code
 * falls back to slow path of reserving physical range page by page.
 */
static inline int is_linear_pfn_mapping(struct vm_area_struct *vma)
{
	return (vma->vm_flags & VM_PFN_AT_MMAP);
}

static inline int is_pfn_mapping(struct vm_area_struct *vma)
{
	return (vma->vm_flags & VM_PFNMAP);
}

/*
 * vm_fault is filled by the the pagefault handler and passed to the vma's
 * ->fault function. The vma's ->fault is responsible for returning a bitmask
 * of VM_FAULT_xxx flags that give details about how the fault was handled.
 *
 * pgoff should be used in favour of virtual_address, if possible. If pgoff
 * is used, one may set VM_CAN_NONLINEAR in the vma->vm_flags to get nonlinear
 * mapping support.
 */
struct vm_fault {
	unsigned int flags;		/* FAULT_FLAG_xxx flags */
	pgoff_t pgoff;			/* Logical page offset based on vma */
	void __user *virtual_address;	/* Faulting virtual address */

	struct page *page;		/* ->fault handlers should return a
					 * page here, unless VM_FAULT_NOPAGE
					 * is set (which is also implied by
					 * VM_FAULT_ERROR).
					 */
};

/*
 * These are the virtual MM functions - opening of an area, closing and
 * unmapping it (needed to keep files on disk up-to-date etc), pointer
 * to the functions called when a no-page or a wp-page exception occurs. 
 */
struct vm_operations_struct {
	void (*open)(struct vm_area_struct * area);
	void (*close)(struct vm_area_struct * area);
	int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf);

	/* notification that a previously read-only page is about to become
	 * writable, if an error is returned it will cause a SIGBUS */
	int (*page_mkwrite)(struct vm_area_struct *vma, struct vm_fault *vmf);

	/* called by access_process_vm when get_user_pages() fails, typically
	 * for use by special VMAs that can switch between memory and hardware
	 */
	int (*access)(struct vm_area_struct *vma, unsigned long addr,
		      void *buf, int len, int write);
#ifdef CONFIG_NUMA
	/*
	 * set_policy() op must add a reference to any non-NULL @new mempolicy
	 * to hold the policy upon return.  Caller should pass NULL @new to
	 * remove a policy and fall back to surrounding context--i.e. do not
	 * install a MPOL_DEFAULT policy, nor the task or system default
	 * mempolicy.
	 */
	int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new);

	/*
	 * get_policy() op must add reference [mpol_get()] to any policy at
	 * (vma,addr) marked as MPOL_SHARED.  The shared policy infrastructure
	 * in mm/mempolicy.c will do this automatically.
	 * get_policy() must NOT add a ref if the policy at (vma,addr) is not
	 * marked as MPOL_SHARED. vma policies are protected by the mmap_sem.
	 * If no [shared/vma] mempolicy exists at the addr, get_policy() op
	 * must return NULL--i.e., do not "fallback" to task or system default
	 * policy.
	 */
	struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
					unsigned long addr);
	int (*migrate)(struct vm_area_struct *vma, const nodemask_t *from,
		const nodemask_t *to, unsigned long flags);
#endif
};

struct mmu_gather;
struct inode;

#define page_private(page)		((page)->private)
#define set_page_private(page, v)	((page)->private = (v))

/*
 * FIXME: take this include out, include page-flags.h in
 * files which need it (119 of them)
 */
#include <linux/page-flags.h>

/*
 * Methods to modify the page usage count.
 *
 * What counts for a page usage:
 * - cache mapping   (page->mapping)
 * - private data    (page->private)
 * - page mapped in a task's page tables, each mapping
 *   is counted separately
 *
 * Also, many kernel routines increase the page count before a critical
 * routine so they can be sure the page doesn't go away from under them.
 */

/*
 * Drop a ref, return true if the refcount fell to zero (the page has no users)
 */
static inline int put_page_testzero(struct page *page)
{
	VM_BUG_ON(atomic_read(&page->_count) == 0);
	return atomic_dec_and_test(&page->_count);
}

/*
 * Try to grab a ref unless the page has a refcount of zero, return false if
 * that is the case.
 */
static inline int get_page_unless_zero(struct page *page)
{
	return atomic_inc_not_zero(&page->_count);
}

/* Support for virtually mapped pages */
struct page *vmalloc_to_page(const void *addr);
unsigned long vmalloc_to_pfn(const void *addr);

/*
 * Determine if an address is within the vmalloc range
 *
 * On nommu, vmalloc/vfree wrap through kmalloc/kfree directly, so there
 * is no special casing required.
 */
static inline int is_vmalloc_addr(const void *x)
{
#ifdef CONFIG_MMU
	unsigned long addr = (unsigned long)x;

	return addr >= VMALLOC_START && addr < VMALLOC_END;
#else
	return 0;
#endif
}
#ifdef CONFIG_MMU
extern int is_vmalloc_or_module_addr(const void *x);
#else
static inline int is_vmalloc_or_module_addr(const void *x)
{
	return 0;
}
#endif

static inline struct page *compound_head(struct page *page)
{
	if (unlikely(PageTail(page)))
		return page->first_page;
	return page;
}

static inline int page_count(struct page *page)
{
	return atomic_read(&compound_head(page)->_count);
}

static inline void get_page(struct page *page)
{
	page = compound_head(page);
	VM_BUG_ON(atomic_read(&page->_count) == 0);
	atomic_inc(&page->_count);
}

static inline struct page *virt_to_head_page(const void *x)
{
	struct page *page = virt_to_page(x);
	return compound_head(page);
}

/*
 * Setup the page count before being freed into the page allocator for
 * the first time (boot or memory hotplug)
 */
static inline void init_page_count(struct page *page)
{
	atomic_set(&page->_count, 1);
}

void put_page(struct page *page);
void put_pages_list(struct list_head *pages);

void split_page(struct page *page, unsigned int order);

/*
 * Compound pages have a destructor function.  Provide a
 * prototype for that function and accessor functions.
 * These are _only_ valid on the head of a PG_compound page.
 */
typedef void compound_page_dtor(struct page *);

static inline void set_compound_page_dtor(struct page *page,
						compound_page_dtor *dtor)
{
	page[1].lru.next = (void *)dtor;
}

static inline compound_page_dtor *get_compound_page_dtor(struct page *page)
{
	return (compound_page_dtor *)page[1].lru.next;
}

static inline int compound_order(struct page *page)
{
	if (!PageHead(page))
		return 0;
	return (unsigned long)page[1].lru.prev;
}

static inline void set_compound_order(struct page *page, unsigned long order)
{
	page[1].lru.prev = (void *)order;
}

/*
 * Multiple processes may "see" the same page. E.g. for untouched
 * mappings of /dev/null, all processes see the same page full of
 * zeroes, and text pages of executables and shared libraries have
 * only one copy in memory, at most, normally.
 *
 * For the non-reserved pages, page_count(page) denotes a reference count.
 *   page_count() == 0 means the page is free. page->lru is then used for
 *   freelist management in the buddy allocator.
 *   page_count() > 0  means the page has been allocated.
 *
 * Pages are allocated by the slab allocator in order to provide memory
 * to kmalloc and kmem_cache_alloc. In this case, the management of the
 * page, and the fields in 'struct page' are the responsibility of mm/slab.c
 * unless a particular usage is carefully commented. (the responsibility of
 * freeing the kmalloc memory is the caller's, of course).
 *
 * A page may be used by anyone else who does a __get_free_page().
 * In this case, page_count still tracks the references, and should only
 * be used through the normal accessor functions. The top bits of page->flags
 * and page->virtual store page management information, but all other fields
 * are unused and could be used privately, carefully. The management of this
 * page is the responsibility of the one who allocated it, and those who have
 * subsequently been given references to it.
 *
 * The other pages (we may call them "pagecache pages") are completely
 * managed by the Linux memory manager: I/O, buffers, swapping etc.
 * The following discussion applies only to them.
 *