-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathriscv_addrenv.c
824 lines (681 loc) · 24.1 KB
/
riscv_addrenv.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
/****************************************************************************
* arch/risc-v/src/common/riscv_addrenv.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Address Environment Interfaces
*
* Low-level interfaces used in binfmt/ to instantiate tasks with address
* environments. These interfaces all operate on type arch_addrenv_t which
* is an abstract representation of a task group's address environment and
* must be defined in arch/arch.h if CONFIG_ARCH_ADDRENV is defined.
*
* up_addrenv_create - Create an address environment
* up_addrenv_destroy - Destroy an address environment.
* up_addrenv_vtext - Returns the virtual base address of the .text
* address environment
* up_addrenv_vdata - Returns the virtual base address of the .bss/.data
* address environment
* up_addrenv_heapsize - Returns the size of the initial heap allocation.
* up_addrenv_select - Instantiate an address environment
* up_addrenv_clone - Copy an address environment from one location to
* another.
*
* Higher-level interfaces used by the tasking logic. These interfaces are
* used by the functions in sched/ and all operate on the thread which whose
* group been assigned an address environment by up_addrenv_clone().
*
* up_addrenv_attach - Clone the address environment assigned to one TCB
* to another. This operation is done when a pthread
* is created that share's the same address
* environment.
* up_addrenv_detach - Release the threads reference to an address
* environment when a task/thread exits.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <errno.h>
#include <assert.h>
#include <debug.h>
#include <nuttx/addrenv.h>
#include <nuttx/arch.h>
#include <nuttx/compiler.h>
#include <nuttx/irq.h>
#include <nuttx/pgalloc.h>
#include <arch/barriers.h>
#include "addrenv.h"
#include "pgalloc.h"
#include "riscv_mmu.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Only CONFIG_BUILD_KERNEL is supported (i.e. tested) */
#ifndef CONFIG_BUILD_KERNEL
# error "This module is intended to be used with CONFIG_BUILD_KERNEL"
#endif
/* Entries per PGT */
#define ENTRIES_PER_PGT (RV_MMU_PAGE_ENTRIES)
/* Make sure the address environment virtual address boundary is valid */
static_assert((ARCH_ADDRENV_VBASE & RV_MMU_SECTION_ALIGN) == 0,
"Addrenv start address is not aligned to section boundary");
/****************************************************************************
* Public Data
****************************************************************************/
extern uintptr_t g_kernel_mappings;
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: map_spgtables
*
* Description:
* Map vaddr to the static page tables.
*
* Input Parameters:
* addrenv - Describes the address environment
*
****************************************************************************/
static void map_spgtables(arch_addrenv_t *addrenv, uintptr_t vaddr)
{
int i;
uintptr_t prev;
/* Start from L1, and connect until max level - 1 */
prev = riscv_pgvaddr(addrenv->spgtables[0]);
/* Check if the mapping already exists */
if (mmu_ln_getentry(1, prev, vaddr) != 0)
{
return;
}
/* No mapping yet, create it */
for (i = 0; i < (ARCH_SPGTS - 1); i++)
{
uintptr_t next = addrenv->spgtables[i + 1];
mmu_ln_setentry(i + 1, prev, next, vaddr, MMU_UPGT_FLAGS);
prev = riscv_pgvaddr(next);
}
}
/****************************************************************************
* Name: create_spgtables
*
* Description:
* Create the static page tables. Allocate memory for them and connect them
* together.
*
* Input Parameters:
* addrenv - Describes the address environment
*
* Returned value:
* Amount of pages created on success; a negated errno value on failure
*
****************************************************************************/
static int create_spgtables(arch_addrenv_t *addrenv)
{
int i;
uintptr_t paddr;
for (i = 0; i < ARCH_SPGTS; i++)
{
paddr = mm_pgalloc(1);
if (!paddr)
{
return -ENOMEM;
}
/* Wipe the memory and assign it */
riscv_pgwipe(paddr);
addrenv->spgtables[i] = paddr;
}
/* Flush the data cache, so the changes are committed to memory */
UP_DMB();
return i;
}
/****************************************************************************
* Name: copy_kernel_mappings
*
* Description:
* Copy kernel mappings to address environment. Expects that the user page
* table does not contain any mappings yet (as they will be wiped).
*
* Input Parameters:
* addrenv - Describes the address environment. The page tables must exist
* at this point.
*
* Returned value:
* OK on success, ERROR on failure
*
****************************************************************************/
static int copy_kernel_mappings(arch_addrenv_t *addrenv)
{
uintptr_t user_mappings = riscv_pgvaddr(addrenv->spgtables[0]);
/* Copy the L1 references */
if (user_mappings == 0)
{
return -EINVAL;
}
memcpy((void *)user_mappings, (void *)g_kernel_mappings, RV_MMU_PAGE_SIZE);
return OK;
}
/****************************************************************************
* Name: create_region
*
* Description:
* Map a single region of memory to MMU. Assumes that the static page
* tables exist. Allocates the final level page tables and commits the
* region memory to physical memory.
*
* Input Parameters:
* addrenv - Describes the address environment
* vaddr - Base virtual address for the mapping
* size - Size of the region in bytes
* mmuflags - MMU flags to use
*
* Returned value:
* Amount of pages created on success; a negated errno value on failure
*
****************************************************************************/
static int create_region(arch_addrenv_t *addrenv, uintptr_t vaddr,
size_t size, uint64_t mmuflags)
{
uintptr_t ptlast;
uintptr_t ptprev;
uintptr_t paddr;
uint32_t ptlevel;
int npages;
int nmapped;
int i;
int j;
nmapped = 0;
npages = MM_NPAGES(size);
ptprev = riscv_pgvaddr(addrenv->spgtables[ARCH_SPGTS - 1]);
ptlevel = ARCH_SPGTS;
/* Create mappings for the lower level tables */
map_spgtables(addrenv, vaddr);
/* Begin allocating memory for the page tables */
for (i = 0; i < npages; i += ENTRIES_PER_PGT)
{
/* Get the current final level entry corresponding to this vaddr */
paddr = mmu_pte_to_paddr(mmu_ln_getentry(ptlevel, ptprev, vaddr));
if (!paddr)
{
/* Nothing yet, allocate one page for final level page table */
paddr = mm_pgalloc(1);
if (!paddr)
{
return -ENOMEM;
}
/* Map the page table to the prior level */
mmu_ln_setentry(ptlevel, ptprev, paddr, vaddr, MMU_UPGT_FLAGS);
/* This is then used to map the final level */
riscv_pgwipe(paddr);
}
ptlast = riscv_pgvaddr(paddr);
/* Then allocate memory for the region data */
for (j = 0;
#ifdef CONFIG_PAGING
j < 1;
#else
j < ENTRIES_PER_PGT && nmapped < size;
#endif
j++)
{
paddr = mm_pgalloc(1);
if (!paddr)
{
return -ENOMEM;
}
/* Wipe the physical page memory */
riscv_pgwipe(paddr);
/* Then map the virtual address to the physical address */
mmu_ln_setentry(ptlevel + 1, ptlast, paddr, vaddr, mmuflags);
nmapped += MM_PGSIZE;
vaddr += MM_PGSIZE;
}
}
/* Flush the data cache, so the changes are committed to memory */
UP_DMB();
return npages;
}
/****************************************************************************
* Name: vaddr_is_shm
*
* Description:
* Check if a vaddr is part of the SHM area
*
* Input Parameters:
* vaddr - Virtual address to check
*
* Returned value:
* true if it is; false if not
*
****************************************************************************/
static inline bool vaddr_is_shm(uintptr_t vaddr)
{
#if defined (CONFIG_ARCH_SHM_VBASE) && defined(ARCH_SHM_VEND)
return vaddr >= CONFIG_ARCH_SHM_VBASE && vaddr < ARCH_SHM_VEND;
#else
UNUSED(vaddr);
return false;
#endif
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_addrenv_create
*
* Description:
* This function is called when a new task is created in order to
* instantiate an address environment for the new task group.
* up_addrenv_create() is essentially the allocator of the physical
* memory for the new task.
*
* Input Parameters:
* textsize - The size (in bytes) of the .text address environment needed
* by the task. This region may be read/execute only.
* datasize - The size (in bytes) of the .data/.bss address environment
* needed by the task. This region may be read/write only. NOTE: The
* actual size of the data region that is allocated will include a
* OS private reserved region at the beginning. The size of the
* private, reserved region is give by ARCH_DATA_RESERVE_SIZE.
* heapsize - The initial size (in bytes) of the heap address environment
* needed by the task. This region may be read/write only.
* addrenv - The location to return the representation of the task address
* environment.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize,
arch_addrenv_t *addrenv)
{
int ret;
uintptr_t resvbase;
uintptr_t resvsize;
uintptr_t textbase;
uintptr_t database;
uintptr_t heapbase;
DEBUGASSERT(addrenv);
DEBUGASSERT(MM_ISALIGNED(ARCH_ADDRENV_VBASE));
/* Make sure the address environment is wiped before doing anything */
memset(addrenv, 0, sizeof(arch_addrenv_t));
/* Create the static page tables */
ret = create_spgtables(addrenv);
if (ret < 0)
{
serr("ERROR: Failed to create static page tables\n");
goto errout;
}
/* Map the kernel memory for the user */
ret = copy_kernel_mappings(addrenv);
if (ret < 0)
{
serr("ERROR: Failed to copy kernel mappings to new environment");
goto errout;
}
/* Calculate the base addresses for convenience */
#if (CONFIG_ARCH_TEXT_VBASE != 0x0) && (CONFIG_ARCH_HEAP_VBASE != 0x0)
resvbase = CONFIG_ARCH_DATA_VBASE;
resvsize = ARCH_DATA_RESERVE_SIZE;
textbase = CONFIG_ARCH_TEXT_VBASE;
database = resvbase + MM_PGALIGNUP(resvsize);
heapbase = CONFIG_ARCH_HEAP_VBASE;
#else
resvbase = ARCH_ADDRENV_VBASE;
resvsize = ARCH_DATA_RESERVE_SIZE;
textbase = resvbase + MM_PGALIGNUP(resvsize);
database = textbase + MM_PGALIGNUP(textsize);
heapbase = database + MM_PGALIGNUP(datasize);
#endif
/* Allocate 1 extra page for heap, temporary fix for #5811 */
heapsize = heapsize + MM_PGALIGNUP(CONFIG_DEFAULT_TASK_STACKSIZE);
/* Map the reserved area */
ret = create_region(addrenv, resvbase, resvsize, MMU_UDATA_FLAGS);
if (ret < 0)
{
berr("ERROR: Failed to create reserved region: %d\n", ret);
goto errout;
}
/* Map each region in turn */
ret = create_region(addrenv, textbase, textsize, MMU_UTEXT_FLAGS);
if (ret < 0)
{
berr("ERROR: Failed to create .text region: %d\n", ret);
goto errout;
}
ret = create_region(addrenv, database, datasize, MMU_UDATA_FLAGS);
if (ret < 0)
{
berr("ERROR: Failed to create .bss/.data region: %d\n", ret);
goto errout;
}
ret = create_region(addrenv, heapbase, heapsize, MMU_UDATA_FLAGS);
if (ret < 0)
{
berr("ERROR: Failed to create heap region: %d\n", ret);
goto errout;
}
/* Save the heap base and initial size allocated. These will be needed when
* the heap data structures are initialized.
*/
addrenv->heapvbase = heapbase;
addrenv->heapsize = (size_t)ret << MM_PGSHIFT;
/* Save the text base */
addrenv->textvbase = textbase;
/* Save the data base */
addrenv->datavbase = database;
/* Provide the satp value for context switch */
addrenv->satp = mmu_satp_reg(addrenv->spgtables[0], 0);
/* When all is set and done, flush the data caches */
UP_ISB();
UP_DMB();
return OK;
errout:
up_addrenv_destroy(addrenv);
return ret;
}
/****************************************************************************
* Name: up_addrenv_destroy
*
* Description:
* This function is called when a final thread leaves the task group and
* the task group is destroyed. This function then destroys the defunct
* address environment, releasing the underlying physical memory.
*
* Input Parameters:
* addrenv - The address environment to be destroyed.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int up_addrenv_destroy(arch_addrenv_t *addrenv)
{
/* Recursively destroy it all, need to table walk */
uintptr_t *ptprev;
uintptr_t *ptlast;
uintptr_t paddr;
uintptr_t vaddr;
size_t pgsize;
int i;
int j;
DEBUGASSERT(addrenv);
/* Make sure the caches are flushed before doing this */
UP_ISB();
UP_DMB();
/* Things start from the beginning of the user virtual memory */
vaddr = ARCH_ADDRENV_VBASE;
pgsize = mmu_get_region_size(ARCH_SPGTS);
/* First destroy the allocated memory and the final level page table */
ptprev = (uintptr_t *)riscv_pgvaddr(addrenv->spgtables[ARCH_SPGTS - 1]);
if (ptprev)
{
/* walk user space only */
i = (ARCH_SPGTS < 2) ? vaddr / pgsize : 0;
for (; i < ENTRIES_PER_PGT; i++, vaddr += pgsize)
{
ptlast = (uintptr_t *)riscv_pgvaddr(mmu_pte_to_paddr(ptprev[i]));
if (ptlast)
{
if (!vaddr_is_shm(vaddr))
{
/* Free the allocated pages, but not from SHM area */
for (j = 0; j < ENTRIES_PER_PGT; j++)
{
paddr = mmu_pte_to_paddr(ptlast[j]);
if (paddr)
{
mm_pgfree(paddr, 1);
}
}
}
/* Regardless, free the page table itself */
mm_pgfree((uintptr_t)ptlast, 1);
}
}
}
/* Then destroy the static tables */
for (i = 0; i < ARCH_SPGTS; i++)
{
paddr = addrenv->spgtables[i];
if (paddr)
{
mm_pgfree(paddr, 1);
}
}
/* When all is set and done, flush the caches */
UP_ISB();
UP_DMB();
memset(addrenv, 0, sizeof(arch_addrenv_t));
return OK;
}
/****************************************************************************
* Name: up_addrenv_vtext
*
* Description:
* Return the virtual address associated with the newly create .text
* address environment. This function is used by the binary loaders in
* order get an address that can be used to initialize the new task.
*
* Input Parameters:
* addrenv - The representation of the task address environment previously
* returned by up_addrenv_create.
* vtext - The location to return the virtual address.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int up_addrenv_vtext(arch_addrenv_t *addrenv, void **vtext)
{
DEBUGASSERT(addrenv && vtext);
*vtext = (void *)addrenv->textvbase;
return OK;
}
/****************************************************************************
* Name: up_addrenv_vdata
*
* Description:
* Return the virtual address associated with the newly create .text
* address environment. This function is used by the binary loaders in
* order get an address that can be used to initialize the new task.
*
* Input Parameters:
* addrenv - The representation of the task address environment previously
* returned by up_addrenv_create.
* textsize - For some implementations, the text and data will be saved
* in the same memory region (read/write/execute) and, in this case,
* the virtual address of the data just lies at this offset into the
* common region.
* vdata - The location to return the virtual address.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int up_addrenv_vdata(arch_addrenv_t *addrenv, uintptr_t textsize,
void **vdata)
{
DEBUGASSERT(addrenv && vdata);
*vdata = (void *)addrenv->datavbase;
return OK;
}
/****************************************************************************
* Name: up_addrenv_vheap
*
* Description:
* Return the heap virtual address associated with the newly created
* address environment. This function is used by the binary loaders in
* order get an address that can be used to initialize the new task.
*
* Input Parameters:
* addrenv - The representation of the task address environment previously
* returned by up_addrenv_create.
* vheap - The location to return the virtual address.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
#ifdef CONFIG_BUILD_KERNEL
int up_addrenv_vheap(const arch_addrenv_t *addrenv, void **vheap)
{
DEBUGASSERT(addrenv && vheap);
*vheap = (void *)addrenv->heapvbase;
return OK;
}
#endif
/****************************************************************************
* Name: up_addrenv_heapsize
*
* Description:
* Return the initial heap allocation size. That is the amount of memory
* allocated by up_addrenv_create() when the heap memory region was first
* created. This may or may not differ from the heapsize parameter that
* was passed to up_addrenv_create()
*
* Input Parameters:
* addrenv - The representation of the task address environment previously
* returned by up_addrenv_create.
*
* Returned Value:
* The initial heap size allocated is returned on success; a negated
* errno value on failure.
*
****************************************************************************/
#ifdef CONFIG_BUILD_KERNEL
ssize_t up_addrenv_heapsize(const arch_addrenv_t *addrenv)
{
DEBUGASSERT(addrenv);
return (ssize_t)addrenv->heapsize;
}
#endif
/****************************************************************************
* Name: up_addrenv_select
*
* Description:
* After an address environment has been established for a task (via
* up_addrenv_create()), this function may be called to instantiate
* that address environment in the virtual address space. This might be
* necessary, for example, to load the code for the task from a file or
* to access address environment private data.
*
* Input Parameters:
* addrenv - The representation of the task address environment previously
* returned by up_addrenv_create.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int up_addrenv_select(const arch_addrenv_t *addrenv)
{
DEBUGASSERT(addrenv && addrenv->satp);
mmu_write_satp(addrenv->satp);
return OK;
}
/****************************************************************************
* Name: up_addrenv_coherent
*
* Description:
* Flush D-Cache and invalidate I-Cache in preparation for a change in
* address environments. This should immediately precede a call to
* up_addrenv_select();
*
* Input Parameters:
* addrenv - Describes the address environment to be made coherent.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int up_addrenv_coherent(const arch_addrenv_t *addrenv)
{
/* Nothing needs to be done */
return OK;
}
/****************************************************************************
* Name: up_addrenv_clone
*
* Description:
* Duplicate an address environment. This does not copy the underlying
* memory, only the representation that can be used to instantiate that
* memory as an address environment.
*
* Input Parameters:
* src - The address environment to be copied.
* dest - The location to receive the copied address environment.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int up_addrenv_clone(const arch_addrenv_t *src,
arch_addrenv_t *dest)
{
DEBUGASSERT(src && dest);
memcpy(dest, src, sizeof(arch_addrenv_t));
return OK;
}
/****************************************************************************
* Name: up_addrenv_attach
*
* Description:
* This function is called from the core scheduler logic when a thread
* is created that needs to share the address environment of its task
* group.
*
* Input Parameters:
* ptcb - The tcb of the parent task.
* tcb - The tcb of the thread needing the address environment.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int up_addrenv_attach(struct tcb_s *ptcb, struct tcb_s *tcb)
{
/* There is nothing that needs to be done */
return OK;
}
/****************************************************************************
* Name: up_addrenv_detach
*
* Description:
* This function is called when a task or thread exits in order to release
* its reference to an address environment. The address environment,
* however, should persist until up_addrenv_destroy() is called when the
* task group is itself destroyed. Any resources unique to this thread
* may be destroyed now.
*
* Input Parameters:
* tcb - The TCB of the task or thread whose the address environment will
* be released.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int up_addrenv_detach(struct tcb_s *tcb)
{
/* There is nothing that needs to be done */
return OK;
}