File casvp-driver.cc
FileList > casvp > casvp-driver.cc
Go to the source code of this file
#include "casvp-driver.h"
#include <formosa-driver.h>
#include <libcomm/comm.h>
#include <libcomm/msg.h>
#include <signal.h>
#include <unistd.h>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include "casvp-config.h"
#include "falloc.h"
Public Attributes
Type | Name |
---|---|
Device | device |
Public Functions
Type | Name |
---|---|
int | fsa_addr_malloc (uintptr_t dev_addr, size_t size) |
int | fsa_cache_flush () |
int | fsa_cache_invalidate () |
int | fsa_cmd_barrier () |
int | fsa_copy_from_dev (uintptr_t dev_addr, void * host_ptr, size_t size) |
int | fsa_copy_to_dev (uintptr_t dev_addr, const void * host_ptr, size_t size) |
int | fsa_driver_init (void * args) |
int | fsa_driver_uninit () |
int | fsa_free (void * dev_addr) |
int | fsa_malloc (void ** dev_addr, size_t size) |
int | fsa_mmio (int id, uint64_t wr_val, uint64_t * rd_ptr) |
int | fsa_probe () |
int | fsa_start_kernel () |
Public Attributes Documentation
variable device
Public Functions Documentation
function fsa_addr_malloc
Allocate memory on device with designated address.
Parameters:
dev_addr
Device address to allocate memory.size
Size of memory to allocate.
Returns:
0 on success, -1 on failure.
function fsa_cache_flush
Flush cache. Write back all dirty lines in cache to memory.
Returns:
0 on success, -1 on failure.
function fsa_cache_invalidate
Invalidate all lines in cache.
Returns:
0 on success, -1 on failure.
function fsa_cmd_barrier
Barrier command for synchronization. All commands before barrier will be completed before barrier returns.
Returns:
0 on success, -1 on failure.
function fsa_copy_from_dev
Copy data from device to host.
Parameters:
dev_addr
Device address to copy from.host_ptr
Host pointer that data is copied to.size
Size of data to copy.
Returns:
0 on success, -1 on failure.
function fsa_copy_to_dev
Copy data from host to device.
Parameters:
dev_addr
Device address to copy to.host_ptr
Host pointer that data is copied from.size
Size of data to copy.
Returns:
0 on success, -1 on failure.
function fsa_driver_init
Initialize driver.
Parameters:
args
Arguments for initialization.
Returns:
0 on success, -1 on failure.
function fsa_driver_uninit
Uninitialize driver.
Returns:
0 on success, -1 on failure.
function fsa_free
Free memory on device.
Parameters:
dev_addr
Device address to free memory.
Returns:
0 on success, -1 on failure.
function fsa_malloc
Allocate memory on device.
Parameters:
dev_addr
Pointer to device address to allocate memory.size
Size of memory to allocate.
Returns:
0 on success, -1 on failure.
function fsa_mmio
Memory-mapped I/O. When rd_ptr is nullptr, it is a write request. Otherwise, it is a read request.
Parameters:
id
CSR ID.wr_val
Value to write.rd_ptr
Pointer to read value.
Returns:
0 on success, -1 on failure.
function fsa_probe
Probe for available devices.
Returns:
0 on device found, -1 on no device found.
function fsa_start_kernel
Start kernel on device.
Returns:
0 on success, -1 on failure.
The documentation for this class was generated from the following file projects/formosa-driver/src/casvp/casvp-driver.cc