aboutsummaryrefslogtreecommitdiff
path: root/pk/sbi.h
blob: cd7594fe83e4ae1230368ffe95faef3993308a14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef _ASM_RISCV_SBI_H
#define _ASM_RISCV_SBI_H

typedef struct {
  unsigned long base;
  unsigned long size;
  unsigned long node_id;
} memory_block_info;

unsigned long sbi_query_memory(unsigned long id, memory_block_info *p);

unsigned long sbi_hart_id(void);
unsigned long sbi_num_harts(void);
unsigned long sbi_timebase(void);
void sbi_send_ipi(uintptr_t hart_id);
void sbi_console_putchar(unsigned char ch);

typedef struct {
  unsigned long dev;
  unsigned long cmd;
  unsigned long data;
  unsigned long sbi_private_data;
} sbi_device_message;

unsigned long sbi_send_device_request(uintptr_t req);
uintptr_t sbi_receive_device_response(void);

#endif