Similarily, pgoff << PAGE_SHIFT would need pgoff to be unsigned to fit,
but off_t is signed.
The reason for this shift was to truncate the offset argument to be
aligned to page boundaries, do that instead
Change-Id: I36c3de34b1834fdb0503942a6f3212e94986effd
Heavily inspired off linux kernel's dynamic debug:
* add a /sys/kernel/debug/dynamic_debug/control file
(accessible from linux side in /sys/class/mcos/mcos0/sys/kernel/debug/dynamic_debug/control)
* read from file to list debug statements (currently limited to 4k in size)
* write to file with '[file foo ][func bar ][line [x][-[y]]] [+-]p' to change values
Side effects:
* reindented all linker scripts, there is a new __verbose section
* added string function strpbrk
Change-Id: I36d7707274dcc3ecaf200075a31a2f0f76021059
The standard UNIX tool to get processes information, need to have the
process id inside /proc/<PID>/status.
Using ps without PID in /proc/<PID>/status gives :
PID TTY TIME CMD
2551 pts/0 00:00:00 bash
0 pts/0 00:00:00 exe
0 pts/0 00:00:00 exe
With this patch:
PID TTY TIME CMD
2551 pts/0 00:00:00 bash
11966 pts/0 00:00:00 exe
12619 pts/0 00:00:00 exe
Change-Id: Ic9d255cbef4d49e49bdaedcfc8e3545d9c144325
Some are important, e.g. the seemingly harmless braces around if with dprintf,
since that dprintf is defined as empty, will screw things up and grab the next
line
Change-Id: Ie5e1cf813178ad708ff42ae5e477fbc96034471c
search_free_space changed since this was implemented and the code is
no longer compatible
Looking at it again, the function is not used anywhere other than syscall.c
and the second function does not seem to fix anything specific so this
just removes the untested side.
Change-Id: If28d35ec4da083a40dc6936fcb21f05fb64e378a
Fujitsu: POSTK_DEBUG_ARCH_DEP_27
Surplus refs on the linux side will not change anything, so spare
ourselves a message.
The final message will free all refs at once when the object is
destroyed.
Change-Id: Ie086b9dda663729962037c67e8233370509234a5
GCC optimizes big switches with sse so we could clobber users floating
point registers when they would do a syscall
Reproducer:
```
#include <stdio.h>
#include <stdlib.h>
union num {
float f;
unsigned long long i;
};
#define WORKSIZE (1024 * 1024 * 32)
int main(int argc, char **argv) {
char *work = malloc(WORKSIZE);
char *fromaddr;
char sink;
union num r;
unsigned long long int offset;
r.f = drand48();
printf("r: %llx\n", (long long)r.i);
offset = (long long int)(r.f * (double)WORKSIZE);
fromaddr = work + offset;
printf("%e %llx %llx\n", r.f, offset, fromaddr);
sink = *fromaddr;
return 0;
}
```
Change-Id: I7bb0883ec8ef2f245ab98064e308025422afc115
Behave in the same way as Linux which returns old_address when
old_size == new_size && !MREMAP_FIXED.
Refs: #1112
Change-Id: Ice1421a8a77f962d087de8475aa2cd40c59be5f7
(1) Check if rlim's address is valid
(2) Check if soft-limit does not exceed hard-limit
Fujitsu: POSTK_DEBUG_TEMP_FIX_3
Refs: #1050
Change-Id: I5bf1008ce172f9dff64ec89b1f97614926abaf13
(1) Check if size is large enough
(2) Check if size is positive
Fujitsu: POSTK_DEBUG_TEMP_FIX_5
Refs: #1121
Change-Id: I3e41720c89ef89294820f7f4fa8df1a69a7011b0
While we are here, also optimize code a bit: perf_desc does not need
to be allocated for every cpu; and fix coding style.
Change-Id: Iad19fed08205d38594fd3f1b7ddf2b19a9cf0d9d
Many ikc messages expecting a reply use wait_event_interruptible
incorrectly, freeing memory that could still be used on the other side.
This commit implements a generic ikc send and wait helper that helps
with memory management and ownership properly:
- if the message succeeds and a reply comes back normally, the memory
is freed by the caller as usual
- if the wait fails (signal before the reply comes or timeout) then the
memory is set as owner by ikc and will be free when the reply comes back
later
- if the reply never comes, the memory is freed at shutdown when
destroying ikc channels
Refs: #1076
Change-Id: I7f348d9029a6ad56ba9a50c836105ec39fa14943
This fixes crashes _without_ oversubscribing with a process doing
fork() execve() / wait() in a loop
Issue: #1132
Change-Id: I98531f4643ad6b6a8f750a1a3f05b9ff3ebfd50f