| * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) |
| void remap_data(void *segment_start, void *segment_end, int w) |
| prot |= PROT_READ | PROT_EXEC; |
| size = (unsigned long) segment_end - |
| (unsigned long) segment_start; |
| data = create_mem_file(size); |
| addr = mmap(NULL, size, PROT_WRITE | PROT_READ, MAP_SHARED, data, 0); |
| perror("mapping new data segment"); |
| memcpy(addr, segment_start, size); |
| if(switcheroo(data, prot, addr, segment_start, size) < 0){ |
| printf("switcheroo failed\n"); |
| * Overrides for Emacs so that we follow Linus's tabbing style. |
| * Emacs will notice this stuff at the end of the file and automatically |
| * adjust the settings for this buffer only. This must remain at the end |
| * --------------------------------------------------------------------------- |