Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libc/machine: Implement ARM aeabi_xxx API called by clang #5564

Merged
merged 1 commit into from Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions libs/libc/machine/arm/Make.defs
Expand Up @@ -42,6 +42,11 @@ else ifeq ($(CONFIG_ARCH_ARMV8M),y) # All ARMv8-M
include $(TOPDIR)/libs/libc/machine/arm/armv8-m/Make.defs
endif

CSRCS += aeabi_memclr.c aeabi_memclr4.c aeabi_memclr8.c
CSRCS += aeabi_memcpy.c aeabi_memcpy4.c aeabi_memcpy8.c
CSRCS += aeabi_memmove.c aeabi_memmove4.c aeabi_memmove8.c
CSRCS += aeabi_memset.c aeabi_memset4.c aeabi_memset8.c

ifeq ($(CONFIG_CXX_EXCEPTION),y)
CSRCS += gnu_unwind_find_exidx.c
endif
Expand Down
34 changes: 34 additions & 0 deletions libs/libc/machine/arm/aeabi_memclr.c
@@ -0,0 +1,34 @@
/****************************************************************************
* libs/libc/machine/arm/aeabi_memclr.c
*
* 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.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include <string.h>

/****************************************************************************
* Public Functions
****************************************************************************/

void weak_function __aeabi_memclr(FAR void *s, size_t n)
xiaoxiang781216 marked this conversation as resolved.
Show resolved Hide resolved
{
memset(s, 0, n);
}
34 changes: 34 additions & 0 deletions libs/libc/machine/arm/aeabi_memclr4.c
@@ -0,0 +1,34 @@
/****************************************************************************
* libs/libc/machine/arm/aeabi_memclr4.c
*
* 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.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include <string.h>

/****************************************************************************
* Public Functions
****************************************************************************/

void weak_function __aeabi_memclr4(FAR void *s, size_t n)
{
memset(s, 0, n);
}
34 changes: 34 additions & 0 deletions libs/libc/machine/arm/aeabi_memclr8.c
@@ -0,0 +1,34 @@
/****************************************************************************
* libs/libc/machine/arm/aeabi_memclr8.c
*
* 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.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include <string.h>

/****************************************************************************
* Public Functions
****************************************************************************/

void weak_function __aeabi_memclr8(FAR void *s, size_t n)
{
memset(s, 0, n);
}
35 changes: 35 additions & 0 deletions libs/libc/machine/arm/aeabi_memcpy.c
@@ -0,0 +1,35 @@
/****************************************************************************
* libs/libc/machine/arm/aeabi_memcpy.c
*
* 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.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include <string.h>

/****************************************************************************
* Public Functions
****************************************************************************/

void weak_function
__aeabi_memcpy(FAR void *dest, FAR const void *src, size_t n)
{
memcpy(dest, src, n);
}
35 changes: 35 additions & 0 deletions libs/libc/machine/arm/aeabi_memcpy4.c
@@ -0,0 +1,35 @@
/****************************************************************************
* libs/libc/machine/arm/aeabi_memcpy4.c
*
* 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.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include <string.h>

/****************************************************************************
* Public Functions
****************************************************************************/

void weak_function
__aeabi_memcpy4(FAR void *dest, FAR const void *src, size_t n)
{
memcpy(dest, src, n);
}
35 changes: 35 additions & 0 deletions libs/libc/machine/arm/aeabi_memcpy8.c
@@ -0,0 +1,35 @@
/****************************************************************************
* libs/libc/machine/arm/aeabi_memcpy8.c
*
* 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.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include <string.h>

/****************************************************************************
* Public Functions
****************************************************************************/

void weak_function
__aeabi_memcpy8(FAR void *dest, FAR const void *src, size_t n)
{
memcpy(dest, src, n);
}
35 changes: 35 additions & 0 deletions libs/libc/machine/arm/aeabi_memmove.c
@@ -0,0 +1,35 @@
/****************************************************************************
* libs/libc/machine/arm/aeabi_memmove.c
*
* 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.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include <string.h>

/****************************************************************************
* Public Functions
****************************************************************************/

void weak_function
__aeabi_memmove(FAR void *dest, FAR const void *src, size_t n)
{
memmove(dest, src, n);
}
35 changes: 35 additions & 0 deletions libs/libc/machine/arm/aeabi_memmove4.c
@@ -0,0 +1,35 @@
/****************************************************************************
* libs/libc/machine/arm/aeabi_memmove4.c
*
* 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.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include <string.h>

/****************************************************************************
* Public Functions
****************************************************************************/

void weak_function
__aeabi_memmove4(FAR void *dest, FAR const void *src, size_t n)
{
memmove(dest, src, n);
}
35 changes: 35 additions & 0 deletions libs/libc/machine/arm/aeabi_memmove8.c
@@ -0,0 +1,35 @@
/****************************************************************************
* libs/libc/machine/arm/aeabi_memmove8.c
*
* 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.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include <string.h>

/****************************************************************************
* Public Functions
****************************************************************************/

void weak_function
__aeabi_memmove8(FAR void *dest, FAR const void *src, size_t n)
{
memmove(dest, src, n);
}
34 changes: 34 additions & 0 deletions libs/libc/machine/arm/aeabi_memset.c
@@ -0,0 +1,34 @@
/****************************************************************************
* libs/libc/machine/arm/aeabi_memset.c
*
* 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.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include <string.h>

/****************************************************************************
* Public Functions
****************************************************************************/

void weak_function __aeabi_memset(FAR void *s, size_t n, int c)
{
memset(s, c, n);
pkarashchenko marked this conversation as resolved.
Show resolved Hide resolved
}