2013-05-24 23:35:29 +00:00
|
|
|
/*
|
|
|
|
* Raspberry Pi support library for the ACK
|
|
|
|
* © 2013 David Given
|
|
|
|
* This file is redistributable under the terms of the 3-clause BSD license.
|
|
|
|
* See the file 'Copying' in the root of the distribution for the full text.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PI_H
|
|
|
|
#define PI_H
|
|
|
|
|
2013-05-26 18:41:37 +00:00
|
|
|
/* When running in kernel mode, this structure gets the incoming parameters.
|
|
|
|
* In bare metal mode, it's gibberish. */
|
|
|
|
|
|
|
|
struct pi_kernel_parameters
|
|
|
|
{
|
|
|
|
int r5;
|
|
|
|
int r4;
|
|
|
|
void* r3;
|
|
|
|
void* r2;
|
|
|
|
void* r1;
|
|
|
|
void* r0;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct pi_kernel_parameters* pi_kernel_parameters;
|
|
|
|
|
2013-05-24 23:35:29 +00:00
|
|
|
/* Initialise the mini UART (only do this if running on bare metal! */
|
2013-05-25 23:22:39 +00:00
|
|
|
extern void pi_init_uart(void);
|
2013-05-24 23:35:29 +00:00
|
|
|
|
|
|
|
/* Converts a pointer from a physical address to a user address. */
|
2013-05-25 23:22:39 +00:00
|
|
|
extern void* pi_phys_to_user(void* ptr);
|
2013-05-24 23:35:29 +00:00
|
|
|
|
|
|
|
/* Converts a pointer from a user address to a physical address. */
|
2013-05-25 23:22:39 +00:00
|
|
|
extern void* pi_user_to_phys(void* ptr);
|
2013-05-24 23:35:29 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|