Deleted Added
sdiff udiff text old ( 5543:3af77710f397 ) new ( 5748:f28f020f3006 )
full compact
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 93 unchanged lines hidden (view full) ---

102SyscallReturn
103getpagesizeFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
104{
105 return (int)VMPageSize;
106}
107
108
109SyscallReturn
110brkFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
111{
112 // change brk addr to first arg
113 Addr new_brk = tc->getSyscallArg(0);
114
115 // in Linux at least, brk(0) returns the current break value
116 // (note that the syscall and the glibc function have different behavior)
117 if (new_brk == 0)
118 return p->brk_point;
119
120 if (new_brk > p->brk_point) {
121 // might need to allocate some new pages
122 for (ChunkGenerator gen(p->brk_point, new_brk - p->brk_point,
123 VMPageSize); !gen.done(); gen.next()) {
124 if (!p->pTable->translate(gen.addr()))
125 p->pTable->allocate(roundDown(gen.addr(), VMPageSize),
126 VMPageSize);
127 }
128 }
129
130 p->brk_point = new_brk;
131 DPRINTF(SyscallVerbose, "Break Point changed to: %#X\n", p->brk_point);
132 return p->brk_point;
133}
134
135
136SyscallReturn
137closeFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
138{

--- 499 unchanged lines hidden ---