Changeset 93266c5 in git for Singular/cntrlc.cc
- Timestamp:
- Dec 7, 1998, 9:48:27 AM (25 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- a8213b0b8b3ace6b1fef40b50aac8147ab7b4381
- Parents:
- 7f0e6fea6bba489a550307279a2809c1dd27d593
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/cntrlc.cc
r7f0e6f r93266c5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: cntrlc.cc,v 1.2 0 1998-09-24 09:59:36Singular Exp $ */4 /* $Id: cntrlc.cc,v 1.21 1998-12-07 08:48:23 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - interupt handling … … 132 132 133 133 #ifdef PAGE_TEST 134 #ifdef PAGE_COUNT135 static int page_segv_count=0;136 #endif137 134 void sig11_handler(int sig, sigcontext s) 138 135 { 139 #ifdef PAGE_COUNT 140 page_segv_count++; 141 #endif 142 long base =s.cr2&(~4095); 143 int i=page_tab_ind-1; 136 unsigned long base =(unsigned long)(s.cr2&(~4095)); 137 int i; 138 i=mmPage_tab_ind-1; 139 while (mmPage_tab[i]!=base) i--; 140 mmUse_tab[i]='1'; 141 mmPage_tab_acc++; 142 mmPage_AllowAccess((void *)base); 143 signal(SIGSEGV,(si_hdl_typ)sig11_handler); 144 } 145 146 void sigalarm_handler(int sig, sigcontext s) 147 { 148 int i=mmPage_tab_ind-1; 149 mmWriteStat(); 144 150 for(;i>=0;i--) 145 151 { 146 if (page_tab[i]==base) { use_tab[i]='X'; break; } 147 } 148 Page_AllowAccess((void *)base, 4096); 149 signal(SIGSEGV,(si_hdl_typ)sig11_handler); 150 } 151 152 void sigalarm_handler(int sig, sigcontext s) 153 { 154 int i=page_tab_ind-1; 155 #ifdef PAGE_COUNT 156 write(2,use_tab,page_segv_count); 157 page_segv_count=0; 158 #else 159 write(2,use_tab,page_tab_ind); 160 #endif 161 write(2,"<\n",2); 162 for(;i>=0;i--) 163 { 164 Page_DenyAccess((void *)page_tab[i],4096); 165 #ifndef PAGE_COUNT 166 use_tab[i]=' '; 167 #endif 152 mmPage_DenyAccess((void *)mmPage_tab[i]); 168 153 } 169 154 struct itimerval t,o; … … 176 161 signal(SIGVTALRM,(si_hdl_typ)sigalarm_handler); 177 162 } 178 179 163 #endif 180 164 … … 187 171 #ifdef PAGE_TEST 188 172 signal(SIGSEGV,(si_hdl_typ)sig11_handler); 189 page_tab_ind=0;190 173 struct itimerval t,o; 191 174 memset(&t,0,sizeof(t));
Note: See TracChangeset
for help on using the changeset viewer.