summaryrefslogtreecommitdiffstats
path: root/baseline/source/rijndael_dec/rijndael_dec_libc.h
blob: eb7b8d69784f98265b99f96be749d73ae2720f6e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef RIJNDAEL_DEC_LIBC_H
#define RIJNDAEL_DEC_LIBC_H

int rijndael_dec_toupper ( int c );

enum _Origin_ { RIJNDAEL_DEC_SEEK_SET, RIJNDAEL_DEC_SEEK_CUR, RIJNDAEL_DEC_SEEK_END };
typedef enum _Origin_ Origin;
struct rijndael_dec_FILE {
  unsigned char *data;
  unsigned long size;
  unsigned cur_pos;
};

unsigned long rijndael_dec_fread ( void *ptr, unsigned long size,
                                   unsigned long count, struct rijndael_dec_FILE *stream );
unsigned long rijndael_dec_fwrite ( const void *ptr, unsigned long size,
                                    unsigned long count, struct rijndael_dec_FILE *stream );
int    rijndael_dec_fseek  ( struct rijndael_dec_FILE *stream, long int offset,
                             Origin origin );
int    rijndael_dec_fgetpos( struct rijndael_dec_FILE *stream,
                             unsigned *position );
int    rijndael_dec_feof   ( struct rijndael_dec_FILE *stream );

#endif  // RIJNDAEL_DEC_LIBC_H
ile *f) { return (uintptr_t)pde_data(file_inode(f)); } static inline int file2parentgpuidx(const struct file *f) { // Should be safe to call on ProcFS entries, as our parent should (?) // still exist if we're called. If not, there are worse races in this // module. return (uintptr_t)pde_data(file_dentry(f)->d_parent->d_inode); } #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) // Commit 643eb158a3 in nvgpu moved the mapped registers to the second entry // of the gk20a struct (after a function pointer). This change was made as L4T // was upgraded from Linux 4.9 to 5.10 (r32 -> r34+) // Note that this is wrong if nvgpu was built without CONFIG_NVGPU_NON_FUSA // i.e. if FUSA was enabled, this is wrong. #define gk20a_regs(gk20a) (*(void**)((void*)gk20a + sizeof(void(*)(void)))) #else #include <os/linux/os_linux.h> // For struct nvgpu_os_linux, which holds regs #define gk20a_regs(gk20a) (container_of(gk20a, struct nvgpu_os_linux, g)->regs) #endif