00001
00002
00003
00004
00005
00006 #include <linux/config.h>
00007 #include<linux/linkage.h>
00008 #include<linux/sched.h>
00009
00010 #include<ssdef.h>
00011 #include<va_rangedef.h>
00012 #include <system_data_cells.h>
00013 #include<rdedef.h>
00014 #include<phddef.h>
00015 #include <queue.h>
00016 #include <mmg_routines.h>
00017 #include <exe_routines.h>
00018 #include <linux/slab.h>
00019
00020 #define DEBUG_LEAK
00021 #undef DEBUG_LEAK
00022
00023 #ifdef DEBUG_LEAK
00024 static int cnt = 0;
00025 static int table[1024*8];
00026 #endif
00027
00028 mmg_imgreset() {
00029
00030
00031
00032
00033
00034
00035
00036
00037 #if 0
00038
00039
00040 struct _va_range va;
00041 va.va_range_ps_start_va=0;
00042 va.va_range_ps_end_va=0x3f000000;
00043 exe_deltva(&va,0,0);
00044 va.va_range_ps_start_va=0x40000000;
00045 va.va_range_ps_end_va=0x60000000;
00046 exe_deltva(&va,0,0);
00047 #endif
00048
00049
00050 struct _rde * rde_head = &ctl_gl_pcb->pcb$l_phd->phd$ps_p0_va_list_flink;
00051 struct _rde * tmp = rde_head->rde_ps_va_list_flink;
00052 #if 0
00053 printk("start %x\n",&rde_head->rde_ps_va_list_flink);
00054 #endif
00055 while (tmp!=rde_head) {
00056 struct _rde * next=tmp->rde_ps_va_list_flink;
00057 #if 0
00058 printk("start %x %x %x\n",tmp,tmp->rde_pq_start_va,tmp->rde$q_region_size);
00059 #endif
00060 if (tmp->rde_pq_start_va == 0x3f000000 || tmp->rde$pq_start_va >= 0x40000000) goto cont;
00061 #if 0
00062 #ifdef __i386__
00063 #else
00064 if (tmp->rde_pq_start_va == 0x3f000000 || tmp->rde$pq_start_va >= 0x588000) goto cont;
00065 #endif
00066 #endif
00067 if (tmp->rde_pq_start_va<0x60000000) {
00068 if (tmp->rde_pq_start_va==0 && tmp->rde$q_region_size==0) {
00069 printk("can not figure out where this gets inserted; can not kfree it either\n");
00070 printk("rde %x %x %x %x %x\n",rde_head, tmp,tmp->rde_pq_start_va,tmp->rde$q_region_size);
00071 } else {
00072 #if 1
00073 struct _va_range va;
00074 va.va_range_ps_start_va = tmp->rde$pq_start_va;
00075 va.va_range_ps_end_va = tmp->rde$pq_start_va + tmp->rde$q_region_size;
00076 exe_deltva(&va,0,0);
00077 #endif
00078 remque(tmp,0);
00079 kfree(tmp);
00080 }
00081 }
00082 cont:
00083 tmp=next;
00084 }
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094 ctl_gl_pcb->pcb$l_priv=ctl$gq_procpriv;
00095
00096 ctl_gl_imghdrbf=0;
00097
00098
00099
00100
00101
00102 #ifdef DEBUG_LEAK
00103 char * mytable=&table[1024*cnt];
00104 memset(mytable, 0, 1024*4);
00105 struct page * pg = pfn_al_head[0];
00106 int i = 0;
00107 do {
00108 i = pg - &mem_map[0];
00109 set_bit(i, mytable);
00110 pg = pg->pfn_l_flink;
00111 } while (pg && i<8192);
00112
00113 if (cnt==0) goto dont;
00114 char * mytable2=&table[1024*(cnt-1)];
00115 for(i=0;i<128;i++) {
00116 if (mytable[i]!=mytable2[i]) {
00117 int j;
00118 for(j=0;j<8;j++) {
00119 char c1 = mytable[i] & (1 << j);
00120 char c2 = mytable2[i] & (1 << j);
00121 if (c1 != c2) {
00122 printk("%x000 ",i*8+j);
00123 }
00124 }
00125 }
00126 }
00127 printk("\n");
00128 dont:
00129 cnt++;
00130 #endif
00131
00132 }
00133
00134
00135
00136
00137
00138 mmg_dalcstxscn(void) {
00139
00140 }
00141