diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-04-12 22:30:30 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-04-12 22:30:30 +0200 |
commit | 461c2b68a16ab3314202ec7796fe7eb8a7731f2d (patch) | |
tree | d2fd155f08d5dff13b6b600db5151da233842347 /sys/src/9/port/segment.c | |
parent | aadbcf0a32c92b1ba4584ad9487854ede43932ca (diff) |
kernel: fixed segment support (for fpga experiments)
fixed segments are continuous in physical memory but
allocated in user pages. unlike shared segments, they
are not allocated on demand but the pages are allocated
on creation time (devsegment). fixed segments are
never swapped out, segfreed or resized and can only be
destroyed as a whole.
the physical base address can be discovered by userspace
reading the ctl file in devsegment.
Diffstat (limited to 'sys/src/9/port/segment.c')
-rw-r--r-- | sys/src/9/port/segment.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/src/9/port/segment.c b/sys/src/9/port/segment.c index f9143f314..7adc005ea 100644 --- a/sys/src/9/port/segment.c +++ b/sys/src/9/port/segment.c @@ -156,6 +156,7 @@ dupseg(Segment **seg, int segno, int share) case SG_TEXT: /* New segment shares pte set */ case SG_SHARED: case SG_PHYSICAL: + case SG_FIXED: goto sameseg; case SG_STACK: @@ -489,8 +490,11 @@ mfreeseg(Segment *s, uintptr start, ulong pages) if(pages == 0) return; - if((s->type&SG_TYPE) == SG_PHYSICAL) + switch(s->type&SG_TYPE){ + case SG_PHYSICAL: + case SG_FIXED: return; + } /* * we have to make sure other processors flush the |