Skip to content

Commit

Permalink
Run clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
bengineerd committed Apr 29, 2024
1 parent b0bc15b commit 0206859
Show file tree
Hide file tree
Showing 7 changed files with 404 additions and 391 deletions.
30 changes: 15 additions & 15 deletions include/rogue/hardware/drivers/AxisDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#include "DmaDriver.h"

// Command definitions
#define AXIS_Read_Ack 0x2001 // Command to acknowledge read
#define AXIS_Write_ReqMissed 0x2002 // Command to indicate a missed write request
#define AXIS_Read_Ack 0x2001 // Command to acknowledge read
#define AXIS_Write_ReqMissed 0x2002 // Command to indicate a missed write request

// Only define the following if not compiling for kernel space
#ifndef DMA_IN_KERNEL
Expand All @@ -41,14 +41,14 @@
* @return The combined flags value.
*/
static inline uint32_t axisSetFlags(uint32_t fuser, uint32_t luser, uint32_t cont) {
uint32_t flags;
uint32_t flags;

// Set flags based on input parameters, ensuring each is in its correct position
flags = fuser & 0xFF; // First user-defined flag
flags |= (luser << 8) & 0xFF00; // Last user-defined flag
flags |= (cont << 16) & 0x10000; // Continuation flag
// Set flags based on input parameters, ensuring each is in its correct position
flags = fuser & 0xFF; // First user-defined flag
flags |= (luser << 8) & 0xFF00; // Last user-defined flag
flags |= (cont << 16) & 0x10000; // Continuation flag

return flags;
return flags;
}

/**
Expand All @@ -59,7 +59,7 @@ static inline uint32_t axisSetFlags(uint32_t fuser, uint32_t luser, uint32_t con
* @return The first user-defined flag.
*/
static inline uint32_t axisGetFuser(uint32_t flags) {
return flags & 0xFF;
return flags & 0xFF;
}

/**
Expand All @@ -70,7 +70,7 @@ static inline uint32_t axisGetFuser(uint32_t flags) {
* @return The last user-defined flag.
*/
static inline uint32_t axisGetLuser(uint32_t flags) {
return (flags >> 8) & 0xFF;
return (flags >> 8) & 0xFF;
}

/**
Expand All @@ -81,7 +81,7 @@ static inline uint32_t axisGetLuser(uint32_t flags) {
* @return The continuation flag.
*/
static inline uint32_t axisGetCont(uint32_t flags) {
return (flags >> 16) & 0x1;
return (flags >> 16) & 0x1;
}

/**
Expand All @@ -90,7 +90,7 @@ static inline uint32_t axisGetCont(uint32_t flags) {
* @param fd File descriptor for the AXIS device.
*/
static inline void axisReadAck(int32_t fd) {
ioctl(fd, AXIS_Read_Ack, 0);
ioctl(fd, AXIS_Read_Ack, 0);
}

/**
Expand All @@ -99,8 +99,8 @@ static inline void axisReadAck(int32_t fd) {
* @param fd File descriptor for the AXIS device.
*/
static inline void axisWriteReqMissed(int32_t fd) {
ioctl(fd, AXIS_Write_ReqMissed, 0);
ioctl(fd, AXIS_Write_ReqMissed, 0);
}

#endif // !DMA_IN_KERNEL
#endif // __ASIS_DRIVER_H__
#endif // !DMA_IN_KERNEL
#endif // __ASIS_DRIVER_H__
Loading

0 comments on commit 0206859

Please sign in to comment.