diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-06-06 16:18:49 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-06-14 07:31:08 +0200 |
commit | 46c2da693c209e1004e69abc7aea0752ef249940 (patch) | |
tree | 7930595fe47872f996e95d96a6d31091cbbc3c00 /tools/cpu/nios2/memory.c | |
parent | tools: Remove shgen (diff) | |
download | rtems-46c2da693c209e1004e69abc7aea0752ef249940.tar.bz2 |
tools: Remove nios2gen
All tools should be removed from the RTEMS source repository at some
point in time. Tools with a BSD-style license will be moved to the
RTEMS tools repository. Unfortunately, the this tool is RTEMS GPL
licensed.
If users of this tool still exist, they can reimplement the
functionality using a BSD-style license and add it to the RTEMS tools.
Close #3444.
Diffstat (limited to '')
-rw-r--r-- | tools/cpu/nios2/memory.c | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/tools/cpu/nios2/memory.c b/tools/cpu/nios2/memory.c deleted file mode 100644 index cb1ea7f31e..0000000000 --- a/tools/cpu/nios2/memory.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2006 Kolja Waschk rtemsdev/ixo.de - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "ptf.h" -#include "devices.h" -#include "memory.h" - -memory_desc *find_memory(device_desc *devices) -{ - struct ptf *p; - struct ptf_item pi; - memory_desc *tmd; - memory_desc *memory = NULL; - - /********************************************************/ - /* Check which of the devices are memory, sort by size */ - - if(devices) - { - struct ptf *p, *s; - struct ptf_item pi; - device_desc *dd; - - for(dd = devices; dd; dd=dd->next) - { - p = ptf_find(dd->ptf->sub, &pi, item, "Is_Memory_Device", "1"); - if(p != NULL && pi.level>0) - { - s = pi.item[pi.level-1]; - p = ptf_find(s, &pi, item, "Base_Address", 0); - }; - - if(p != NULL) - { - tmd = (memory_desc*)malloc(sizeof(memory_desc)); - - if(tmd != NULL) - { - tmd->base = strtoul(p->value, 0, 0); - - p = ptf_find(s, &pi, item, "Address_Span", 0); - if(p != 0) - { - tmd->size = strtoul(p->value, 0, 0); - } - else - { - tmd->size = 0; - p = ptf_find(s, &pi, item, "Address_Width", 0); - if(p) tmd->size = 1 << strtoul(p->value, 0, 0); - p = ptf_find(s, &pi, item, "Data_Width", 0); - if(p) tmd->size *= (strtoul(p->value, 0, 0) >> 3); - }; - - if(tmd->size == 0) - { - free(tmd); - } - else - { - tmd->dev = dd; - - if(memory == NULL) - { - tmd->next = NULL; - memory = tmd; - } - else - { - if(tmd->size > memory->size) - { - tmd->next = memory; - memory = tmd; - } - else - { - memory_desc *uplink = memory; - while(uplink->next != NULL && uplink->next->size > tmd->size) uplink=uplink->next; - tmd->next = uplink->next; - uplink->next = tmd; - }; - }; - }; - }; - }; - }; - }; - - return memory; -} - - |