Run Nick G's spellchecker github.com/client9/misspell, carefuly fix what it found (#4235)

This commit is contained in:
dkegel-fastly
2024-04-19 06:57:01 -07:00
committed by GitHub
parent 7122755725
commit 39029cc376
39 changed files with 48 additions and 48 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ type TargetSpec struct {
Inherits []string `json:"inherits,omitempty"`
Triple string `json:"llvm-target,omitempty"`
CPU string `json:"cpu,omitempty"`
ABI string `json:"target-abi,omitempty"` // rougly equivalent to -mabi= flag
ABI string `json:"target-abi,omitempty"` // roughly equivalent to -mabi= flag
Features string `json:"features,omitempty"`
GOOS string `json:"goos,omitempty"`
GOARCH string `json:"goarch,omitempty"`
+2 -2
View File
@@ -2181,7 +2181,7 @@ func (b *builder) createExpr(expr ssa.Value) (llvm.Value, error) {
return llvm.Value{}, b.makeError(expr.Pos(), "todo: indexaddr: "+ptrTyp.String())
}
// Make sure index is at least the size of uintptr becuase getelementptr
// Make sure index is at least the size of uintptr because getelementptr
// assumes index is a signed integer.
index = b.extendInteger(index, expr.Index.Type(), b.uintptrType)
@@ -2557,7 +2557,7 @@ func (b *builder) createBinOp(op token.Token, typ, ytyp types.Type, x, y llvm.Va
sizeY := b.targetData.TypeAllocSize(y.Type())
// Check if the shift is bigger than the bit-width of the shifted value.
// This is UB in LLVM, so it needs to be handled seperately.
// This is UB in LLVM, so it needs to be handled separately.
// The Go spec indirectly defines the result as 0.
// Negative shifts are handled earlier, so we can treat y as unsigned.
overshifted := b.CreateICmp(llvm.IntUGE, y, llvm.ConstInt(y.Type(), 8*sizeX, false), "shift.overflow")
+2 -2
View File
@@ -1,5 +1,5 @@
// Package llvmutil contains utility functions used across multiple compiler
// packages. For example, they may be used by both the compiler pacakge and
// packages. For example, they may be used by both the compiler package and
// transformation packages.
//
// Normally, utility packages are avoided. However, in this case, the utility
@@ -28,7 +28,7 @@ func CreateEntryBlockAlloca(builder llvm.Builder, t llvm.Type, name string) llvm
}
// CreateTemporaryAlloca creates a new alloca in the entry block and adds
// lifetime start infromation in the IR signalling that the alloca won't be used
// lifetime start information in the IR signalling that the alloca won't be used
// before this point.
//
// This is useful for creating temporary allocas for intrinsics. Don't forget to
+1 -1
View File
@@ -214,7 +214,7 @@ func listGorootMergeLinks(goroot, tinygoroot string, overrides map[string]bool)
return merges, nil
}
// needsSyscallPackage returns whether the syscall package should be overriden
// needsSyscallPackage returns whether the syscall package should be overridden
// with the TinyGo version. This is the case on some targets.
func needsSyscallPackage(buildTags []string) bool {
for _, tag := range buildTags {
+1 -1
View File
@@ -430,7 +430,7 @@ func (p *Package) parseFiles() ([]*ast.File, error) {
var files []*ast.File
var fileErrs []error
// Parse all files (incuding CgoFiles).
// Parse all files (including CgoFiles).
parseFile := func(file string) {
if !filepath.IsAbs(file) {
file = filepath.Join(p.Dir, file)
+2 -2
View File
@@ -57,7 +57,7 @@ func Count(b []byte, c byte) int {
// Count the number of instances of a byte in a string.
func CountString(s string, c byte) int {
// Use a simple implementation, as there is no intrinsic that does this like we want.
// Currently, the compiler does not generate zero-copy byte-string conversions, so this needs to be seperate from Count.
// Currently, the compiler does not generate zero-copy byte-string conversions, so this needs to be separate from Count.
n := 0
for i := 0; i < len(s); i++ {
if s[i] == c {
@@ -216,7 +216,7 @@ func HashStrRev[T string | []byte](sep T) (uint32, uint32) {
}
// IndexRabinKarpBytes uses the Rabin-Karp search algorithm to return the index of the
// first occurence of substr in s, or -1 if not present.
// first occurrence of substr in s, or -1 if not present.
//
// This function was removed in Go 1.22.
func IndexRabinKarpBytes(s, sep []byte) int {
+1 -1
View File
@@ -44,7 +44,7 @@ func Current() *Task {
// This function may only be called when running on a goroutine stack, not when running on the system stack or in an interrupt.
func Pause() {
// Check whether the canary (the lowest address of the stack) is still
// valid. If it is not, a stack overflow has occured.
// valid. If it is not, a stack overflow has occurred.
if *currentTask.state.canaryPtr != stackCanary {
runtimePanic("goroutine stack overflow")
}
+1 -1
View File
@@ -26,7 +26,7 @@
// SoftDevice (s140v7) must be flashed first to enable use of bluetooth on this board.
// See https://github.com/tinygo-org/bluetooth
//
// SoftDevice overwrites original bootloader and flashing method described above is not avalable anymore.
// SoftDevice overwrites original bootloader and flashing method described above is not available anymore.
// Instead, please use debug probe and flash your code with "nano-33-ble-s140v7" target.
package machine
+4 -4
View File
@@ -1304,7 +1304,7 @@ func (spi SPI) Transfer(w byte) (byte, error) {
return byte(spi.Bus.DATA.Get()), nil
}
// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// The Tx method knows about this, and offers a few different ways of calling it.
//
@@ -1459,7 +1459,7 @@ func (tcc *TCC) Configure(config PWMConfig) error {
for tcc.timer().SYNCBUSY.Get() != 0 {
}
// Return any error that might have occured in the tcc.setPeriod call.
// Return any error that might have occurred in the tcc.setPeriod call.
return err
}
@@ -1606,7 +1606,7 @@ func (tcc *TCC) Counter() uint32 {
return tcc.timer().COUNT.Get()
}
// Some constans to make pinTimerMapping below easier to read.
// Some constants to make pinTimerMapping below easier to read.
const (
pinTCC0 = 1
pinTCC1 = 2
@@ -1759,7 +1759,7 @@ func (tcc *TCC) Set(channel uint8, value uint32) {
}
}
// EnterBootloader should perform a system reset in preperation
// EnterBootloader should perform a system reset in preparation
// to switch to the bootloader to flash new firmware.
func EnterBootloader() {
arm.DisableInterrupts()
+2 -2
View File
@@ -1587,7 +1587,7 @@ func (spi SPI) Transfer(w byte) (byte, error) {
return byte(spi.Bus.DATA.Get()), nil
}
// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// The Tx method knows about this, and offers a few different ways of calling it.
//
@@ -1720,7 +1720,7 @@ func (tcc *TCC) Configure(config PWMConfig) error {
for tcc.timer().SYNCBUSY.Get() != 0 {
}
// Return any error that might have occured in the tcc.setPeriod call.
// Return any error that might have occurred in the tcc.setPeriod call.
return err
}
+1 -1
View File
@@ -155,7 +155,7 @@ func (can *CAN) Configure(config CANConfig) error {
}
// Callbacks to be called for CAN.SetInterrupt(). Wre're using the magic
// constant 2 and 32 here beacuse th SAM E51/E54 has 2 CAN and 32 interrupt
// constant 2 and 32 here because the SAM E51/E54 has 2 CAN and 32 interrupt
// sources.
var (
canInstances [2]*CAN
+1 -1
View File
@@ -460,7 +460,7 @@ func (spi SPI) Transfer(w byte) (byte, error) {
return byte(spi.Bus.W0.Get()), nil
}
// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// This is accomplished by sending zero bits if r is bigger than w or discarding
// the incoming data if w is bigger than r.
+1 -1
View File
@@ -312,7 +312,7 @@ func (uart *UART) configure(config UARTConfig, regs registerSet) error {
initUARTClock(uart.Bus, regs)
// - disbale TX/RX clock to make sure the UART transmitter or receiver is not at work during configuration
// - disable TX/RX clock to make sure the UART transmitter or receiver is not at work during configuration
uart.Bus.SetCLK_CONF_TX_SCLK_EN(0)
uart.Bus.SetCLK_CONF_RX_SCLK_EN(0)
+1 -1
View File
@@ -234,7 +234,7 @@ func (spi SPI) Transfer(w byte) (byte, error) {
return byte(spi.Bus.GetW0()), nil
}
// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// This is accomplished by sending zero bits if r is bigger than w or discarding
// the incoming data if w is bigger than r.
+1 -1
View File
@@ -66,7 +66,7 @@ func (spi SPI) Transfer(w byte) (byte, error) {
return spiTransfer(spi.Bus, w), nil
}
// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// The Tx method knows about this, and offers a few different ways of calling it.
//
+1 -1
View File
@@ -108,7 +108,7 @@ func (p Pin) Get() bool {
func (p Pin) SetInterrupt(change PinChange, callback func(Pin)) error {
// Some variables to easily check whether a channel was already configured
// as an event channel for the given pin.
// This is not just an optimization, this is requred: the datasheet says
// This is not just an optimization, this is required: the datasheet says
// that configuring more than one channel for a given pin results in
// unpredictable behavior.
expectedConfigMask := uint32(nrf.GPIOTE_CONFIG_MODE_Msk | nrf.GPIOTE_CONFIG_PSEL_Msk)
+1 -1
View File
@@ -133,7 +133,7 @@ func (spi SPI) Transfer(w byte) (byte, error) {
return byte(r), nil
}
// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// The Tx method knows about this, and offers a few different ways of calling it.
//
+1 -1
View File
@@ -277,7 +277,7 @@ func (spi SPI) Transfer(w byte) (byte, error) {
return buf[0], err
}
// Tx handles read/write operation for SPI interface. Since SPI is a syncronous
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous
// write/read interface, there must always be the same number of bytes written
// as bytes read. Therefore, if the number of bytes don't match it will be
// padded until they fit: if len(w) > len(r) the extra bytes received will be
+1 -1
View File
@@ -348,7 +348,7 @@ func (i2c *I2C) tx(addr uint8, tx, rx []byte, timeout_us uint64) (err error) {
}
if abort || last {
// If the transaction was aborted or if it completed
// successfully wait until the STOP condition has occured.
// successfully wait until the STOP condition has occurred.
// TODO Could there be an abort while waiting for the STOP
// condition here? If so, additional code would be needed here
+1 -1
View File
@@ -48,7 +48,7 @@ type SPI struct {
Bus *rp.SPI0_Type
}
// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// The Tx method knows about this, and offers a few different ways of calling it.
//
+1 -1
View File
@@ -23,7 +23,7 @@ const APB2_TIM_FREQ = 110e6 // 110MHz
// Configure the UART.
func (uart *UART) configurePins(config UARTConfig) {
if config.RX.getPort() == stm32.GPIOG || config.TX.getPort() == stm32.GPIOG {
// Enable VDDIO2 power supply, which is an independant power supply for the PGx pins
// Enable VDDIO2 power supply, which is an independent power supply for the PGx pins
stm32.PWR.CR2.SetBits(stm32.PWR_CR2_IOSV)
}
+1 -1
View File
@@ -5,7 +5,7 @@
package machine
// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// The Tx method knows about this, and offers a few different ways of calling it.
//
+1 -1
View File
@@ -30,7 +30,7 @@ type Filesystem interface {
// OpenFile opens the named file.
OpenFile(name string, flag int, perm FileMode) (uintptr, error)
// Mkdir creates a new directoy with the specified permission (before
// Mkdir creates a new directory with the specified permission (before
// umask). Some filesystems may not support directories or permissions.
Mkdir(name string, perm FileMode) error
+1 -1
View File
@@ -11,7 +11,7 @@ import (
// In particular, on i386 and arm, the function syscall.seek is missing, breaking syscall.Seek.
// This in turn causes os.(*File).Seek, time, io/fs, and path/filepath to fail to link.
//
// To temporarly let all the above at least link, provide a stub for syscall.seek.
// To temporarily let all the above at least link, provide a stub for syscall.seek.
// This belongs in syscall, but on linux, we use upstream's syscall.
// Remove once we support Go Assembly.
// TODO: make this a non-stub, and thus fix the whole problem?
+2 -2
View File
@@ -76,7 +76,7 @@ func (b *channelBlockedList) remove(old *channelBlockedList) *channelBlockedList
return b
}
// detatch removes all other channel operations that are part of the same select statement.
// detach removes all other channel operations that are part of the same select statement.
// If the input is not part of a select statement, this is a no-op.
// This must be called before resuming any task blocked on a channel operation in order to ensure that it is not placed on the runqueue twice.
func (b *channelBlockedList) detach() {
@@ -88,7 +88,7 @@ func (b *channelBlockedList) detach() {
// cancel all other channel operations that are part of this select statement
switch {
case &b.allSelectOps[i] == b:
// This entry is the one that was already detatched.
// This entry is the one that was already detached.
continue
case v.t == nil:
// This entry is not used (nil channel).
+2 -2
View File
@@ -410,7 +410,7 @@ func GC() {
runGC()
}
// runGC performs a garbage colleciton cycle. It is the internal implementation
// runGC performs a garbage collection cycle. It is the internal implementation
// of the runtime.GC() function. The difference is that it returns the number of
// free bytes in the heap after the GC is finished.
func runGC() (freeBytes uintptr) {
@@ -424,7 +424,7 @@ func runGC() (freeBytes uintptr) {
if baremetal && hasScheduler {
// Channel operations in interrupts may move task pointers around while we are marking.
// Therefore we need to scan the runqueue seperately.
// Therefore we need to scan the runqueue separately.
var markedTaskQueue task.Queue
runqueueScan:
for !runqueue.Empty() {
+1 -1
View File
@@ -7,7 +7,7 @@
// however use a bit more RAM to store the layout of each object.
//
// The pointer/non-pointer information for objects is stored in the first word
// of the object. It is described below but in essense it contains a bitstring
// of the object. It is described below but in essence it contains a bitstring
// of a particular size. This size does not indicate the size of the object:
// instead the allocated object is a multiple of the bitstring size. This is so
// that arrays and slices can store the size of the object efficiently. The
+1 -1
View File
@@ -26,7 +26,7 @@ func New(id int, handler func(Interrupt)) Interrupt
// and use that in an Interrupt object. That way the compiler will be able to
// optimize away all interrupt handles that are never used in a program.
// This system only works when interrupts need to be enabled before use and this
// is done only through calling Enable() on this object. If interrups cannot
// is done only through calling Enable() on this object. If interrupts cannot
// individually be enabled/disabled, the compiler should create a pseudo-call
// (like runtime/interrupt.use()) that keeps the interrupt alive.
type handle struct {
+1 -1
View File
@@ -169,7 +169,7 @@ func handleInterrupt() {
// save MSTATUS & MEPC, which could be overwritten by another CPU interrupt
mstatus := riscv.MSTATUS.Get()
mepc := riscv.MEPC.Get()
// Useing threshold to temporary disable this interrupts.
// Using threshold to temporary disable this interrupts.
// FYI: using CPU interrupt enable bit make runtime to loose interrupts.
reg := (*volatile.Register32)(unsafe.Add(unsafe.Pointer(&esp.INTERRUPT_CORE0.CPU_INT_PRI_0), interruptNumber*4))
thresholdSave := reg.Get()
+1 -1
View File
@@ -107,7 +107,7 @@ func findGlobals(found func(start, end uintptr)) {
}
}
// Move on to the next load command (wich may or may not be a
// Move on to the next load command (which may or may not be a
// LC_SEGMENT_64).
cmd = (*segmentLoadCommand)(unsafe.Add(unsafe.Pointer(cmd), cmd.cmdsize))
}
+1 -1
View File
@@ -318,7 +318,7 @@ func readRTC() uint32 {
// ticks are in microseconds
// Returns true if the timer completed.
// Returns false if another interrupt occured which requires an early return to scheduler.
// Returns false if another interrupt occurred which requires an early return to scheduler.
func timerSleep(ticks uint32) bool {
timerWakeup.Set(0)
if ticks < 7 {
+1 -1
View File
@@ -307,7 +307,7 @@ func readRTC() uint32 {
// ticks are in microseconds
// Returns true if the timer completed.
// Returns false if another interrupt occured which requires an early return to scheduler.
// Returns false if another interrupt occurred which requires an early return to scheduler.
func timerSleep(ticks uint32) bool {
timerWakeup.Set(0)
if ticks < 8 {
+1 -1
View File
@@ -115,7 +115,7 @@ func sleepTicks(d timeUnit) {
// Sleep until the next interrupt happens.
avr.Asm("sei\nsleep\ncli")
if cmpMatch.Get() != 0 {
// The CMP interrupt occured, so we have slept long enough.
// The CMP interrupt occurred, so we have slept long enough.
cmpMatch.Set(0)
break
}
+1 -1
View File
@@ -8,7 +8,7 @@ import (
// This function is called at HardFault.
// Before this function is called, the stack pointer is reset to the initial
// stack pointer (loaded from addres 0x0) and the previous stack pointer is
// stack pointer (loaded from address 0x0) and the previous stack pointer is
// passed as an argument to this function. This allows for easy inspection of
// the stack the moment a HardFault occurs, but it means that the stack will be
// corrupted by this function and thus this handler must not attempt to recover.
+1 -1
View File
@@ -85,7 +85,7 @@ func handleInterrupt() {
riscv.MCAUSE.Set(0)
}
// initPeripherals configures periperhals the way the runtime expects them.
// initPeripherals configures peripherals the way the runtime expects them.
func initPeripherals() {
// Configure PLL to output 320MHz.
// R=2: divide 16MHz to 8MHz
+1 -1
View File
@@ -105,7 +105,7 @@ func handleInterrupt() {
riscv.MCAUSE.Set(0)
}
// initPeripherals configures periperhals the way the runtime expects them.
// initPeripherals configures peripherals the way the runtime expects them.
func initPeripherals() {
// Enable APB0 clock.
kendryte.SYSCTL.CLK_EN_CENT.SetBits(kendryte.SYSCTL_CLK_EN_CENT_APB0_CLK_EN)
+1 -1
View File
@@ -344,7 +344,7 @@ func Fdclosedir(dir uintptr) (err error) {
func Readdir(dir uintptr) (dirent *Dirent, err error) {
// There might be a leftover errno value in the global variable, so we have
// to clear it before calling readdir because we cannot know whether a nil
// return means that we reached EOF or that an error occured.
// return means that we reached EOF or that an error occurred.
libcErrno = 0
dirent = libc_readdir(unsafe.Pointer(dir))
+1 -1
View File
@@ -224,7 +224,7 @@ func CallGraph(f *elf.File, callsIndirectFunction []string) (map[string][]*CallN
for name, size := range knownFrameSizes {
if sym, ok := symbolNames[name]; ok {
if len(sym) > 1 {
return nil, fmt.Errorf("expected zero or one occurence of the symbol %s, found %d", name, len(sym))
return nil, fmt.Errorf("expected zero or one occurrence of the symbol %s, found %d", name, len(sym))
}
sym[0].FrameSize = size
sym[0].FrameSizeType = Bounded
+1 -1
View File
@@ -27,7 +27,7 @@ func OptimizePackage(mod llvm.Module, config *compileopts.Config) {
// passes.
//
// Please note that some optimizations are not optional, thus Optimize must
// alwasy be run before emitting machine code.
// always be run before emitting machine code.
func Optimize(mod llvm.Module, config *compileopts.Config) []error {
optLevel, speedLevel, _ := config.OptLevel()