TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
msgqueue.h File Reference

Go to the source code of this file.

Data Structures

struct  message_queue_header
struct  force_fan_speed_rqst
 Host request to force the fan speed. More...
struct  aiclk_set_speed_rqst
 Host request to adjust the AICLK speed. More...
struct  power_setting_rqst
 Host request to adjust the power settings. More...
union  request
 A tenstorrent host request. More...
struct  response
struct  msgqueue_handler

Macros

#define NUM_MSG_QUEUES   4
#define MSG_QUEUE_SIZE   4
#define MSG_QUEUE_POINTER_WRAP   (2 * MSG_QUEUE_SIZE)
#define REQUEST_MSG_LEN   8
#define RESPONSE_MSG_LEN   8
#define MSG_TYPE_INDEX   0
#define MSG_TYPE_MASK   0xFF
#define MSG_TYPE_SHIFT   0
#define MESSAGE_QUEUE_STATUS_MESSAGE_RECOGNIZED   0xff
#define MESSAGE_QUEUE_STATUS_SCRATCH_ONLY   0xfe
#define REGISTER_MESSAGE(msg, func)

Typedefs

typedef uint8_t(* msgqueue_request_handler_t) (const union request *req, struct response *rsp)

Functions

void process_message_queues (void)
void msgqueue_register_handler (uint32_t msg_code, msgqueue_request_handler_t handler)
int msgqueue_request_push (uint32_t msgqueue_id, const union request *request)
int msgqueue_request_pop (uint32_t msgqueue_id, union request *request)
int msgqueue_response_push (uint32_t msgqueue_id, const struct response *response)
int msgqueue_response_pop (uint32_t msgqueue_id, struct response *response)
void init_msgqueue (void)

Macro Definition Documentation

◆ MESSAGE_QUEUE_STATUS_MESSAGE_RECOGNIZED

#define MESSAGE_QUEUE_STATUS_MESSAGE_RECOGNIZED   0xff

◆ MESSAGE_QUEUE_STATUS_SCRATCH_ONLY

#define MESSAGE_QUEUE_STATUS_SCRATCH_ONLY   0xfe

◆ MSG_QUEUE_POINTER_WRAP

#define MSG_QUEUE_POINTER_WRAP   (2 * MSG_QUEUE_SIZE)

◆ MSG_QUEUE_SIZE

#define MSG_QUEUE_SIZE   4

◆ MSG_TYPE_INDEX

#define MSG_TYPE_INDEX   0

◆ MSG_TYPE_MASK

#define MSG_TYPE_MASK   0xFF

◆ MSG_TYPE_SHIFT

#define MSG_TYPE_SHIFT   0

◆ NUM_MSG_QUEUES

#define NUM_MSG_QUEUES   4

◆ REGISTER_MESSAGE

#define REGISTER_MESSAGE ( msg,
func )
Value:
const STRUCT_SECTION_ITERABLE(msgqueue_handler, registration_for_##msg) = { \
.msg_type = msg, \
.handler = func, \
}
const STRUCT_SECTION_ITERABLE(msgqueue_handler, registration_for_TT_SMC_MSG_AICLK_GO_BUSY)
Definition msgqueue.h:149

◆ REQUEST_MSG_LEN

#define REQUEST_MSG_LEN   8

◆ RESPONSE_MSG_LEN

#define RESPONSE_MSG_LEN   8

Typedef Documentation

◆ msgqueue_request_handler_t

typedef uint8_t(* msgqueue_request_handler_t) (const union request *req, struct response *rsp)

Function Documentation

◆ init_msgqueue()

void init_msgqueue ( void )

◆ msgqueue_register_handler()

void msgqueue_register_handler ( uint32_t msg_code,
msgqueue_request_handler_t handler )

◆ msgqueue_request_pop()

int msgqueue_request_pop ( uint32_t msgqueue_id,
union request * request )

◆ msgqueue_request_push()

int msgqueue_request_push ( uint32_t msgqueue_id,
const union request * request )

◆ msgqueue_response_pop()

int msgqueue_response_pop ( uint32_t msgqueue_id,
struct response * response )

◆ msgqueue_response_push()

int msgqueue_response_push ( uint32_t msgqueue_id,
const struct response * response )

◆ process_message_queues()

void process_message_queues ( void )