Browse Source

Elaborate on spi_port+stack problem in comments

Luke Dashjr 12 years ago
parent
commit
ceccb75c81
3 changed files with 3 additions and 3 deletions
  1. 1 1
      driver-hashbuster.c
  2. 1 1
      driver-littlefury.c
  3. 1 1
      spidevc.h

+ 1 - 1
driver-hashbuster.c

@@ -149,7 +149,7 @@ bool hashbuster_lowl_match(const struct lowlevel_device_info * const info)
 static
 int hashbuster_chip_count(hid_device *h)
 {
-	/* Do not allocate spi_port on the Stack - EXC_BAD_ACCESS on OS X */
+	/* Do not allocate spi_port on the stack! OS X, at least, has a 512 KB default stack size for secondary threads */
 	struct spi_port *spi = malloc(sizeof(*spi));
 	spi->txrx = hashbuster_spi_txrx;
 	spi->userp = h;

+ 1 - 1
driver-littlefury.c

@@ -232,7 +232,7 @@ bool littlefury_lowl_match(const struct lowlevel_device_info * const info)
 static
 int littlefury_chip_count(struct cgpu_info * const info)
 {
-	/* Do not allocate spi_port on the Stack - EXC_BAD_ACCESS on OS X */
+	/* Do not allocate spi_port on the stack! OS X, at least, has a 512 KB default stack size for secondary threads */
 	struct spi_port *spi = malloc(sizeof(*spi));
 	spi->txrx = littlefury_txrx;
 	spi->cgpu = info;

+ 1 - 1
spidevc.h

@@ -10,7 +10,7 @@
 /* Initialize SPI using this function */
 void spi_init(void);
 
-/* Do not allocate spi_port on the Stack - EXC_BAD_ACCESS on OS X */
+/* Do not allocate spi_port on the stack! OS X, at least, has a 512 KB default stack size for secondary threads */
 struct spi_port {
 	/* TX-RX single frame */
 	bool (*txrx)(struct spi_port *port);