aboutsummaryrefslogtreecommitdiffstats
path: root/include/nvgpu/mc.h
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2021-09-23 12:49:27 -0400
committerJoshua Bakita <jbakita@cs.unc.edu>2021-09-23 12:49:27 -0400
commit0596e479ffcca43957f8d32127cea5527460b983 (patch)
tree2ea671a4df3def4a72ac3edbce645ff661150cb7 /include/nvgpu/mc.h
parenta7564070dcdf75de4f848af936e3d76ed01833e1 (diff)
Add APIs to enable/disable a channel and switch to or preempt a specific TSG
Adds: - /proc/preempt_tsg which takes a TSG ID - /proc/disable_channel which takes a channel ID - /proc/enable_channel which takes a channel ID - /proc/switch_to_tsg which takes a TSG ID Also significantly expands documentation and structs available in nvdebug.h.
Diffstat (limited to 'include/nvgpu/mc.h')
0 files changed, 0 insertions, 0 deletions
='n56' href='#n56'>56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165




































































































































































                                                                                  
/*
  -----------------------------------------------------------------------
  Copyright (c) 2001 Dr Brian Gladman <brg@gladman.uk.net>, Worcester, UK

  TERMS

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  are met:
  1. Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in the
     documentation and/or other materials provided with the distribution.

  This software is provided 'as is' with no guarantees of correctness or
  fitness for purpose.
  -----------------------------------------------------------------------

  1. FUNCTION

  The AES algorithm Rijndael implemented for block and key sizes of
  128 bits (16 bytes) by Brian Gladman.

  This is an implementation of the AES encryption algorithm (Rijndael)
  designed by Joan Daemen and Vincent Rijmen.

  2. THE CIPHER INTERFACE

  byte                    (an unsigned 8-bit type)
  word                    (an unsigned 32-bit type)
  aes_ret:                (a signed 16 bit type for function return values)
       aes_good            (value != 0, a good return)
       aes_bad             (value == 0, an error return)
  enum aes_key:           (encryption direction)
       enc                 (set key for encryption)
       dec                 (set key for decryption)
       both                (set key for both)
  class or struct aes     (structure for context)

  C subroutine calls:

  aes_ret set_blk(const word block_length, aes *cx)  (variable block size)
  aes_ret set_key(const byte key[], const word key_length,
                  const enum aes_key direction, aes *cx)
  aes_ret encrypt(const byte input_blk[], byte output_blk[], const aes *cx)
  aes_ret decrypt(const byte input_blk[], byte output_blk[], const aes *cx)

  IMPORTANT NOTE: If you are using this C interface and your compiler does
  not set the memory used for objects to zero before use, you will need to
  ensure that cx.mode is set to zero before using the C subroutine calls.

  The block length inputs to set_block and set_key are in numbers of
  BYTES, not bits.  The calls to subroutines must be made in the above
  order but multiple calls can be made without repeating earlier calls
  if their parameters have not changed. If the cipher block length is
  variable but set_blk has not been called before cipher operations a
  value of 16 is assumed (that is, the AES block size). In contrast to
  earlier versions the block and key length parameters are now checked
  for correctness and the encryption and decryption routines check to
  ensure that an appropriate key has been set before they are called.

*/

#ifndef _AES_H
#define _AES_H

/* The only supported block size for the benchmark is 16 */
#define BLOCK_SIZE  16

/*
  The number of key schedule words for different block and key lengths
  (allowing for the method of computation which requires the length to
  be a multiple of the key length):

  Key Schedule    key length (bytes)
  Length          16  20  24  28  32
               ---------------------
  block     16 |  44  60  54  56  64