Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309146
b: refs/heads/master
c: f156ffc
h: refs/heads/master
v: v3
  • Loading branch information
Jarkko Sakkinen authored and H. Peter Anvin committed May 8, 2012
1 parent 91f99cf commit c1a81ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c9b77ccb52a5c77233b0e557b7d4417b00ef4012
refs/heads/master: f156ffc439951b63cfa9f4d999a8d54267f13282
16 changes: 15 additions & 1 deletion trunk/arch/x86/kernel/realmode.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,21 @@ static int __init set_real_mode_permissions(void)
PAGE_ALIGN(real_mode_header.end) -
__pa(real_mode_base);

set_memory_x((unsigned long) real_mode_base, all_size >> PAGE_SHIFT);
size_t ro_size =
PAGE_ALIGN(real_mode_header.ro_end) -
__pa(real_mode_base);

size_t text_size =
PAGE_ALIGN(real_mode_header.ro_end) -
real_mode_header.text_start;

unsigned long text_start =
(unsigned long) __va(real_mode_header.text_start);

set_memory_nx((unsigned long) real_mode_base, all_size >> PAGE_SHIFT);
set_memory_ro((unsigned long) real_mode_base, ro_size >> PAGE_SHIFT);
set_memory_x((unsigned long) text_start, text_size >> PAGE_SHIFT);

return 0;
}

Expand Down

0 comments on commit c1a81ed

Please sign in to comment.