Commit da621ae6 authored by Nicolas Denoyelle's avatar Nicolas Denoyelle Committed by Swann Perarnau
Browse files

Default dma for linux

parent 2910ba2c
......@@ -46,7 +46,6 @@
////////////////////////////////////////////////////////////////////////////////
/**
* @}
* @defgroup aml "AML Library functions"
* @brief Initialize/Finalize library.
*
......
......@@ -27,6 +27,11 @@
**/
extern struct aml_dma_ops aml_dma_linux_par_ops;
/**
* Default parallel linux dma initialized at aml_init().
**/
extern struct aml_dma *aml_dma_linux_parallel;
/** Inside of a parallel request for linux movement. **/
struct aml_dma_request_linux_par {
/**
......
......@@ -27,6 +27,11 @@
**/
extern struct aml_dma_ops aml_dma_linux_seq_ops;
/**
* Default sequential linux dma initialized at aml_init().
**/
extern struct aml_dma *aml_dma_linux_sequential;
/** Inside of a sequential request for linux movement. **/
struct aml_dma_request_linux_seq {
/**
......
......@@ -14,6 +14,9 @@
#include "aml.h"
#include "aml/dma/linux-par.h"
#include "aml/dma/linux-seq.h"
const int aml_version_major = AML_VERSION_MAJOR;
const int aml_version_minor = AML_VERSION_MINOR;
const int aml_version_patch = AML_VERSION_PATCH;
......@@ -21,6 +24,9 @@ const char *aml_version_string = AML_VERSION_STRING;
int aml_errno;
struct aml_dma *aml_dma_linux_sequential;
struct aml_dma *aml_dma_linux_parallel;
#if HAVE_HWLOC == 1
#include <hwloc.h>
......@@ -52,11 +58,22 @@ int aml_topology_init(void)
int aml_init(int *argc, char **argv[])
{
int err;
// disable warnings
(void)argc;
(void)argv;
// Initialize topology
// Initialize dma
err = aml_dma_linux_seq_create(&aml_dma_linux_sequential, 64, NULL,
NULL);
if (err != AML_SUCCESS)
goto err_with_linux_seq_dma;
err = aml_dma_linux_par_create(&aml_dma_linux_parallel, 64, NULL, NULL);
if (err != AML_SUCCESS)
goto err_with_linux_par_dma;
// Initialize topology
#if HAVE_HWLOC == 1
int err_hwloc;
err_hwloc = aml_topology_init();
......@@ -66,10 +83,18 @@ int aml_init(int *argc, char **argv[])
#endif
return 0;
err_with_linux_par_dma:
aml_dma_linux_seq_destroy(&aml_dma_linux_sequential);
err_with_linux_seq_dma:
return err;
}
int aml_finalize(void)
{
aml_dma_linux_seq_destroy(&aml_dma_linux_sequential);
aml_dma_linux_par_destroy(&aml_dma_linux_parallel);
// Destroy topology
#if HAVE_HWLOC == 1
hwloc_topology_destroy(aml_topology);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment