svn commit: trunk/uClibc/libc/sysdeps/linux/bfin: bits

bernds at uclibc.org bernds at uclibc.org
Fri Jan 18 13:53:10 UTC 2008


Author: bernds
Date: 2008-01-18 05:53:10 -0800 (Fri, 18 Jan 2008)
New Revision: 20873

Log:
L1 memory support for the Blackfin.  A couple new syscalls to manage L1
allocations, dma_memcpy to move stuff between L1 and main memory, and a new
structure to describe the global data in L1 scratchpad memory.


Added:
   trunk/uClibc/libc/sysdeps/linux/bfin/bfin_l1layout.h
   trunk/uClibc/libc/sysdeps/linux/bfin/bfin_sram.h
   trunk/uClibc/libc/sysdeps/linux/bfin/dma-memcpy.c
   trunk/uClibc/libc/sysdeps/linux/bfin/sram-alloc.c
   trunk/uClibc/libc/sysdeps/linux/bfin/sram-free.c

Removed:
   trunk/uClibc/libc/sysdeps/linux/bfin/bits/bfin_sram.h

Modified:
   trunk/uClibc/libc/sysdeps/linux/bfin/Makefile.arch


Changeset:
Modified: trunk/uClibc/libc/sysdeps/linux/bfin/Makefile.arch
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/bfin/Makefile.arch	2008-01-18 13:46:58 UTC (rev 20872)
+++ trunk/uClibc/libc/sysdeps/linux/bfin/Makefile.arch	2008-01-18 13:53:10 UTC (rev 20873)
@@ -5,8 +5,11 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
-CSRC := brk.c bsdsetjmp.c clone.c syscall.c
+CSRC := brk.c bsdsetjmp.c clone.c syscall.c mmap.c \
+	sram-alloc.c sram-free.c dma-memcpy.c
 
 SSRC := __longjmp.S setjmp.S bsd-_setjmp.S vfork.S
 
+ARCH_HEADERS := bfin_l1layout.h bfin_sram.h
+
 include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch

Added: trunk/uClibc/libc/sysdeps/linux/bfin/bfin_l1layout.h
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/bfin/bfin_l1layout.h	                        (rev 0)
+++ trunk/uClibc/libc/sysdeps/linux/bfin/bfin_l1layout.h	2008-01-18 13:53:10 UTC (rev 20873)
@@ -0,0 +1,17 @@
+#define L1_SCRATCH_START	0xFFB00000
+
+/* Data that is "mapped" into the process VM at the start of the L1 scratch
+   memory, so that each process can access it at a fixed address.  Used for
+   stack checking.  */
+struct l1_scratch_task_info
+{
+	/* Points to the start of the stack.  */
+	void *stack_start;
+	/* Not updated by the kernel; a user process can modify this to
+	   keep track of the lowest address of the stack pointer during its
+	   runtime.  */
+	void *lowest_sp;
+};
+
+/* A pointer to the structure in memory.  */
+#define L1_SCRATCH_TASK_INFO ((struct l1_scratch_task_info *)L1_SCRATCH_START)

Added: trunk/uClibc/libc/sysdeps/linux/bfin/bfin_sram.h
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/bfin/bfin_sram.h	                        (rev 0)
+++ trunk/uClibc/libc/sysdeps/linux/bfin/bfin_sram.h	2008-01-18 13:53:10 UTC (rev 20873)
@@ -0,0 +1,30 @@
+/*
+ * bfin_sram.h - userspace interface to L1 memory allocator
+ *
+ * Copyright (c) 2007 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#ifndef __BFIN_SRAM_H__
+#define __BFIN_SRAM_H__
+
+#include <features.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+#define L1_INST_SRAM            0x00000001
+#define L1_DATA_A_SRAM          0x00000002
+#define L1_DATA_B_SRAM          0x00000004
+#define L1_DATA_SRAM            0x00000006
+
+extern void *sram_alloc(size_t size, unsigned long flags)
+	__attribute_malloc__ __attribute_warn_unused_result__;
+extern int sram_free(const void *addr);
+extern void *dma_memcpy(void *dest, const void *src, size_t len)
+	__nonnull((1, 2));
+
+__END_DECLS
+
+#endif

Deleted: trunk/uClibc/libc/sysdeps/linux/bfin/bits/bfin_sram.h
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/bfin/bits/bfin_sram.h	2008-01-18 13:46:58 UTC (rev 20872)
+++ trunk/uClibc/libc/sysdeps/linux/bfin/bits/bfin_sram.h	2008-01-18 13:53:10 UTC (rev 20873)
@@ -1,12 +0,0 @@
-#ifndef BFIN_SRAM_H
-#define BFIN_SRAM_H
-
-#define L1_INST_SRAM            0x00000001
-#define L1_DATA_A_SRAM          0x00000002
-#define L1_DATA_B_SRAM          0x00000004
-#define L1_DATA_SRAM            0x00000006
-extern void *sram_alloc(size_t size, unsigned long flags);
-extern int sram_free(const void *addr);
-extern void *dma_memcpy(void *dest, const void *src, size_t len);
-
-#endif

Added: trunk/uClibc/libc/sysdeps/linux/bfin/dma-memcpy.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/bfin/dma-memcpy.c	                        (rev 0)
+++ trunk/uClibc/libc/sysdeps/linux/bfin/dma-memcpy.c	2008-01-18 13:53:10 UTC (rev 20873)
@@ -0,0 +1,6 @@
+#include <unistd.h>
+#include <errno.h>
+#include <sys/syscall.h>
+
+_syscall3 (__ptr_t, dma_memcpy, __ptr_t, dest, __ptr_t, src, size_t, len);
+

Added: trunk/uClibc/libc/sysdeps/linux/bfin/sram-alloc.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/bfin/sram-alloc.c	                        (rev 0)
+++ trunk/uClibc/libc/sysdeps/linux/bfin/sram-alloc.c	2008-01-18 13:53:10 UTC (rev 20873)
@@ -0,0 +1,6 @@
+#include <unistd.h>
+#include <errno.h>
+#include <sys/syscall.h>
+
+_syscall2 (__ptr_t, sram_alloc, size_t, len, unsigned long, flags);
+

Added: trunk/uClibc/libc/sysdeps/linux/bfin/sram-free.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/bfin/sram-free.c	                        (rev 0)
+++ trunk/uClibc/libc/sysdeps/linux/bfin/sram-free.c	2008-01-18 13:53:10 UTC (rev 20873)
@@ -0,0 +1,6 @@
+#include <unistd.h>
+#include <errno.h>
+#include <sys/syscall.h>
+
+_syscall1 (__ptr_t, sram_free, __ptr_t, addr);
+




More information about the uClibc-cvs mailing list