You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ut...@apache.org on 2018/03/16 09:48:10 UTC
[mynewt-core] branch master updated: Remove sbrk.c files from all
stm32 BSPs
This is an automated email from the ASF dual-hosted git repository.
utzig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new ad71595 Remove sbrk.c files from all stm32 BSPs
ad71595 is described below
commit ad71595b362415c0c41bd60d364c718f65ec1e87
Author: Fabio Utzig <ut...@apache.org>
AuthorDate: Thu Mar 15 11:02:40 2018 -0300
Remove sbrk.c files from all stm32 BSPs
Common sbrk.c now exists under hw/mcu/stm32_common/src and is shared
between all BSPs.
---
hw/bsp/nucleo-f303k8/src/sbrk.c | 50 ----------------------
hw/bsp/nucleo-f303re/src/sbrk.c | 50 ----------------------
hw/bsp/nucleo-f401re/src/sbrk.c | 50 ----------------------
hw/bsp/nucleo-f413re/src/sbrk.c | 50 ----------------------
hw/bsp/nucleo-f413zh/src/sbrk.c | 50 ----------------------
hw/bsp/olimex-p103/src/sbrk.c | 50 ----------------------
hw/bsp/olimex_stm32-e407_devboard/src/sbrk.c | 50 ----------------------
hw/bsp/sensorhub/src/sbrk.c | 50 ----------------------
hw/bsp/stm32f3discovery/src/sbrk.c | 50 ----------------------
hw/bsp/stm32f429discovery/src/sbrk.c | 50 ----------------------
hw/bsp/stm32f4discovery/src/sbrk.c | 50 ----------------------
hw/bsp/stm32f767-nucleo/src/sbrk.c | 50 ----------------------
hw/bsp/stm32f7discovery/src/sbrk.c | 50 ----------------------
.../stm/stm32_common}/src/sbrk.c | 0
14 files changed, 650 deletions(-)
diff --git a/hw/bsp/nucleo-f303k8/src/sbrk.c b/hw/bsp/nucleo-f303k8/src/sbrk.c
deleted file mode 100644
index 34edf72..0000000
--- a/hw/bsp/nucleo-f303k8/src/sbrk.c
+++ /dev/null
@@ -1,50 +0,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.
- */
-
-extern char __HeapBase;
-extern char __HeapLimit;
-
-void *
-_sbrk(int incr)
-{
- static char *brk = &__HeapBase;
-
- void *prev_brk;
-
- if (incr < 0) {
- /* Returning memory to the heap. */
- incr = -incr;
- if (brk - incr < &__HeapBase) {
- prev_brk = (void *)-1;
- } else {
- prev_brk = brk;
- brk -= incr;
- }
- } else {
- /* Allocating memory from the heap. */
- if (&__HeapLimit - brk >= incr) {
- prev_brk = brk;
- brk += incr;
- } else {
- prev_brk = (void *)-1;
- }
- }
-
- return prev_brk;
-}
diff --git a/hw/bsp/nucleo-f303re/src/sbrk.c b/hw/bsp/nucleo-f303re/src/sbrk.c
deleted file mode 100644
index 34edf72..0000000
--- a/hw/bsp/nucleo-f303re/src/sbrk.c
+++ /dev/null
@@ -1,50 +0,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.
- */
-
-extern char __HeapBase;
-extern char __HeapLimit;
-
-void *
-_sbrk(int incr)
-{
- static char *brk = &__HeapBase;
-
- void *prev_brk;
-
- if (incr < 0) {
- /* Returning memory to the heap. */
- incr = -incr;
- if (brk - incr < &__HeapBase) {
- prev_brk = (void *)-1;
- } else {
- prev_brk = brk;
- brk -= incr;
- }
- } else {
- /* Allocating memory from the heap. */
- if (&__HeapLimit - brk >= incr) {
- prev_brk = brk;
- brk += incr;
- } else {
- prev_brk = (void *)-1;
- }
- }
-
- return prev_brk;
-}
diff --git a/hw/bsp/nucleo-f401re/src/sbrk.c b/hw/bsp/nucleo-f401re/src/sbrk.c
deleted file mode 100644
index 34edf72..0000000
--- a/hw/bsp/nucleo-f401re/src/sbrk.c
+++ /dev/null
@@ -1,50 +0,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.
- */
-
-extern char __HeapBase;
-extern char __HeapLimit;
-
-void *
-_sbrk(int incr)
-{
- static char *brk = &__HeapBase;
-
- void *prev_brk;
-
- if (incr < 0) {
- /* Returning memory to the heap. */
- incr = -incr;
- if (brk - incr < &__HeapBase) {
- prev_brk = (void *)-1;
- } else {
- prev_brk = brk;
- brk -= incr;
- }
- } else {
- /* Allocating memory from the heap. */
- if (&__HeapLimit - brk >= incr) {
- prev_brk = brk;
- brk += incr;
- } else {
- prev_brk = (void *)-1;
- }
- }
-
- return prev_brk;
-}
diff --git a/hw/bsp/nucleo-f413re/src/sbrk.c b/hw/bsp/nucleo-f413re/src/sbrk.c
deleted file mode 100644
index 34edf72..0000000
--- a/hw/bsp/nucleo-f413re/src/sbrk.c
+++ /dev/null
@@ -1,50 +0,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.
- */
-
-extern char __HeapBase;
-extern char __HeapLimit;
-
-void *
-_sbrk(int incr)
-{
- static char *brk = &__HeapBase;
-
- void *prev_brk;
-
- if (incr < 0) {
- /* Returning memory to the heap. */
- incr = -incr;
- if (brk - incr < &__HeapBase) {
- prev_brk = (void *)-1;
- } else {
- prev_brk = brk;
- brk -= incr;
- }
- } else {
- /* Allocating memory from the heap. */
- if (&__HeapLimit - brk >= incr) {
- prev_brk = brk;
- brk += incr;
- } else {
- prev_brk = (void *)-1;
- }
- }
-
- return prev_brk;
-}
diff --git a/hw/bsp/nucleo-f413zh/src/sbrk.c b/hw/bsp/nucleo-f413zh/src/sbrk.c
deleted file mode 100644
index 34edf72..0000000
--- a/hw/bsp/nucleo-f413zh/src/sbrk.c
+++ /dev/null
@@ -1,50 +0,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.
- */
-
-extern char __HeapBase;
-extern char __HeapLimit;
-
-void *
-_sbrk(int incr)
-{
- static char *brk = &__HeapBase;
-
- void *prev_brk;
-
- if (incr < 0) {
- /* Returning memory to the heap. */
- incr = -incr;
- if (brk - incr < &__HeapBase) {
- prev_brk = (void *)-1;
- } else {
- prev_brk = brk;
- brk -= incr;
- }
- } else {
- /* Allocating memory from the heap. */
- if (&__HeapLimit - brk >= incr) {
- prev_brk = brk;
- brk += incr;
- } else {
- prev_brk = (void *)-1;
- }
- }
-
- return prev_brk;
-}
diff --git a/hw/bsp/olimex-p103/src/sbrk.c b/hw/bsp/olimex-p103/src/sbrk.c
deleted file mode 100644
index 34edf72..0000000
--- a/hw/bsp/olimex-p103/src/sbrk.c
+++ /dev/null
@@ -1,50 +0,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.
- */
-
-extern char __HeapBase;
-extern char __HeapLimit;
-
-void *
-_sbrk(int incr)
-{
- static char *brk = &__HeapBase;
-
- void *prev_brk;
-
- if (incr < 0) {
- /* Returning memory to the heap. */
- incr = -incr;
- if (brk - incr < &__HeapBase) {
- prev_brk = (void *)-1;
- } else {
- prev_brk = brk;
- brk -= incr;
- }
- } else {
- /* Allocating memory from the heap. */
- if (&__HeapLimit - brk >= incr) {
- prev_brk = brk;
- brk += incr;
- } else {
- prev_brk = (void *)-1;
- }
- }
-
- return prev_brk;
-}
diff --git a/hw/bsp/olimex_stm32-e407_devboard/src/sbrk.c b/hw/bsp/olimex_stm32-e407_devboard/src/sbrk.c
deleted file mode 100644
index 34edf72..0000000
--- a/hw/bsp/olimex_stm32-e407_devboard/src/sbrk.c
+++ /dev/null
@@ -1,50 +0,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.
- */
-
-extern char __HeapBase;
-extern char __HeapLimit;
-
-void *
-_sbrk(int incr)
-{
- static char *brk = &__HeapBase;
-
- void *prev_brk;
-
- if (incr < 0) {
- /* Returning memory to the heap. */
- incr = -incr;
- if (brk - incr < &__HeapBase) {
- prev_brk = (void *)-1;
- } else {
- prev_brk = brk;
- brk -= incr;
- }
- } else {
- /* Allocating memory from the heap. */
- if (&__HeapLimit - brk >= incr) {
- prev_brk = brk;
- brk += incr;
- } else {
- prev_brk = (void *)-1;
- }
- }
-
- return prev_brk;
-}
diff --git a/hw/bsp/sensorhub/src/sbrk.c b/hw/bsp/sensorhub/src/sbrk.c
deleted file mode 100644
index 34edf72..0000000
--- a/hw/bsp/sensorhub/src/sbrk.c
+++ /dev/null
@@ -1,50 +0,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.
- */
-
-extern char __HeapBase;
-extern char __HeapLimit;
-
-void *
-_sbrk(int incr)
-{
- static char *brk = &__HeapBase;
-
- void *prev_brk;
-
- if (incr < 0) {
- /* Returning memory to the heap. */
- incr = -incr;
- if (brk - incr < &__HeapBase) {
- prev_brk = (void *)-1;
- } else {
- prev_brk = brk;
- brk -= incr;
- }
- } else {
- /* Allocating memory from the heap. */
- if (&__HeapLimit - brk >= incr) {
- prev_brk = brk;
- brk += incr;
- } else {
- prev_brk = (void *)-1;
- }
- }
-
- return prev_brk;
-}
diff --git a/hw/bsp/stm32f3discovery/src/sbrk.c b/hw/bsp/stm32f3discovery/src/sbrk.c
deleted file mode 100644
index 34edf72..0000000
--- a/hw/bsp/stm32f3discovery/src/sbrk.c
+++ /dev/null
@@ -1,50 +0,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.
- */
-
-extern char __HeapBase;
-extern char __HeapLimit;
-
-void *
-_sbrk(int incr)
-{
- static char *brk = &__HeapBase;
-
- void *prev_brk;
-
- if (incr < 0) {
- /* Returning memory to the heap. */
- incr = -incr;
- if (brk - incr < &__HeapBase) {
- prev_brk = (void *)-1;
- } else {
- prev_brk = brk;
- brk -= incr;
- }
- } else {
- /* Allocating memory from the heap. */
- if (&__HeapLimit - brk >= incr) {
- prev_brk = brk;
- brk += incr;
- } else {
- prev_brk = (void *)-1;
- }
- }
-
- return prev_brk;
-}
diff --git a/hw/bsp/stm32f429discovery/src/sbrk.c b/hw/bsp/stm32f429discovery/src/sbrk.c
deleted file mode 100644
index 34edf72..0000000
--- a/hw/bsp/stm32f429discovery/src/sbrk.c
+++ /dev/null
@@ -1,50 +0,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.
- */
-
-extern char __HeapBase;
-extern char __HeapLimit;
-
-void *
-_sbrk(int incr)
-{
- static char *brk = &__HeapBase;
-
- void *prev_brk;
-
- if (incr < 0) {
- /* Returning memory to the heap. */
- incr = -incr;
- if (brk - incr < &__HeapBase) {
- prev_brk = (void *)-1;
- } else {
- prev_brk = brk;
- brk -= incr;
- }
- } else {
- /* Allocating memory from the heap. */
- if (&__HeapLimit - brk >= incr) {
- prev_brk = brk;
- brk += incr;
- } else {
- prev_brk = (void *)-1;
- }
- }
-
- return prev_brk;
-}
diff --git a/hw/bsp/stm32f4discovery/src/sbrk.c b/hw/bsp/stm32f4discovery/src/sbrk.c
deleted file mode 100644
index 34edf72..0000000
--- a/hw/bsp/stm32f4discovery/src/sbrk.c
+++ /dev/null
@@ -1,50 +0,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.
- */
-
-extern char __HeapBase;
-extern char __HeapLimit;
-
-void *
-_sbrk(int incr)
-{
- static char *brk = &__HeapBase;
-
- void *prev_brk;
-
- if (incr < 0) {
- /* Returning memory to the heap. */
- incr = -incr;
- if (brk - incr < &__HeapBase) {
- prev_brk = (void *)-1;
- } else {
- prev_brk = brk;
- brk -= incr;
- }
- } else {
- /* Allocating memory from the heap. */
- if (&__HeapLimit - brk >= incr) {
- prev_brk = brk;
- brk += incr;
- } else {
- prev_brk = (void *)-1;
- }
- }
-
- return prev_brk;
-}
diff --git a/hw/bsp/stm32f767-nucleo/src/sbrk.c b/hw/bsp/stm32f767-nucleo/src/sbrk.c
deleted file mode 100644
index 34edf72..0000000
--- a/hw/bsp/stm32f767-nucleo/src/sbrk.c
+++ /dev/null
@@ -1,50 +0,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.
- */
-
-extern char __HeapBase;
-extern char __HeapLimit;
-
-void *
-_sbrk(int incr)
-{
- static char *brk = &__HeapBase;
-
- void *prev_brk;
-
- if (incr < 0) {
- /* Returning memory to the heap. */
- incr = -incr;
- if (brk - incr < &__HeapBase) {
- prev_brk = (void *)-1;
- } else {
- prev_brk = brk;
- brk -= incr;
- }
- } else {
- /* Allocating memory from the heap. */
- if (&__HeapLimit - brk >= incr) {
- prev_brk = brk;
- brk += incr;
- } else {
- prev_brk = (void *)-1;
- }
- }
-
- return prev_brk;
-}
diff --git a/hw/bsp/stm32f7discovery/src/sbrk.c b/hw/bsp/stm32f7discovery/src/sbrk.c
deleted file mode 100644
index b269f53..0000000
--- a/hw/bsp/stm32f7discovery/src/sbrk.c
+++ /dev/null
@@ -1,50 +0,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.
- */
-
-extern char __HeapBase;
-extern char __HeapLimit;
-
-void *
-_sbrk(int incr)
-{
- static char *brk = &__HeapBase;
-
- void *prev_brk;
-
- if (incr < 0) {
- /* Returning memory to the heap. */
- incr = -incr;
- if (brk - incr < &__HeapBase) {
- prev_brk = (void *)-1;
- } else {
- prev_brk = brk;
- brk -= incr;
- }
- } else {
- /* Allocating memory from the heap. */
- if (&__HeapLimit - brk >= incr) {
- prev_brk = brk;
- brk += incr;
- } else {
- prev_brk = (void *)-1;
- }
- }
-
- return prev_brk;
-}
diff --git a/hw/bsp/stm32l152discovery/src/sbrk.c b/hw/mcu/stm/stm32_common/src/sbrk.c
similarity index 100%
rename from hw/bsp/stm32l152discovery/src/sbrk.c
rename to hw/mcu/stm/stm32_common/src/sbrk.c
--
To stop receiving notification emails like this one, please contact
utzig@apache.org.